From report at bugs.python.org Mon Apr 1 01:37:22 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 05:37:22 +0000 Subject: [issue36490] Modernize function signature format in Archiving section of shutil doc In-Reply-To: <1554005288.19.0.789880523073.issue36490@roundup.psfhosted.org> Message-ID: <1554097042.98.0.0388563165224.issue36490@roundup.psfhosted.org> Inada Naoki added the comment: I don' think they are modern-style vs legacy-style. When explicit default value is present, the default value is documented in signature like `param=42`. On the other hand, when default value is not explicit (just an placeholder), the parameter is expressed using optional group `[param]`. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 02:16:49 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 01 Apr 2019 06:16:49 +0000 Subject: [issue36492] Deprecate passing some conflicting arguments by keyword In-Reply-To: <1554016646.98.0.667285997331.issue36492@roundup.psfhosted.org> Message-ID: <1554099409.29.0.161058195684.issue36492@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 42a139ed88c487f325a241c6ee8b308b3c045975 by Serhiy Storchaka in branch 'master': bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637) https://github.com/python/cpython/commit/42a139ed88c487f325a241c6ee8b308b3c045975 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 03:03:08 2019 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 01 Apr 2019 07:03:08 +0000 Subject: [issue36493] Add math.midpoint(a,b) function In-Reply-To: <1554037806.92.0.427188886689.issue36493@roundup.psfhosted.org> Message-ID: <1554102188.66.0.449963977376.issue36493@roundup.psfhosted.org> Mark Dickinson added the comment: Yes, I'd definitely expect `midpoint(inf, -inf)` to be `nan`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 03:12:31 2019 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 01 Apr 2019 07:12:31 +0000 Subject: [issue36493] Add math.midpoint(a,b) function In-Reply-To: <1554037806.92.0.427188886689.issue36493@roundup.psfhosted.org> Message-ID: <1554102751.22.0.217568451762.issue36493@roundup.psfhosted.org> Mark Dickinson added the comment: Special cases aside, I think this is a YAGNI. The "obvious" formulas `(a + b)/2)` and `0.5 * (a + b)` _do_ do exactly the right thing (including giving a perfectly correctly-rounded answer with round-ties-to-even on a typical IEEE 754-using machine) provided that subnormals and values very close to the upper limit are avoided. If you're doing floating-point arithmetic with values of size > 1e300, you've probably already got significant issues. I could see specialist uses for this, e.g., in a general purpose bisection algorithm, but I'm not convinced it's worth adding something to the math library just for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 03:13:32 2019 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 01 Apr 2019 07:13:32 +0000 Subject: [issue36493] Add math.midpoint(a,b) function In-Reply-To: <1554037806.92.0.427188886689.issue36493@roundup.psfhosted.org> Message-ID: <1554102812.76.0.778655199719.issue36493@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 03:20:36 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 01 Apr 2019 07:20:36 +0000 Subject: [issue36492] Deprecate passing some conflicting arguments by keyword In-Reply-To: <1554016646.98.0.667285997331.issue36492@roundup.psfhosted.org> Message-ID: <1554103236.59.0.188909822439.issue36492@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +12577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 03:59:29 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 01 Apr 2019 07:59:29 +0000 Subject: [issue36492] Deprecate passing some conflicting arguments by keyword In-Reply-To: <1554016646.98.0.667285997331.issue36492@roundup.psfhosted.org> Message-ID: <1554105569.97.0.175326934296.issue36492@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a37f356de19828241bf19129f804369794c72ed3 by Serhiy Storchaka in branch '3.7': [3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645) https://github.com/python/cpython/commit/a37f356de19828241bf19129f804369794c72ed3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 04:00:55 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 01 Apr 2019 08:00:55 +0000 Subject: [issue36492] Deprecate passing some conflicting arguments by keyword In-Reply-To: <1554016646.98.0.667285997331.issue36492@roundup.psfhosted.org> Message-ID: <1554105655.26.0.64746826363.issue36492@roundup.psfhosted.org> Serhiy Storchaka added the comment: Fixes (but not deprecations) were backported to 3.7. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 04:02:44 2019 From: report at bugs.python.org (Tim Peters) Date: Mon, 01 Apr 2019 08:02:44 +0000 Subject: [issue36493] Add math.midpoint(a,b) function In-Reply-To: <1554037806.92.0.427188886689.issue36493@roundup.psfhosted.org> Message-ID: <1554105764.62.0.675674537872.issue36493@roundup.psfhosted.org> Tim Peters added the comment: I'm inclined to agree with Mark - the wholly naive algorithm is already "perfect" away from extreme (whether large or small) magnitudes, and can't be beat for speed either. This kind of thing gets much more attractive in IEEE single precision, where getting near the extremes can be common in some apps. That said, at a higher level there's no end to FP functions that _could_ be implemented to be more accurate in some (even many) cases. That it's possible isn't enough, on its own, to justify all the eternal costs of supplying it. Significant real life use cases make for far more compelling justification. For new FP stuff, the first thing I ask is "does numpy/scipy/mpmath supply it?". I don't know in this case, but if the answer is "no", then it's a pretty safe bet that number-crunching Python users have insignificant real use for it. If the answer is "yes", then the question changes to whether Pythoneers other than those _already_ using the major number-crunching Python packages have significant real uses for it. On that basis, e.g., accepting the whole `statistics` module was an easy call (many real uses outside of just specialists), but adding a function to do LU decomposition of a matrix is an easy reject (exceedingly useful, in fact, but those who need it almost certainly already use the Python packages that already supply it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 04:12:25 2019 From: report at bugs.python.org (LihuaZhao) Date: Mon, 01 Apr 2019 08:12:25 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1554106345.62.0.99736539627.issue31904@roundup.psfhosted.org> Change by LihuaZhao : ---------- pull_requests: +12578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 04:56:23 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 08:56:23 +0000 Subject: [issue36026] Different error message when sys.settrace is used In-Reply-To: <1550513164.21.0.815390267137.issue36026@roundup.psfhosted.org> Message-ID: <1554108983.46.0.922534815176.issue36026@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 62f9588663ebfea1735e9d142ef527395a6c2b95 by Inada Naoki in branch 'master': bpo-36026: make descr error message consistent (GH-11930) https://github.com/python/cpython/commit/62f9588663ebfea1735e9d142ef527395a6c2b95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 04:57:04 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 08:57:04 +0000 Subject: [issue36026] Different error message when sys.settrace is used In-Reply-To: <1550513164.21.0.815390267137.issue36026@roundup.psfhosted.org> Message-ID: <1554109024.41.0.396401693641.issue36026@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 05:27:07 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 01 Apr 2019 09:27:07 +0000 Subject: [issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default In-Reply-To: <1473217852.97.0.553971829799.issue27992@psf.upfronthosting.co.za> Message-ID: <1554110827.4.0.196215111207.issue27992@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the report. To be little more clear it returns the "basename of sys.argv[0]" at [0] than the attached patch that says "uses part of ``sys.argv[0]``" . [0] https://github.com/python/cpython/blob/62f9588663ebfea1735e9d142ef527395a6c2b95/Lib/argparse.py#L1638 ---------- nosy: +paul.j3, xtreak title: In the argparse there is a misleading words about %(prog)s value -> Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default versions: +Python 3.7, Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 05:35:34 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 09:35:34 +0000 Subject: [issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows In-Reply-To: <1393854882.06.0.561987523346.issue20844@psf.upfronthosting.co.za> Message-ID: <1554111334.36.0.283435591264.issue20844@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1 by Inada Naoki in branch 'master': bpo-20844: open script file with "rb" mode (GH-12616) https://github.com/python/cpython/commit/10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 05:44:49 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 09:44:49 +0000 Subject: [issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows In-Reply-To: <1393854882.06.0.561987523346.issue20844@psf.upfronthosting.co.za> Message-ID: <1554111889.02.0.0859495633751.issue20844@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12579 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 05:48:44 2019 From: report at bugs.python.org (LihuaZhao) Date: Mon, 01 Apr 2019 09:48:44 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1554112124.49.0.896362567279.issue31904@roundup.psfhosted.org> Change by LihuaZhao : ---------- pull_requests: +12580 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 06:21:29 2019 From: report at bugs.python.org (Michael Foord) Date: Mon, 01 Apr 2019 10:21:29 +0000 Subject: [issue30587] Mock with spec object does not ensure method call signatures In-Reply-To: <1554052062.13.0.86574463435.issue30587@roundup.psfhosted.org> Message-ID: <5DDE12CC-71FF-4D44-821F-C616D8F841BE@voidspace.org.uk> Michael Foord added the comment: Spec objects are currently dumb. It would be a new feature to add signature validation to them. I think it would be a useful feature though as currently autospec sort of obsoletes spec objects whilst being more heavyweight and harder to use. I think it would appropriate to add to 3.8 but not to 3.7. Compatibility with existing tests is the issue. The obvious answer is a flag to turn it on/off but that adds complexity to the API. My gut feeling is that spec objects are far more commonly used in situations where validation would be useful than a detriment. > On 31 Mar 2019, at 18:07, Karthikeyan Singaravelan wrote: > > > Karthikeyan Singaravelan added the comment: > > I am slightly concerned if spec should gain more responsibility than just validating attribute access which is mentioned in the docs. With the linked PR spec below would also validate the signature which is not done in Python 3.7 so this might break code for someone who only wants to validate access attribute access and not signature of the methods. It seems the PR also adds autospec argument to Mock that is currently not supported though spec and spec_set are supported. > > from unittest import mock > > def foo(lish): > pass > > mock_foo = mock.Mock(spec=foo) > mock_foo(1, 2) > > try: > mock_foo.non_existent > except AttributeError: > print("raises AttributeError for non-existent attribute") > > # 3.7 > > ? cpython git:(pr_1982) python3.7 /tmp/foo.py > raises AttributeError for non-existent attribute > > # With PR > > ? cpython git:(pr_1982) ./python.exe /tmp/foo.py > Traceback (most recent call last): > File "/tmp/foo.py", line 7, in > mock_foo(1, 2) > File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 1009, in __call__ > _mock_self._mock_check_sig(*args, **kwargs) > File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 103, in checksig > sig.bind(*args, **kwargs) > File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/inspect.py", line 3016, in bind > return args[0]._bind(args[1:], kwargs) > File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/inspect.py", line 2937, in _bind > raise TypeError('too many positional arguments') from None > TypeError: too many positional arguments > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 08:03:01 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 12:03:01 +0000 Subject: [issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows In-Reply-To: <1393854882.06.0.561987523346.issue20844@psf.upfronthosting.co.za> Message-ID: <1554120181.79.0.560735301901.issue20844@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 8384670615a90418fc52c3881242b7c10d1f2b13 by Inada Naoki in branch '3.7': bpo-20844: open script file with "rb" mode (GH-12616) https://github.com/python/cpython/commit/8384670615a90418fc52c3881242b7c10d1f2b13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 08:03:46 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 01 Apr 2019 12:03:46 +0000 Subject: [issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows In-Reply-To: <1393854882.06.0.561987523346.issue20844@psf.upfronthosting.co.za> Message-ID: <1554120226.18.0.113241394965.issue20844@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 09:54:16 2019 From: report at bugs.python.org (Thomas Buhrmann) Date: Mon, 01 Apr 2019 13:54:16 +0000 Subject: [issue36497] Undocumented behavior in csv.Sniffer (preferred delimiters) Message-ID: <1554126856.48.0.397677994988.issue36497@roundup.psfhosted.org> New submission from Thomas Buhrmann : When the Sniffer detects more than one possible delimiter, as e.g. in the following file "a;b;c;d,e;f;g;h" the result will always be the ',' delimiter, independent of how "dominant" another delimiter is. This is because the codepath analyzing dominance will only get executed if the undocumented Sniffer member Sniffer.preferred is overwritten by the user after initialization. While not strictly a bug, the behavior should probably be documented, and the 'preferred' member could be exposed as an argument in __init__() perhaps? ---------- components: Library (Lib) messages: 339291 nosy: thomas priority: normal severity: normal status: open title: Undocumented behavior in csv.Sniffer (preferred delimiters) type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 09:57:00 2019 From: report at bugs.python.org (SilentGhost) Date: Mon, 01 Apr 2019 13:57:00 +0000 Subject: [issue36497] Undocumented behavior in csv.Sniffer (preferred delimiters) In-Reply-To: <1554126856.48.0.397677994988.issue36497@roundup.psfhosted.org> Message-ID: <1554127020.13.0.650946848291.issue36497@roundup.psfhosted.org> Change by SilentGhost : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: -> needs patch versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 10:19:09 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Mon, 01 Apr 2019 14:19:09 +0000 Subject: [issue36488] os.sendfile() on BSD and macOS does not return bytes sent on EINTR In-Reply-To: <1553964458.43.0.741059488448.issue36488@roundup.psfhosted.org> Message-ID: <1554128349.64.0.667742533739.issue36488@roundup.psfhosted.org> Josh Rosenberg added the comment: Wasn't the point of PEP475 that all EINTR returns would be explicitly handled by retrying rather than forcing the user to handle it? Seems like the correct solution is still to retry, but on OSX/FreeBSD we'd need to update the offset and count arguments to account for the data that has already been sent. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 10:25:39 2019 From: report at bugs.python.org (Benjamin Krala) Date: Mon, 01 Apr 2019 14:25:39 +0000 Subject: [issue36498] combining dict comprehensing and lists lead to IndexError Message-ID: <1554128739.17.0.108677031645.issue36498@roundup.psfhosted.org> New submission from Benjamin Krala : Following code snipped leads to an IndexError in the last line. It basically puts EN_cmw into a dict where is a split on '->'. It avoid the bug you can change the 1 into -1. (By definition it shouldnt make a difference) EN_cmw = '''abandonned->abandoned aberation->aberration abilityes->abilities abilties->abilities abilty->ability abondon->abandon abbout->about ''' EN_cmw = EN_cmw.split('\n') EN_cmw = [string.strip() for string in EN_cmw] { line.split('->')[0]: line.split('->')[1] for line in EN_cmw } ---------- components: Interpreter Core messages: 339293 nosy: Benjamin Krala priority: normal severity: normal status: open title: combining dict comprehensing and lists lead to IndexError type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 10:26:56 2019 From: report at bugs.python.org (Benjamin Krala) Date: Mon, 01 Apr 2019 14:26:56 +0000 Subject: [issue36498] combining dict comprehensing and lists lead to IndexError In-Reply-To: <1554128739.17.0.108677031645.issue36498@roundup.psfhosted.org> Message-ID: <1554128816.46.0.312550154565.issue36498@roundup.psfhosted.org> Benjamin Krala added the comment: Correction of typo in the last sentence: To avoid the bug you can change the 1 into -1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 10:30:11 2019 From: report at bugs.python.org (SilentGhost) Date: Mon, 01 Apr 2019 14:30:11 +0000 Subject: [issue36498] combining dict comprehensing and lists lead to IndexError In-Reply-To: <1554128739.17.0.108677031645.issue36498@roundup.psfhosted.org> Message-ID: <1554129011.18.0.397222733186.issue36498@roundup.psfhosted.org> SilentGhost added the comment: IndexError is caused by the fact that split results in an empty list. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 10:36:27 2019 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 01 Apr 2019 14:36:27 +0000 Subject: [issue36495] Out-of-bounds array reads in Python/ast.c In-Reply-To: <1554043972.42.0.422033771745.issue36495@roundup.psfhosted.org> Message-ID: <1554129387.79.0.384908625051.issue36495@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset a4d78362397fc3bced6ea80fbc7b5f4827aec55e by Guido van Rossum (Brad Larsen) in branch 'master': bpo-36495: Fix two out-of-bounds array reads (GH-12641) https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 11:07:56 2019 From: report at bugs.python.org (Eric Snow) Date: Mon, 01 Apr 2019 15:07:56 +0000 Subject: [issue36487] Make C-API docs clear about what the "main" interpreter is In-Reply-To: <1553961350.55.0.679076430542.issue36487@roundup.psfhosted.org> Message-ID: <1554131276.49.0.846124560607.issue36487@roundup.psfhosted.org> Change by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 11:08:59 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 01 Apr 2019 15:08:59 +0000 Subject: [issue36157] Document PyInterpreterState_Main(). In-Reply-To: <1551458200.72.0.727788487318.issue36157@roundup.psfhosted.org> Message-ID: <1554131339.9.0.188170393069.issue36157@roundup.psfhosted.org> miss-islington added the comment: New changeset 8c61739defd88c7f79e86537886c33745843ce01 by Miss Islington (bot) (Joannah Nanjekye) in branch 'master': bpo-36157:Document PyInterpreterState_Main() (GH-12238) https://github.com/python/cpython/commit/8c61739defd88c7f79e86537886c33745843ce01 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 11:09:34 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 01 Apr 2019 15:09:34 +0000 Subject: [issue36157] Document PyInterpreterState_Main(). In-Reply-To: <1551458200.72.0.727788487318.issue36157@roundup.psfhosted.org> Message-ID: <1554131374.26.0.479750311439.issue36157@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch pull_requests: +12581 stage: commit review -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 11:15:16 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 01 Apr 2019 15:15:16 +0000 Subject: [issue36157] Document PyInterpreterState_Main(). In-Reply-To: <1551458200.72.0.727788487318.issue36157@roundup.psfhosted.org> Message-ID: <1554131716.43.0.966264859307.issue36157@roundup.psfhosted.org> miss-islington added the comment: New changeset 35fc38e5e82d18ceec95af9af2103319497e2eaf by Miss Islington (bot) in branch '3.7': bpo-36157:Document PyInterpreterState_Main() (GH-12238) https://github.com/python/cpython/commit/35fc38e5e82d18ceec95af9af2103319497e2eaf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 11:22:42 2019 From: report at bugs.python.org (Eric Snow) Date: Mon, 01 Apr 2019 15:22:42 +0000 Subject: [issue36157] Document PyInterpreterState_Main(). In-Reply-To: <1551458200.72.0.727788487318.issue36157@roundup.psfhosted.org> Message-ID: <1554132162.16.0.574392597077.issue36157@roundup.psfhosted.org> Eric Snow added the comment: Thanks for working on this, Joannah! :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 12:45:51 2019 From: report at bugs.python.org (=?utf-8?q?Lars_Gust=C3=A4bel?=) Date: Mon, 01 Apr 2019 16:45:51 +0000 Subject: [issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive In-Reply-To: <1497403539.2.0.760105950979.issue30661@psf.upfronthosting.co.za> Message-ID: <1554137151.49.0.17274807453.issue30661@roundup.psfhosted.org> Lars Gust?bel added the comment: tarfile does not use the `format` argument for reading, it will be detected. You can even mix different formats in one archive and tarfile will be fine with it. ---------- nosy: +lars.gustaebel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 14:17:56 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 01 Apr 2019 18:17:56 +0000 Subject: [issue36485] Add a way to clear all caches In-Reply-To: <1553947019.94.0.789476600198.issue36485@roundup.psfhosted.org> Message-ID: <1554142676.14.0.228834744555.issue36485@roundup.psfhosted.org> Brett Cannon added the comment: RE: "And do you think polling for a new magic attribute is the right approach?": my thinking behind that idea is that by standardizing the function name it's easy to tell if there's a cache, but you can also do away with the registration with a 3 lines of code. To me, the priority is clearing caches on a per-module basici and having a clear-all mechanism can be beneficial, not the other way around. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 14:18:30 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 01 Apr 2019 18:18:30 +0000 Subject: [issue36085] Enable better DLL resolution In-Reply-To: <1550881737.58.0.129017089721.issue36085@roundup.psfhosted.org> Message-ID: <1554142710.12.0.572313839942.issue36085@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 15:08:39 2019 From: report at bugs.python.org (Robert Marshall) Date: Mon, 01 Apr 2019 19:08:39 +0000 Subject: [issue13501] Make libedit support more generic; port readline / libedit to FreeBSD In-Reply-To: <1322579942.3.0.601983912656.issue13501@psf.upfronthosting.co.za> Message-ID: <1554145719.07.0.601497728177.issue13501@roundup.psfhosted.org> Robert Marshall added the comment: The pull request is now ready for a review. Apologies for the delay - took me a bit longer to circle back on this than I would have liked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 15:18:51 2019 From: report at bugs.python.org (Michael Felt) Date: Mon, 01 Apr 2019 19:18:51 +0000 Subject: [issue36210] correct AIX logic in setup.py for non-existant optional extensions In-Reply-To: <1551877478.38.0.771456862754.issue36210@roundup.psfhosted.org> Message-ID: <1554146331.9.0.5350199744.issue36210@roundup.psfhosted.org> Michael Felt added the comment: Updating this to not only correct the failure of 3rd-party library ncurses (while IBM curses builds with no issue) to also stop announcing that the optional modules osaudiodev and spwd have not been built. Neither are supported on AIX - so they will never be there. ---------- title: ncurses versus cursus integration - platform differences and defaults -> correct AIX logic in setup.py for non-existant optional extensions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 15:19:06 2019 From: report at bugs.python.org (Michael Felt) Date: Mon, 01 Apr 2019 19:19:06 +0000 Subject: [issue36210] correct AIX logic in setup.py for non-existant optional extensions In-Reply-To: <1551877478.38.0.771456862754.issue36210@roundup.psfhosted.org> Message-ID: <1554146346.77.0.418345334675.issue36210@roundup.psfhosted.org> Change by Michael Felt : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 15:41:14 2019 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 01 Apr 2019 19:41:14 +0000 Subject: [issue36493] Add math.midpoint(a,b) function In-Reply-To: <1554037806.92.0.427188886689.issue36493@roundup.psfhosted.org> Message-ID: <1554147674.68.0.537533634315.issue36493@roundup.psfhosted.org> Stefan Behnel added the comment: I buy the YAGNI argument and won't fight for this. Thanks for your input. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 16:23:38 2019 From: report at bugs.python.org (C.A.M. Gerlach) Date: Mon, 01 Apr 2019 20:23:38 +0000 Subject: [issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive In-Reply-To: <1497403539.2.0.760105950979.issue30661@psf.upfronthosting.co.za> Message-ID: <1554150218.59.0.367868758984.issue30661@roundup.psfhosted.org> C.A.M. Gerlach added the comment: Thanks for the confirmation! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 17:54:37 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 01 Apr 2019 21:54:37 +0000 Subject: [issue32413] Document that locals() may return globals() In-Reply-To: <1514008362.41.0.213398074469.issue32413@psf.upfronthosting.co.za> Message-ID: <1554155677.68.0.367311763853.issue32413@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 17:59:52 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 01 Apr 2019 21:59:52 +0000 Subject: [issue13120] Default nosigint option to pdb.Pdb() prevents use in non-main thread In-Reply-To: <1317935848.16.0.589862913408.issue13120@psf.upfronthosting.co.za> Message-ID: <1554155992.52.0.425219584176.issue13120@roundup.psfhosted.org> miss-islington added the comment: New changeset 9139f926a8d8e5b71830cb7e10b0807836b5e9a4 by Miss Islington (bot) (Daniel Hahler) in branch 'master': bpo-13120: fix typo with test_issue13120() method name (GH-12250) https://github.com/python/cpython/commit/9139f926a8d8e5b71830cb7e10b0807836b5e9a4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 18:00:17 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 01 Apr 2019 22:00:17 +0000 Subject: [issue13120] Default nosigint option to pdb.Pdb() prevents use in non-main thread In-Reply-To: <1317935848.16.0.589862913408.issue13120@psf.upfronthosting.co.za> Message-ID: <1554156017.99.0.200774898608.issue13120@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12582 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 18:23:36 2019 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 01 Apr 2019 22:23:36 +0000 Subject: [issue36432] Running python test suite fails on macOS 10.14.4 with resource.RLIMIT_STACK error In-Reply-To: <1553584151.61.0.380593331105.issue36432@roundup.psfhosted.org> Message-ID: <1554157416.92.0.347225902913.issue36432@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 18:58:40 2019 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Mon, 01 Apr 2019 22:58:40 +0000 Subject: [issue36432] Running python test suite fails on macOS 10.14.4 with resource.RLIMIT_STACK error In-Reply-To: <1553584151.61.0.380593331105.issue36432@roundup.psfhosted.org> Message-ID: <1554159520.8.0.179513108841.issue36432@roundup.psfhosted.org> R?mi Lapeyre added the comment: I confirm that reverting 335ab5b66f432ae3713840ed2403a11c368f5406 work as a workaround, and does not seem to create regressions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 19:02:43 2019 From: report at bugs.python.org (Vadim) Date: Mon, 01 Apr 2019 23:02:43 +0000 Subject: [issue36499] unpickling of a datetime object in 3.5 fails when pickled with 2.7 Message-ID: <1554159763.02.0.091153973207.issue36499@roundup.psfhosted.org> New submission from Vadim : Unpickling fails when pickling is performed with 2.7 (pickledatetime.py) and unpickling is done with 3.5 (Tested on Ubuntu 16.04) Please see detailed error description and workaround in the comments to the attached files. ---------- components: Library (Lib) files: pickle_unpickle.tar.gz messages: 339308 nosy: vadimf priority: normal severity: normal status: open title: unpickling of a datetime object in 3.5 fails when pickled with 2.7 type: crash versions: Python 2.7, Python 3.5 Added file: https://bugs.python.org/file48240/pickle_unpickle.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 19:14:00 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 01 Apr 2019 23:14:00 +0000 Subject: [issue36499] unpickling of a datetime object in 3.5 fails when pickled with 2.7 In-Reply-To: <1554159763.02.0.091153973207.issue36499@roundup.psfhosted.org> Message-ID: <1554160440.58.0.566263711452.issue36499@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 19:55:23 2019 From: report at bugs.python.org (=?utf-8?b?2LnYtNmC2Ykg2Ygg2K3Zhtin2YbZig==?=) Date: Mon, 01 Apr 2019 23:55:23 +0000 Subject: [issue36210] correct AIX logic in setup.py for non-existant optional extensions In-Reply-To: <1551877478.38.0.771456862754.issue36210@roundup.psfhosted.org> Message-ID: <1554162923.48.0.0243431537336.issue36210@roundup.psfhosted.org> Change by ???? ? ????? : Added file: https://bugs.python.org/file48241/name of the past _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 20:13:34 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 02 Apr 2019 00:13:34 +0000 Subject: [issue36500] Add "regen-*" equivalent projects for Windows builds Message-ID: <1554164014.38.0.603917502843.issue36500@roundup.psfhosted.org> New submission from anthony shaw : Now that pgen is written in Python, it'd be useful for Windows users to be able to rebuild grammar and tokens into the parser table. The current hook (make regen-grammar) is built into the Makefile. Add support for VS2017+ vcxproj files to call the script directly ---------- components: Build messages: 339309 nosy: anthony shaw priority: normal severity: normal status: open title: Add "regen-*" equivalent projects for Windows builds versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 20:17:07 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 02 Apr 2019 00:17:07 +0000 Subject: [issue36500] Add "regen-*" equivalent projects for Windows builds In-Reply-To: <1554164014.38.0.603917502843.issue36500@roundup.psfhosted.org> Message-ID: <1554164227.22.0.870189098702.issue36500@roundup.psfhosted.org> Change by anthony shaw : ---------- keywords: +patch pull_requests: +12583 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 20:23:49 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 02 Apr 2019 00:23:49 +0000 Subject: [issue36500] Add "regen-*" equivalent projects for Windows builds In-Reply-To: <1554164014.38.0.603917502843.issue36500@roundup.psfhosted.org> Message-ID: <1554164629.56.0.0852364929577.issue36500@roundup.psfhosted.org> Change by anthony shaw : ---------- nosy: +brett.cannon, steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 20:44:51 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 02 Apr 2019 00:44:51 +0000 Subject: [issue36500] Add "regen-*" equivalent projects for Windows builds In-Reply-To: <1554164014.38.0.603917502843.issue36500@roundup.psfhosted.org> Message-ID: <1554165891.36.0.197644009464.issue36500@roundup.psfhosted.org> anthony shaw added the comment: Project now also does: regen-symbol (regenerate Lib/symbol.py) and regen-keyword (regenerate Lib/keyword.py) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 21:01:04 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 01:01:04 +0000 Subject: [issue36485] Establish a uniform way to clear all caches in a given module In-Reply-To: <1553947019.94.0.789476600198.issue36485@roundup.psfhosted.org> Message-ID: <1554166864.62.0.0272282243913.issue36485@roundup.psfhosted.org> Raymond Hettinger added the comment: [Brett] > To me, the priority is clearing caches on a per-module basici > and having a clear-all mechanism can be beneficial, not the > other way around. That makes more sense. I'm changing the title to match the actual feature request and intent: "Add a way to clear all caches" -> "Establish a uniform way to clear all caches in a given module" ---------- title: Add a way to clear all caches -> Establish a uniform way to clear all caches in a given module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 21:05:33 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 01:05:33 +0000 Subject: [issue36485] Establish a uniform way to clear all caches in a given module In-Reply-To: <1553947019.94.0.789476600198.issue36485@roundup.psfhosted.org> Message-ID: <1554167133.7.0.44356978194.issue36485@roundup.psfhosted.org> Raymond Hettinger added the comment: Quick question, would the existing sys.reload() logic suffice? -- mymodule.py -- cache = {} # On reload, this would clear the cache def f(x): if x in cache: return cache[x] y = x**2 cache[x] = y return y ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 22:09:33 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 02 Apr 2019 02:09:33 +0000 Subject: [issue36500] Add "regen-*" equivalent projects for Windows builds In-Reply-To: <1554164014.38.0.603917502843.issue36500@roundup.psfhosted.org> Message-ID: <1554170973.74.0.267651349192.issue36500@roundup.psfhosted.org> Change by anthony shaw : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 22:54:06 2019 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 02 Apr 2019 02:54:06 +0000 Subject: [issue36501] Remove POSIX.1e ACLs in tests that rely on default permissions behavior Message-ID: <1554173646.74.0.526062009257.issue36501@roundup.psfhosted.org> New submission from Ivan Pozdeev : In Linuxes with ACLs enabled, the following tests fail, as Steve Dower discovered in https://mail.python.org/pipermail/python-dev/2019-March/156929.html: ====================================================================== FAIL: test_mode (test.test_os.MakedirTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/osboxes/Documents/cpython/Lib/test/test_os.py", line 1157, in test_mode self.assertEqual(os.stat(parent).st_mode & 0o777, 0o775) AssertionError: 493 != 509 ====================================================================== FAIL: test_open_mode (test.test_pathlib.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/osboxes/Documents/cpython/Lib/test/test_pathlib.py", line 2104, in test_open_mode self.assertEqual(stat.S_IMODE(st.st_mode), 0o666) AssertionError: 420 != 438 ====================================================================== FAIL: test_touch_mode (test.test_pathlib.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/osboxes/Documents/cpython/Lib/test/test_pathlib.py", line 2117, in test_touch_mode self.assertEqual(stat.S_IMODE(st.st_mode), 0o666) AssertionError: 420 != 438 POSIX.1e is supported by major distros even though it's officially withdrawn; see https://en.wikipedia.org/wiki/Access_control_list#Filesystem_ACLs . ---------- components: Tests messages: 339313 nosy: Ivan.Pozdeev priority: normal severity: normal status: open title: Remove POSIX.1e ACLs in tests that rely on default permissions behavior type: behavior versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 22:54:38 2019 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 02 Apr 2019 02:54:38 +0000 Subject: [issue36501] Remove POSIX.1e ACLs in tests that rely on default permissions behavior In-Reply-To: <1554173646.74.0.526062009257.issue36501@roundup.psfhosted.org> Message-ID: <1554173678.2.0.319150653296.issue36501@roundup.psfhosted.org> Change by Ivan Pozdeev : ---------- keywords: +patch pull_requests: +12584 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 1 23:37:38 2019 From: report at bugs.python.org (Davin Potts) Date: Tue, 02 Apr 2019 03:37:38 +0000 Subject: [issue36364] errors in multiprocessing.shared_memory examples In-Reply-To: <1553006397.24.0.439789667635.issue36364@roundup.psfhosted.org> Message-ID: <1554176258.42.0.99674086481.issue36364@roundup.psfhosted.org> Davin Potts added the comment: Very much agreed, they're moving over to the main docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 00:52:44 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 04:52:44 +0000 Subject: [issue36377] Python 'datastructures.html' docs page needs improvement because of ambiguity In-Reply-To: <1553049009.71.0.761140685062.issue36377@roundup.psfhosted.org> Message-ID: <1554180764.92.0.988743614473.issue36377@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset b00479d42aaaed589d8b374bf5e5c6f443b0b499 by Raymond Hettinger (Emmanuel Arias) in branch 'master': bpo-36377: Specify that range() can not be compared (GH-12468) https://github.com/python/cpython/commit/b00479d42aaaed589d8b374bf5e5c6f443b0b499 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 00:53:09 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 04:53:09 +0000 Subject: [issue36377] Python 'datastructures.html' docs page needs improvement because of ambiguity In-Reply-To: <1553049009.71.0.761140685062.issue36377@roundup.psfhosted.org> Message-ID: <1554180789.98.0.00533438751983.issue36377@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 02:14:37 2019 From: report at bugs.python.org (JUN-WEI SONG) Date: Tue, 02 Apr 2019 06:14:37 +0000 Subject: [issue36260] Cpython/Lib vulnerability found and request a patch submission In-Reply-To: <1552288618.75.0.236192047967.issue36260@roundup.psfhosted.org> Message-ID: <1554185677.48.0.524260201568.issue36260@roundup.psfhosted.org> JUN-WEI SONG added the comment: Hello Python community, With Christian Heimes? suggestion, we manipulate appropriate warning to inform users that they may encounter zip bomb issues when using the zipfile module. The warning we would like to add in the zipfile documentation is shown below : https://github.com/python/cpython/blob/3.7/Doc/library/zipfile.rst .. warning:: Never extract files from untrusted sources without prior inspection. It is possible that the file may contain zip bomb issues such as 42.zip. The zip bomb will usually be a small file before decompression, but once it is decompressed, it will exhaust system resources. You can protect your system by limiting system resources, limiting compression ratio (zip bombs are usually quite high), and checking for nested zip files. We are also pleasure to provide a patch to enhance the zipfile module to provide basic information. In zipfile.py https://github.com/python/cpython/blob/master/Lib/zipfile.py Inside the ZipFile class : def filecount(self): """Return total count of files in the archive.""" return len(self.filelist) def total_compressed_size(self): """Return total compressed size in the archive.""" return sum([data.compress_size for data in self.filelist]) def total_uncompressed_size(self): """Return total uncompressed size in the archive.""" return sum([data.file_size for data in self.filelist]) ---------- resolution: -> remind status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 02:25:36 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 02 Apr 2019 06:25:36 +0000 Subject: [issue36210] correct AIX logic in setup.py for (non-existant) optional extensions In-Reply-To: <1551877478.38.0.771456862754.issue36210@roundup.psfhosted.org> Message-ID: <1554186336.4.0.134387218253.issue36210@roundup.psfhosted.org> Change by Michael Felt : ---------- title: correct AIX logic in setup.py for non-existant optional extensions -> correct AIX logic in setup.py for (non-existant) optional extensions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 02:36:07 2019 From: report at bugs.python.org (Jun) Date: Tue, 02 Apr 2019 06:36:07 +0000 Subject: [issue36502] The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented Message-ID: <1554186967.56.0.21483381742.issue36502@roundup.psfhosted.org> New submission from Jun : I was looking for a list of Unicode codepoints that str.isspace() returns true. According to https://docs.python.org/3/library/stdtypes.html#str.isspace, it's "Whitespace characters are those characters defined in the Unicode character database as ?Other? or ?Separator? and those with bidirectional property being one of ?WS?, ?B?, or ?S?." However, for U+202F(https://www.fileformat.info/info/unicode/char/202f/index.htm) which is a "Separator" and its bidirectional property is "CS", str.isspace() returns True while it shouldn't if we follow the definition above. >>> "\u202f".isspace() True I'm not sure either the documentation should be updated or behavior should be updated, but at least those should be consistent. ---------- assignee: docs at python components: Documentation, Unicode messages: 339317 nosy: Jun, docs at python, ezio.melotti, vstinner priority: normal severity: normal status: open title: The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 02:45:21 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 02 Apr 2019 06:45:21 +0000 Subject: [issue36502] The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented In-Reply-To: <1554186967.56.0.21483381742.issue36502@roundup.psfhosted.org> Message-ID: <1554187521.01.0.813415230342.issue36502@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 02:59:53 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 02 Apr 2019 06:59:53 +0000 Subject: [issue36502] The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented In-Reply-To: <1554186967.56.0.21483381742.issue36502@roundup.psfhosted.org> Message-ID: <1554188393.77.0.52880789212.issue36502@roundup.psfhosted.org> SilentGhost added the comment: I think you have to read that "and" as "or". It's sufficient that '\u202f' is a separator for it to be considered a whitespace character. ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 03:13:37 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 07:13:37 +0000 Subject: [issue27181] Add geometric mean to `statistics` module In-Reply-To: <1464901494.08.0.0111988914026.issue27181@psf.upfronthosting.co.za> Message-ID: <1554189217.76.0.202576187543.issue27181@roundup.psfhosted.org> Raymond Hettinger added the comment: Steven, how does this look? https://patch-diff.githubusercontent.com/raw/python/cpython/pull/12638.diff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 03:57:58 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 02 Apr 2019 07:57:58 +0000 Subject: [issue35838] ConfigParser calls optionxform twice when assigning dict In-Reply-To: <1548628021.95.0.834258344082.issue35838@roundup.psfhosted.org> Message-ID: <1554191878.87.0.4629539977.issue35838@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12585 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 04:17:29 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 02 Apr 2019 08:17:29 +0000 Subject: [issue13120] Default nosigint option to pdb.Pdb() prevents use in non-main thread In-Reply-To: <1317935848.16.0.589862913408.issue13120@psf.upfronthosting.co.za> Message-ID: <1554193049.65.0.965549762732.issue13120@roundup.psfhosted.org> miss-islington added the comment: New changeset 5ca4fe04784fa278c319a3764c9a755f49cc0944 by Miss Islington (bot) in branch '3.7': bpo-13120: fix typo with test_issue13120() method name (GH-12250) https://github.com/python/cpython/commit/5ca4fe04784fa278c319a3764c9a755f49cc0944 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:08:51 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 02 Apr 2019 09:08:51 +0000 Subject: [issue35838] ConfigParser calls optionxform twice when assigning dict In-Reply-To: <1548628021.95.0.834258344082.issue35838@roundup.psfhosted.org> Message-ID: <1554196131.08.0.32838132693.issue35838@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 04694a306b8f4ab54ef5fc4ba673c26fa53b0ac1 by Inada Naoki in branch 'master': bpo-35838: document optionxform must be idempotent (GH-12656) https://github.com/python/cpython/commit/04694a306b8f4ab54ef5fc4ba673c26fa53b0ac1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:09:03 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 02 Apr 2019 09:09:03 +0000 Subject: [issue35838] ConfigParser calls optionxform twice when assigning dict In-Reply-To: <1548628021.95.0.834258344082.issue35838@roundup.psfhosted.org> Message-ID: <1554196143.58.0.634711454441.issue35838@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12586 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:21:16 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 02 Apr 2019 09:21:16 +0000 Subject: [issue36503] remove references to aix3 and aix4 in \*.py Message-ID: <1554196876.37.0.11821989431.issue36503@roundup.psfhosted.org> New submission from Michael Felt : sys.platform returns "aix[3|4|4|5|6|7" AIX 3 and AIX 4 are no longer around, in any supported form, so references to these specific releases is pointless. This will remove the (two) places where they are still referenced. ---------- components: Build, Tests messages: 339322 nosy: Michael.Felt priority: normal severity: normal status: open title: remove references to aix3 and aix4 in \*.py versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:29:19 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 02 Apr 2019 09:29:19 +0000 Subject: [issue35838] ConfigParser calls optionxform twice when assigning dict In-Reply-To: <1548628021.95.0.834258344082.issue35838@roundup.psfhosted.org> Message-ID: <1554197359.61.0.704957297216.issue35838@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a838c593f6ada69a37025d7ded8ac822816a74c by Miss Islington (bot) in branch '3.7': bpo-35838: document optionxform must be idempotent (GH-12656) https://github.com/python/cpython/commit/9a838c593f6ada69a37025d7ded8ac822816a74c ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:30:12 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 02 Apr 2019 09:30:12 +0000 Subject: [issue36473] dictkeysobject: Add maximum iteration check for .values() and .items() In-Reply-To: <1553868978.85.0.786754565606.issue36473@roundup.psfhosted.org> Message-ID: <1554197412.64.0.5161249752.issue36473@roundup.psfhosted.org> Inada Naoki added the comment: New changeset b8311cf5e5d72f8a8aa688b7da1760d6a74a4d72 by Inada Naoki (Thomas Perl) in branch 'master': bpo-36473: add maximum iteration check for dict .values() and .items() (GH-12619) https://github.com/python/cpython/commit/b8311cf5e5d72f8a8aa688b7da1760d6a74a4d72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:30:30 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 02 Apr 2019 09:30:30 +0000 Subject: [issue36473] dictkeysobject: Add maximum iteration check for .values() and .items() In-Reply-To: <1553868978.85.0.786754565606.issue36473@roundup.psfhosted.org> Message-ID: <1554197430.33.0.215970385355.issue36473@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:31:39 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 02 Apr 2019 09:31:39 +0000 Subject: [issue36503] remove references to aix3 and aix4 in \*.py In-Reply-To: <1554196876.37.0.11821989431.issue36503@roundup.psfhosted.org> Message-ID: <1554197499.08.0.0298546087991.issue36503@roundup.psfhosted.org> Change by Michael Felt : ---------- keywords: +patch pull_requests: +12587 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:31:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 02 Apr 2019 09:31:52 +0000 Subject: [issue35838] ConfigParser: document optionxform must be idempotent In-Reply-To: <1548628021.95.0.834258344082.issue35838@roundup.psfhosted.org> Message-ID: <1554197512.59.0.832698847303.issue35838@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: ConfigParser calls optionxform twice when assigning dict -> ConfigParser: document optionxform must be idempotent _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:39:08 2019 From: report at bugs.python.org (Roundup Robot) Date: Tue, 02 Apr 2019 09:39:08 +0000 Subject: [issue34677] Event scheduler page example In-Reply-To: <1536927469.93.0.956365154283.issue34677@psf.upfronthosting.co.za> Message-ID: <1554197948.4.0.994226487279.issue34677@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12588 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 05:46:38 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 02 Apr 2019 09:46:38 +0000 Subject: [issue36499] unpickling of a datetime object in 3.5 fails when pickled with 2.7 In-Reply-To: <1554159763.02.0.091153973207.issue36499@roundup.psfhosted.org> Message-ID: <1554198398.42.0.408160979637.issue36499@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to have been fixed with 8452ca15f41061c8a6297d7956df22ab476d4df4. I checked out your example locally and renamed pickle.py to another name to avoid module collision. Ran the below commands to pickle using Python 2 and to unpickle from master before and after the relevant commit. The fix is present in 3.7 and 3.6. ? bpo36499 python2 pickledatetime.py # with 8452ca15f41061c8a6297d7956df22ab476d4df4 ? bpo36499 ../cpython/python.exe unpickledatetime.py Pickle: {'timenode': datetime.datetime(2019, 4, 2, 15, 13, 2, 675110)} # with 8452ca15f41061c8a6297d7956df22ab476d4df4~1 ? bpo36499 ../cpython/python.exe unpickledatetime.py Traceback (most recent call last): File "unpickledatetime.py", line 22, in main() File "unpickledatetime.py", line 18, in main pkl = unpickler.load() File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/pickle.py", line 1081, in load dispatch[key[0]](self) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/pickle.py", line 1429, in load_reduce stack[-1] = func(*args) TypeError: an integer is required (got type str) # pickledatetime.py import io import pickle from datetime import datetime def main(): """ Uses python 2.7 to create a pickle file with a datetime object inside a dictionary. """ data = {} data['timenode'] = datetime.now() with io.open('written_by_py27.pickle', 'wb') as handle: pickle.dump(data, handle, protocol=pickle.HIGHEST_PROTOCOL) if __name__ == "__main__": main() # unpickledatetime.py import io import pickle def main(): """ Attempts to unpickle a dictionary with a datatype object inside """ with io.open('written_by_py27.pickle', 'rb') as handle: unpickler = pickle._Unpickler(handle) unpickler.encoding = 'latin1' pkl = unpickler.load() print("Pickle: ", pkl) if __name__ == "__main__": main() ---------- nosy: +serhiy.storchaka, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 06:09:01 2019 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 02 Apr 2019 10:09:01 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() Message-ID: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> New submission from Zackery Spytz : Signed integer overflow can occur in the overflow check in PyCArrayType_new() if "itemsize" is large enough. ---------- components: Extension Modules, ctypes messages: 339326 nosy: ZackerySpytz priority: normal severity: normal status: open title: Signed integer overflow in _ctypes.c's PyCArrayType_new() type: behavior versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 06:11:56 2019 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 02 Apr 2019 10:11:56 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554199916.36.0.451706744473.issue36504@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12589 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 06:20:41 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 02 Apr 2019 10:20:41 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554200441.24.0.34377520412.issue36504@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 06:48:00 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 02 Apr 2019 10:48:00 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554202080.43.0.574922632439.issue36504@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 487b73ab39c80157474821ef9083f51e0846bd62 by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). (GH-12660) https://github.com/python/cpython/commit/487b73ab39c80157474821ef9083f51e0846bd62 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 06:48:52 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 02 Apr 2019 10:48:52 +0000 Subject: [issue36499] unpickling of a datetime object in 3.5 fails when pickled with 2.7 In-Reply-To: <1554159763.02.0.091153973207.issue36499@roundup.psfhosted.org> Message-ID: <1554202132.43.0.361545762289.issue36499@roundup.psfhosted.org> Josh Rosenberg added the comment: As noted, this is fixed in 3.6+. 3.5 is in security fix only mode ( https://devguide.python.org/#status-of-python-branches ), which is why the fix for #22005 wasn't backported. ---------- nosy: +josh.r resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> datetime.__setstate__ fails decoding python2 pickle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 07:09:02 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 02 Apr 2019 11:09:02 +0000 Subject: [issue36260] Cpython/Lib vulnerability found and request a patch submission In-Reply-To: <1552288618.75.0.236192047967.issue36260@roundup.psfhosted.org> Message-ID: <1554203342.54.0.160280980509.issue36260@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am against such trivial methods in ZipFile. Its interface is already complicate. The advantage of Python is that you do not need tons of methods for every possible query -- you can just combine few Python features into a one-line expression. As for the documentation change, it could be useful to add more general note about possible pitfalls. What happen when interrupt extracting or adding to the archive, what happen when extract into existing tree or overwrite an existing file, what happen when the file system does not support some file names, what happen when extract to case-insensitive file system, what happen when extract encrypted file with wrong password, etc. We do not have to tell the user what he should not do, just to warn about the possible consequences. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 07:33:30 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 02 Apr 2019 11:33:30 +0000 Subject: [issue34677] Event scheduler page example In-Reply-To: <1536927469.93.0.956365154283.issue34677@psf.upfronthosting.co.za> Message-ID: <1554204810.63.0.939283845388.issue34677@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: enter takes a relative time and priority is taken into consideration only when time is equal. So in the example enter(0.001, 2) is executed first and there is some delay in executing enter(0.001, 2). You can also view the queue with s.queue which is a heap. So even though they look similar the first call is scheduled earlier than the second one even with lower priority. Your report is correct if the example used enterabs where the time is absolute and then the two events are ordered based on priority with keyword executed first in the heapq used . In your script you can print s.sched and maybe add the same to the report? # enter and s.sched prints different time with positional scheduled to be executed first in time. ? cpython git:(master) cat /tmp/bar.py import sched, time s = sched.scheduler(time.time, time.sleep) def print_time(a='default'): print("From print_time", time.time(), a) def print_some_times(): print(time.time()) s.enter(0.001, 2, print_time, argument=('positional',)) s.enter(0.001, 1, print_time, kwargs={'a': 'keyword'}) print(s.queue) s.run() print(time.time()) print_some_times() ? cpython git:(master) ./python.exe /tmp/bar.py 1554204002.401897 [Event(time=1554204002.40309, priority=2, action=, argument=('positional',), kwargs={}), Event(time=1554204002.403158, priority=1, action=, argument=(), kwargs={'a': 'keyword'})] >From print_time 1554204002.40331 positional >From print_time 1554204002.403441 keyword 1554204002.403517 # enterabs and s.sched prints same time with keyword ordered first based on priority with time being equal. ? cpython git:(master) cat /tmp/baz.py import sched, time s = sched.scheduler(time.time, time.sleep) def print_time(a='default'): print("From print_time", time.time(), a) def print_some_times(): print(time.time()) s.enterabs(0.001, 2, print_time, argument=('positional',)) s.enterabs(0.001, 1, print_time, kwargs={'a': 'keyword'}) print(s.queue) s.run() print(time.time()) print_some_times() ? cpython git:(master) ./python.exe /tmp/baz.py 1554204136.854676 [Event(time=0.001, priority=1, action=, argument=(), kwargs={'a': 'keyword'}), Event(time=0.001, priority=2, action=, argument=('positional',), kwargs={})] >From print_time 1554204136.855422 keyword >From print_time 1554204136.855669 positional 1554204136.855788 ---------- nosy: +giampaolo.rodola, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 08:47:12 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 02 Apr 2019 12:47:12 +0000 Subject: [issue21269] Provide args and kwargs attributes on mock call objects In-Reply-To: <1397681262.54.0.610859323151.issue21269@psf.upfronthosting.co.za> Message-ID: <1554209232.59.0.0946850432729.issue21269@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks @kakshay for the patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 09:43:45 2019 From: report at bugs.python.org (tejesh) Date: Tue, 02 Apr 2019 13:43:45 +0000 Subject: [issue36505] PYTHON-CAN with vector Message-ID: <1554212625.82.0.669161451897.issue36505@roundup.psfhosted.org> New submission from tejesh : Hi team, I am trying to send CAN message from python I can able to send CAN message with the time period(Limited duration). But, I want to send particular number of times(example: I want to send only 2 CAN Messages). How can I send?? Can please help me to resolve this issue ASAP.. ---------- components: Build messages: 339332 nosy: tejesh priority: normal severity: normal status: open title: PYTHON-CAN with vector type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 09:47:13 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 02 Apr 2019 13:47:13 +0000 Subject: [issue36505] PYTHON-CAN with vector In-Reply-To: <1554212625.82.0.669161451897.issue36505@roundup.psfhosted.org> Message-ID: <1554212833.86.0.203120166628.issue36505@roundup.psfhosted.org> SilentGhost added the comment: Hi tejesh, this is a bug tracker for development of CPython. If you have a problem with your code I'd suggest trying StackOverflow or python-help mailing list. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 09:52:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 13:52:34 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1554213154.35.0.670345064364.issue35866@roundup.psfhosted.org> STINNER Victor added the comment: Any update on this issue? I don't understand why the example hangs. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:03:55 2019 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 02 Apr 2019 14:03:55 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1554213835.0.0.280110997161.issue33261@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset fcef60f59d04c63b3540b4c4886226098c1bacd1 by Petr Viktorin (Jeroen Demeyer) in branch 'master': bpo-33261: guard access to __code__ attribute in inspect (GH-6448) https://github.com/python/cpython/commit/fcef60f59d04c63b3540b4c4886226098c1bacd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:32:57 2019 From: report at bugs.python.org (amazon kurodaju) Date: Tue, 02 Apr 2019 14:32:57 +0000 Subject: [issue36502] The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented In-Reply-To: <1554186967.56.0.21483381742.issue36502@roundup.psfhosted.org> Message-ID: <1554215577.43.0.151239042562.issue36502@roundup.psfhosted.org> amazon kurodaju added the comment: Do you mean read the statement as follows? Whitespace characters are characters that satisfy either one of: 1. Character type is "Other" 2. Character type is "Separator" 3. Characters with "WS", "B", or "S" bidirectional property If that's the case, this is also not reflect the behavior as most of characters in "Other" are not whitespace characters and in fact str.isspace() returns False for those characters. ---------- nosy: +amazon kurodaju _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:48:46 2019 From: report at bugs.python.org (bigbigliang) Date: Tue, 02 Apr 2019 14:48:46 +0000 Subject: [issue36506] An arbitrary execution vulnerability exists in the built-in function getattr Message-ID: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> New submission from bigbigliang : Dear Python Community, We?ve found a bug in cpython Lib and already received a cve number (CVE-2019-10268).But to be honest, I'm not sure if it's a loophole. Please tell me what to do next. bigbigliang ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 339337 nosy: 18z, bigbigliang, christian.heimes, krnick, serhiy.storchaka, vstinner, xtreak priority: normal severity: normal status: open title: An arbitrary execution vulnerability exists in the built-in function getattr type: security versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:48:52 2019 From: report at bugs.python.org (=?utf-8?b?0JLQu9Cw0LTQuNGB0LvQsNCyINCv0YDQvNCw0Lo=?=) Date: Tue, 02 Apr 2019 14:48:52 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1554216532.87.0.196220713629.issue32849@roundup.psfhosted.org> ????????? ????? added the comment: I have similar crash with Python 3.7.2 on Linux. Steps to reproduce: send sigint when Python initializes. I've built debug version of Python 3.7.2 and collected core dump: (gdb) thread apply all bt Thread 1 (Thread 0x7f8f5ee67e80 (LWP 13285)): #0 __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007f8f5dfe742a in __GI_abort () at abort.c:89 #2 0x0000559515870286 in fatal_error (prefix=prefix at entry=0x5595159837f0 <__func__.14264> "init_sys_streams", msg=msg at entry=0x559515983480 "can't initialize sys standard streams", status=-1) at Python/pylifecycle.c:2179 #3 0x0000559515871062 in _Py_FatalInitError (err=...) at Python/pylifecycle.c:2198 #4 0x000055951577d1f5 in pymain_init (pymain=pymain at entry=0x7ffe886aafc0) at Modules/main.c:3019 #5 0x000055951577d215 in pymain_main (pymain=pymain at entry=0x7ffe886aafc0) at Modules/main.c:3032 #6 0x000055951577d29a in _Py_UnixMain (argc=, argv=) at Modules/main.c:3072 #7 0x00005595157763e9 in main (argc=, argv=) at ./Programs/python.c:15 ---------- nosy: +????????? ????? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:56:28 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 02 Apr 2019 14:56:28 +0000 Subject: [issue36502] The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented In-Reply-To: <1554186967.56.0.21483381742.issue36502@roundup.psfhosted.org> Message-ID: <1554216988.65.0.311858813626.issue36502@roundup.psfhosted.org> SilentGhost added the comment: According to comment for _PyUnicode_IsWhitespace it's supposed to include Zs category, plus documented BIDI properties. So, I'm not sure where "Other" came from. ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:57:33 2019 From: report at bugs.python.org (George Shuklin) Date: Tue, 02 Apr 2019 14:57:33 +0000 Subject: [issue36507] frozenset type breaks ZFC Message-ID: <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org> New submission from George Shuklin : ZFC (https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory) defines numbers as nested empty sets. 0 is {} 1 is {{}} 2 is {{{}}} Sets can not be nested in python (as they are mutable), so next best type is frozen set. Unfortunately, nested sets are equal to each other no matter how deep they are nested. This behavior means that 3==2, and it breaks all set operations for ZFC. Minimal example: frozenset({frozenset()}) >>> x=frozenset() >>> y=frozenset(frozenset()) >>> x is y True ---------- components: Interpreter Core messages: 339340 nosy: george-shuklin priority: normal severity: normal status: open title: frozenset type breaks ZFC type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 10:59:32 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 02 Apr 2019 14:59:32 +0000 Subject: [issue36507] frozenset type breaks ZFC In-Reply-To: <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org> Message-ID: <1554217172.67.0.00841646017675.issue36507@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:00:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:00:20 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED Message-ID: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> New submission from STINNER Victor : python-config --ldflags must not contain LINKFORSHARED. Attached PR modifies python-config --ldflags to no longer include LINKFORSHARED. This similar change was already made on macOS: see bpo-14197. -- Python build system uses a LINKFORSHARED variable, extract of configure.ac: # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems This variable is set to "-Xlinker -export-dynamic" on Linux. Extract of ld manual page for --export-dynamic option: --- When creating a dynamically linked executable, using the -E option or the --export-dynamic option causes the linker to add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. If you do not use either of these options (or use the --no-export-dynamic option to restore the default behavior), the dynamic symbol table will normally contain only those symbols which are referenced by some dynamic object mentioned in the link. If you use "dlopen" to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. You can also use the dynamic list to control what symbols should be added to the dynamic symbol table if the output format supports it. See the description of --dynamic-list. Note that this option is specific to ELF targeted ports. PE targets support a similar function to export all symbols from a DLL or EXE; see the description of --export-all-symbols below. --- Both configure.ac and ld manual page mention an "executable", whereas LINKFORSHARED is currently exported in python-config --ldflags. Example on Fedora 29: $ python3-config --ldflags -L/usr/lib64 -lpython3.7m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic The "-export-dynamic" flag causes non-obvious dynamic linking bug like the following bug in Samba which embeds Python: * https://bugzilla.redhat.com/show_bug.cgi?id=1198161 (python bug) * https://bugzilla.redhat.com/show_bug.cgi?id=1198158 (bug reported on samba) * https://bugzilla.redhat.com/show_bug.cgi?id=1197914 (bug originally reported on gdb) -- History of the LINKFORSHARED variable. (*) Python build system uses a LINKFORSHARED variable since this commit: commit 7cc5abd4548629cc41d3951576f41ff2ddd7b5f7 Author: Guido van Rossum Date: Mon Sep 12 10:42:20 1994 +0000 Support shared library creation. The value of the variable changed on Linux with: commit b65a48e2b631f9a171e6eab699974bd2074f40d7 (HEAD) Author: Guido van Rossum Date: Wed Jun 14 18:21:23 1995 +0000 linux elf shlib; sys/wait.h; don't add -posix for NeXT Extract of the configure.in change: if test -z "$LINKFORSHARED" then case $ac_sys_system in hp*|HP*) LINKFORSHARED="-Wl,-E";; + Linux*) LINKFORSHARED="-rdynamic";; esac fi The variable was only used to build the "python" executable. Extract of Modules/Makefile.in (at commit 7cc5abd4548629cc41d3951576f41ff2ddd7b5f7): ../python: config.o $(MYLIBS) Makefile $(CC) $(OPT) config.o $(LINKFORSHARED) \ $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python mv python ../python (*) The python-config script was created as a Python script by: commit c90b17ec8233009e4745dd8f77401f52c5d4a8d5 Author: Martin v. L?wis Date: Sat Apr 15 08:13:05 2006 +0000 Patch #1161914: Add python-config. The following commit modified Misc/python-config.in to add LINKFORSHARED to python-config --ldflags: commit a70f3496203cd68d88208a21d90f0ca3503aa2f6 Author: Collin Winter Date: Fri Mar 19 00:08:44 2010 +0000 Make python-config support multiple option flags on the same command line, rather than requiring one invocation per flag. Extract: + elif opt in ('--libs', '--ldflags'): + libs = getvar('LIBS').split() + getvar('SYSLIBS').split() + libs.append('-lpython'+pyver) + # add the prefix/lib/pythonX.Y/config dir, but only if there is no + # shared library in prefix/lib/. + if opt == '--ldflags': + if not getvar('Py_ENABLE_SHARED'): + libs.insert(0, '-L' + getvar('LIBPL')) + libs.extend(getvar('LINKFORSHARED').split()) + print ' '.join(libs) The following commit modified Misc/python-config.in to not add LINKFORSHARED into "libs" when built on macOS (if PYTHONFRAMEWORK is defined): commit ecd4e9de5afab6a5d75a6fa7ebfb62804ba69264 Author: Ned Deily Date: Tue Jul 24 03:31:48 2012 -0700 Issue #14197: For OS X framework builds, ensure links to the shared library are created with the proper ABI suffix. diff --git a/Misc/python-config.in b/Misc/python-config.in index 1d4a81d850..79f0bb14c1 100644 --- a/Misc/python-config.in +++ b/Misc/python-config.in @@ -52,7 +52,8 @@ for opt in opt_flags: if opt == '--ldflags': if not getvar('Py_ENABLE_SHARED'): libs.insert(0, '-L' + getvar('LIBPL')) - libs.extend(getvar('LINKFORSHARED').split()) + if not getvar('PYTHONFRAMEWORK'): + libs.extend(getvar('LINKFORSHARED').split()) print(' '.join(libs)) (*) A shell version of python-config has been added by: commit 874211978c8097b8e747c90fa3ff41aacabe340f Author: doko at python.org Date: Sat Jan 26 11:39:31 2013 +0100 - Issue #16235: Implement python-config as a shell script. Extract of Misc/python-config.sh.in at this commit: --ldflags) LINKFORSHAREDUSED= if [ -z "$PYTHONFRAMEWORK" ] ; then LINKFORSHAREDUSED=$LINKFORSHARED fi LIBPLUSED= if [ "$PY_ENABLE_SHARED" = "0" ] ; then LIBPLUSED="-L$LIBPL" fi echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED" ;; ---------- components: Build messages: 339341 nosy: vstinner priority: normal severity: normal status: open title: python-config --ldflags must not contain LINKFORSHARED versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:01:56 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 02 Apr 2019 15:01:56 +0000 Subject: [issue36506] An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554217316.78.0.741034675512.issue36506@roundup.psfhosted.org> Christian Heimes added the comment: Hi, this is a public bug tracker. Please don't report new security bugs here but follow the guidelines at https://www.python.org/news/security/. Also please don't acquire CVE numbers for issues yourself. The Python Security Response Team will request CVE numbers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:03:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:03:27 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554217407.39.0.889511925378.issue36508@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12590 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:03:47 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 02 Apr 2019 15:03:47 +0000 Subject: [issue36506] An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554217427.96.0.949426781596.issue36506@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The security vulnerability disclosure process can be found at https://www.python.org/news/security/ . Please contact security at python.org. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:05:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:05:29 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554217529.26.0.628874661486.issue36508@roundup.psfhosted.org> STINNER Victor added the comment: I'm a little bit scared by the idea of backporting such change in Python 2.7 and 3.7 stable branches, even if I think that it's a correct bugfix. I'm scared by the number of platforms, I don't know all these linker flags and I am not able to test all combinations: AC_MSG_RESULT($CCSHARED) # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems AC_MSG_CHECKING(LINKFORSHARED) if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; hp*|HP*) LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";; Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys Darwin/*) LINKFORSHARED="$extra_undefs -framework CoreFoundation" # Issue #18075: the default maximum stack size (8MBytes) is too # small for the default recursion limit. Increase the stack size # to ensure that tests don't crash LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED" if test "$enable_framework" then LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' fi LINKFORSHARED="$LINKFORSHARED";; OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) if [[ "`$CC -dM -E - &1 | grep export-dynamic >/dev/null then LINKFORSHARED="-Xlinker --export-dynamic" fi;; esac;; CYGWIN*) if test $enable_shared = "no" then LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' fi;; QNX*) # -Wl,-E causes the symbols to be added to the dynamic # symbol table so that they can be found when a module # is loaded. -N 2048K causes the stack size to be set # to 2048 kilobytes so that the stack doesn't overflow # when running test_compile.py. LINKFORSHARED='-Wl,-E -N 2048K';; VxWorks*) LINKFORSHARED='--export-dynamic';; esac fi AC_MSG_RESULT($LINKFORSHARED) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:05:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:05:38 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554217538.82.0.181808607999.issue36508@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +doko, ned.deily, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:08:04 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 02 Apr 2019 15:08:04 +0000 Subject: [issue36506] An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554217684.18.0.537283116431.issue36506@roundup.psfhosted.org> Change by Christian Heimes : ---------- components: +Interpreter Core -2to3 (2.x to 3.x conversion tool) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:11:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:11:05 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554217865.28.0.246493512219.issue36508@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: python-config --ldflags must not contain LINKFORSHARED -> python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:11:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:11:33 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554217893.18.0.833104019077.issue36508@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-10112: "Use -Wl,--dynamic-list=x.list, not -Xlinker -export-dynamic". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:12:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 02 Apr 2019 15:12:12 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554217931.99.0.807540216522.issue36506@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: An arbitrary execution vulnerability exists in the built-in function getattr -> [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:12:54 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 15:12:54 +0000 Subject: [issue36507] frozenset type breaks ZFC In-Reply-To: <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org> Message-ID: <1554217974.51.0.0996059761137.issue36507@roundup.psfhosted.org> Raymond Hettinger added the comment: The code in the minimal example isn't creating nested frozensets. Instead, if is converting one frozenset into another (because frozenset takes an iterable as an argument). This is no different than list(list(list())) producing a single list rather than a nested list. Here's how to build nested frozensets: >>> x = frozenset({}) >>> y = frozenset({x}) >>> z = frozenset({y}) >>> x frozenset() >>> y frozenset({frozenset()}) >>> z frozenset({frozenset({frozenset()})}) >>> x is y False >>> x == y False ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:27:34 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 02 Apr 2019 15:27:34 +0000 Subject: [issue36507] frozenset type breaks ZFC In-Reply-To: <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org> Message-ID: <1554218854.53.0.377935378559.issue36507@roundup.psfhosted.org> Steven D'Aprano added the comment: Python is a programming language, and we're probably not going to care too much about compliance with ZFC set theory unless there is good *practical* and not theoretical reason to care. That's not to say that we want to break ZFC, only that if we do so, we won't lose any sleep over it. And it certainly won't mean that 3 == 2 as you suggest. But fortunately, we haven't violated ZFC and this is not a bug in Python. You've made two serious errors in your code. The first is that your second line of code: y = frozenset(frozenset()) doesn't do what you think it does. It doesn't create a [frozen]set of a [frozen]set, (a nested set). It creates a simple, non-nested set. Printing the value of y in the interactive interpreter would have shown you that it was a plain old non-nested empty set: py> print(y) frozenset() The code you want is something like: y = frozenset([frozenset()]) for reasons which I hope will become clear. The code you are actually using is equivalent to: temp = set() # mutable (non-frozen) for x in frozenset(): # loop over the contents of the inner frozenset temp.add(x) # since that inner set is empty, nothing gets added y = frozenset(temp) # an empty frozenset Your second error is using the `is` operator when you are talking about equality. The `is` operator tests for object identity, not equality, and the Python interpreter reserves the right to re-use objects when appropriate. In this case, the interpreter sees that it has two empty frozensets, and since they are indistinguishable and immutable, it saves memory by using the same object for both. (To put it another way: the interpreter caches certain immutable objects to save memory, and empty frozensets happen to be included.) Of course had you used `==` rather than `is` you would have got the same result, since two empty sets are equal, but the point still stands that you shouldn't use object identity when you mean equality. Once we fix the bugs in your code, we see that ZFC is saved: py> x = frozenset() # empty set py> y = frozenset([frozenset()]) # non-empty set py> print(len(x), len(y)) 0 1 py> x == y False ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 11:30:59 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 02 Apr 2019 15:30:59 +0000 Subject: [issue36507] frozenset type breaks ZFC In-Reply-To: <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org> Message-ID: <1554219059.95.0.775464082138.issue36507@roundup.psfhosted.org> Steven D'Aprano added the comment: (Aside: that's interesting, normally if I try to post a comment to an issue, and somebody else edits it in the meantime, the message doesn't get posted and I get a error message saying that the page has been edited. This time I did not.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 12:08:42 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 02 Apr 2019 16:08:42 +0000 Subject: [issue36493] Add math.midpoint(a,b) function In-Reply-To: <1554037806.92.0.427188886689.issue36493@roundup.psfhosted.org> Message-ID: <1554221322.08.0.590345414062.issue36493@roundup.psfhosted.org> Steven D'Aprano added the comment: I see this has been rejected for the math module, but I wonder whether it should be considered for Decimal? I recall Mark Dickinson demonstrating this lovely little bit of behaviour: py> from decimal import getcontext, Decimal py> getcontext().prec = 3 py> x = Decimal('0.516') py> y = Decimal('0.518') py> (x + y) / 2 Decimal('0.515') To prove its not a fluke, or an artifact of tiny numbers: py> getcontext().prec = 28 py> a = Decimal('0.10000000000000000009267827205') py> b = Decimal('0.10000000000000000009267827207') py> a <= (a + b)/2 <= b False py> a = Decimal('710000000000000000009267827205') py> b = Decimal('710000000000000000009267827207') py> a <= (a + b)/2 <= b False Thoughts? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 12:52:16 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 02 Apr 2019 16:52:16 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554223936.06.0.754158021206.issue36506@roundup.psfhosted.org> Josh Rosenberg added the comment: I'll note that, based on the title, I'm skeptical of the claim of a vulnerability. getattr is effectively *designed* to execute arbitrary code if called on an appropriate object (one where the class defines __getattribute__; defines __getattr__ without defining the name in question; defines the name in question as a property, not an instance attribute; or does something complicated with metaclasses that achieves a similar result looking up the attribute on the class). In all of those cases, the "vulnerability" only exists if: 1. The object in question defines a vulnerable handler for the attribute (that is, provides a code path for arbitrary execution that Python's attribute lookup machinery wasn't responsible for except insofar as it passed control to the unsafe handler in question) 2. Untrusted user input is passed as the name to look up on the vulnerable object If it's something more subtle than that (e.g. something where a "plain" instance with no special execution path supports arbitrary execution), that's an issue, but if it requires a Python developer to both create the vulnerability and open a path to trigger it explicitly, that doesn't really count. ---------- keywords: +security_issue nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 12:58:40 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 02 Apr 2019 16:58:40 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554224320.35.0.474504001957.issue36506@roundup.psfhosted.org> SilentGhost added the comment: As another note, this seem to be a third "security" issue created in less then a week to the same template (others are 36260 and 36462). I hope it's some assignment due soon. ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 12:59:39 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 02 Apr 2019 16:59:39 +0000 Subject: [issue36509] Add iot layout for windows iot containers Message-ID: <1554224379.78.0.511205388496.issue36509@roundup.psfhosted.org> New submission from Paul Monson : The layout should not contain tcl/tk, tkinter, distutils since ARM is cross-compiled and these features will not be useful on target ARM devices. ---------- components: Build, Windows messages: 339352 nosy: Paul Monson, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add iot layout for windows iot containers type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 13:01:44 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 02 Apr 2019 17:01:44 +0000 Subject: [issue36158] Regex search behaves differently in list comprehension In-Reply-To: <1551460917.2.0.142475833674.issue36158@roundup.psfhosted.org> Message-ID: <1554224504.85.0.196020302152.issue36158@roundup.psfhosted.org> Change by Josh Rosenberg : ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 13:08:03 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 02 Apr 2019 17:08:03 +0000 Subject: [issue36509] Add iot layout for windows iot containers In-Reply-To: <1554224379.78.0.511205388496.issue36509@roundup.psfhosted.org> Message-ID: <1554224883.27.0.699662595103.issue36509@roundup.psfhosted.org> Change by Paul Monson : ---------- keywords: +patch pull_requests: +12591 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 13:59:03 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 02 Apr 2019 17:59:03 +0000 Subject: [issue36379] nb_inplace_pow is always called with an invalid argument In-Reply-To: <1553083293.5.0.811205671176.issue36379@roundup.psfhosted.org> Message-ID: <1554227943.8.0.47291616069.issue36379@roundup.psfhosted.org> Josh Rosenberg added the comment: skrah: Is there any reason your patch, as written, wouldn't work? If you need a test case to verify, gmpy2's xmpz type supports in place pow (but requires the modulus to be None, since there is no normal way to pass it anyway), so you can just test: >>> xm = gmpy2.xmpz(2) >>> xm.__ipow__(3, 5) Right now, that code will raise a TypeError (from check_num_args in wrap_binary_func): TypeError: expected 1 argument, got 2 while: >>> xm.__ipow__(3) typically results in: SystemError: modulo not expected because wrap_binaryfunc fails to pass the expected argument so the receiver sees garbage, and xmpz's ipow implementation checks the third argument raises an exception if anything but None is received; barring a coincidence of Py_None being on the stack there, it'll always fail the test. Changing to wrap_ternaryfunc should make xm.__ipow__(3, 5) raise the SystemError currently raised by xm.__ipow__(3) (because it doesn't accept non-None), while xm.__ipow__(3) will work correctly. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 13:59:08 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 02 Apr 2019 17:59:08 +0000 Subject: [issue32413] Document that locals() may return globals() In-Reply-To: <1514008362.41.0.213398074469.issue32413@psf.upfronthosting.co.za> Message-ID: <1554227948.3.0.344925683572.issue32413@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12592 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:04:36 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 02 Apr 2019 18:04:36 +0000 Subject: [issue36485] Establish a uniform way to clear all caches in a given module In-Reply-To: <1553947019.94.0.789476600198.issue36485@roundup.psfhosted.org> Message-ID: <1554228276.91.0.15277331939.issue36485@roundup.psfhosted.org> Brett Cannon added the comment: Did you mean importlib.reload() instead of sys.reload()? And technically it would *if* you're okay with the other side-effects of reloading, e.g. making sure no one has a reference to any objects from the module's namespace which won't change in-place (e.g. if you stored a reference to the cache in some code then the reload wouldn't clear it for the stored reference). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:05:40 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 02 Apr 2019 18:05:40 +0000 Subject: [issue36364] errors in multiprocessing.shared_memory examples In-Reply-To: <1553006397.24.0.439789667635.issue36364@roundup.psfhosted.org> Message-ID: <1554228340.07.0.119330339089.issue36364@roundup.psfhosted.org> Brett Cannon added the comment: @Davin is there an issue for that and thus this issue can then be closed? Or did you want to re-purpose this issue to track that? Either way I'm assigning the issue to you to let you decide which way you want to go. :) ---------- assignee: docs at python -> davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:06:08 2019 From: report at bugs.python.org (DJR) Date: Tue, 02 Apr 2019 18:06:08 +0000 Subject: [issue36510] Regular Expression Dot-Star patter matching - re- text skipping Message-ID: <1554228368.59.0.219643697594.issue36510@roundup.psfhosted.org> New submission from DJR : #Python 3.7.2 Tk version 8.6.8 #IDLE version: 3.7.2 #Following code does not return ALL the partial matched patters within a string import re #_____________ #Normal Mode #_____________ atRegex = re.compile(r'...at') TextStr=(atRegex.findall(':at-at~at: The Bigcat sat in the hat sat on the flat sat mat sat.')) print('\nFull Text String:---> :at-at~at: The Bigcat sat in the hat sat on the flat sat mat sat\n') print('\n Normal Mode: Returns\n' + ':--->' + str(TextStr)) #_____________ #Greedy Mode #_____________ atRegex = re.compile(r'...at*') TextStr=(atRegex.findall(':at-at~at: The Bigcat sat in the hat sat on the flat sat mat sat.')) print('\nFull Text String:---> :at-at~at: The Bigcat sat in the hat sat on the flat sat mat sat mat\n') print('\n Greedy Mode: Returns\n' + ':---> ' + str(TextStr)+'\n') """ #=================================================================== # IDLE OutPut Normal Mode and Greedy Mode: multiple 'sat' are missing #=================================================================== Full Text String:---> :at-at~at: The Bigcat sat in the hat sat on the flat sat mat sat. Normal Mode: Returns :---> ['at-at', 'igcat', 'e hat', ' flat', 't mat'] Full Text String:---> :at-at~at: The Bigcat sat in the hat sat on the flat sat mat sat. Greedy Mode: Returns :---> ['at-at', 'igcat', 'e hat', ' flat', 't mat'] """ ---------- assignee: terry.reedy components: IDLE, Library (Lib), Regular Expressions, Windows messages: 339357 nosy: djr_python, ezio.melotti, mrabarnett, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal status: open title: Regular Expression Dot-Star patter matching - re- text skipping type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:08:43 2019 From: report at bugs.python.org (Jake Tesler) Date: Tue, 02 Apr 2019 18:08:43 +0000 Subject: [issue36084] Threading: add builtin TID attribute to Thread objects In-Reply-To: <1550875571.41.0.297490361597.issue36084@roundup.psfhosted.org> Message-ID: <1554228523.41.0.0855878107913.issue36084@roundup.psfhosted.org> Jake Tesler added the comment: *bump* Could someone look into reviewing this bug/PR? Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:14:56 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 02 Apr 2019 18:14:56 +0000 Subject: [issue32413] Document that locals() may return globals() In-Reply-To: <1514008362.41.0.213398074469.issue32413@psf.upfronthosting.co.za> Message-ID: <1554228896.51.0.51384833401.issue32413@roundup.psfhosted.org> miss-islington added the comment: New changeset ef516d11c1a0f885dba0aba8cf5366502077cdd4 by Miss Islington (bot) in branch '3.7': bpo-32413: Add documentation that at the module level, locals(), globals() are the same dictionary (GH-5004) https://github.com/python/cpython/commit/ef516d11c1a0f885dba0aba8cf5366502077cdd4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:15:54 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 02 Apr 2019 18:15:54 +0000 Subject: [issue32413] Document that locals() may return globals() In-Reply-To: <1514008362.41.0.213398074469.issue32413@psf.upfronthosting.co.za> Message-ID: <1554228954.84.0.500508081943.issue32413@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:16:14 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 02 Apr 2019 18:16:14 +0000 Subject: [issue36510] Regular Expression Dot-Star patter matching - re- text skipping In-Reply-To: <1554228368.59.0.219643697594.issue36510@roundup.psfhosted.org> Message-ID: <1554228974.52.0.790532387676.issue36510@roundup.psfhosted.org> SilentGhost added the comment: re.findall returns non-overlapping matches (as is made clear in documentation). This is the behaviour you're observing. ---------- assignee: terry.reedy -> components: -IDLE, Library (Lib), Windows nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:20:43 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 02 Apr 2019 18:20:43 +0000 Subject: [issue36487] Make C-API docs clear about what the "main" interpreter is In-Reply-To: <1553961350.55.0.679076430542.issue36487@roundup.psfhosted.org> Message-ID: <1554229243.08.0.304506507962.issue36487@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- components: +Documentation versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:32:48 2019 From: report at bugs.python.org (cagney) Date: Tue, 02 Apr 2019 18:32:48 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1554229968.42.0.461155131999.issue35866@roundup.psfhosted.org> cagney added the comment: I've attached a variation on cf-deadlock.py that, should nothing happen for 2 minutes, will kill itself. Useful with git bisect. ---------- Added file: https://bugs.python.org/file48242/cf-deadlock-alarm.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 14:51:03 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 02 Apr 2019 18:51:03 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1554231063.18.0.859442237611.issue33608@roundup.psfhosted.org> Change by Paul Monson : ---------- pull_requests: +12593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 15:09:21 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 02 Apr 2019 19:09:21 +0000 Subject: [issue36511] Add Windows ARM32 buildbot Message-ID: <1554232161.58.0.393661272603.issue36511@roundup.psfhosted.org> New submission from Paul Monson : Zachary Ware suggested I create an issue to discuss this: I've started a worker using the worker name monson-win-arm32 and the password provided. I think it is waiting for a change, there were no errors, but it didn't print anything. Also, I don?t see anything in the list of builders that looks like it would be windows arm32, and it's not showing in the list of workers. I'm looking at tools/buildbot/test.bat and it seems like it might be a good place to use SSH to run the test on arm32 device, but I'm not clear on where it is called from or what the best way to detect that project is being cross-compiled. Should I add an "-arm32" switch here? ---------- components: Build, Windows messages: 339362 nosy: Paul Monson, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add Windows ARM32 buildbot type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 15:09:59 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 02 Apr 2019 19:09:59 +0000 Subject: [issue36511] Add Windows ARM32 buildbot In-Reply-To: <1554232161.58.0.393661272603.issue36511@roundup.psfhosted.org> Message-ID: <1554232199.17.0.746420141285.issue36511@roundup.psfhosted.org> Change by Paul Monson : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 15:16:07 2019 From: report at bugs.python.org (james stone) Date: Tue, 02 Apr 2019 19:16:07 +0000 Subject: [issue20399] Comparison of memoryview In-Reply-To: <1390768657.21.0.774991286622.issue20399@psf.upfronthosting.co.za> Message-ID: <1554232567.18.0.866741162395.issue20399@roundup.psfhosted.org> james stone added the comment: I encountered this issue as well when using python 3.6.7 and psycopg2. Postgres tries to sort rows by the primary key field and if the returned type is a memoryview an the error is thrown: "TypeError: '<' not supported between instances of 'memoryview' and 'memoryview'." It may be more on the postgres guys to use a proper type with full comparison support. But I wanted to mention it here as a datapoint for a valid use case in the wild. More details on the specific issue at https://github.com/modoboa/modoboa-amavis/issues/115 ---------- nosy: +james stone _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 15:21:06 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 02 Apr 2019 19:21:06 +0000 Subject: [issue36487] Make C-API docs clear about what the "main" interpreter is In-Reply-To: <1553961350.55.0.679076430542.issue36487@roundup.psfhosted.org> Message-ID: <1554232866.03.0.525235654417.issue36487@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12594 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 15:52:53 2019 From: report at bugs.python.org (=?utf-8?q?Stefan_H=C3=B6lzl?=) Date: Tue, 02 Apr 2019 19:52:53 +0000 Subject: [issue36512] future_factory argument for Thread/ProcessPoolExecutor Message-ID: <1554234773.66.0.185942114441.issue36512@roundup.psfhosted.org> New submission from Stefan H?lzl : adding a future_factory argument to Thread/ProcessPoolExecutor to control which type of Future should be created by Executor.submit ---------- components: Library (Lib) messages: 339364 nosy: stefanhoelzl priority: normal severity: normal status: open title: future_factory argument for Thread/ProcessPoolExecutor type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 15:57:32 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 02 Apr 2019 19:57:32 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1554235052.37.0.0683450672045.issue36475@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12595 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 16:04:34 2019 From: report at bugs.python.org (=?utf-8?q?Stefan_H=C3=B6lzl?=) Date: Tue, 02 Apr 2019 20:04:34 +0000 Subject: [issue36512] future_factory argument for Thread/ProcessPoolExecutor In-Reply-To: <1554234773.66.0.185942114441.issue36512@roundup.psfhosted.org> Message-ID: <1554235474.5.0.495079500076.issue36512@roundup.psfhosted.org> Change by Stefan H?lzl : ---------- keywords: +patch pull_requests: +12596 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 16:12:59 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 02 Apr 2019 20:12:59 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1554235979.33.0.537192898605.issue36475@roundup.psfhosted.org> Joannah Nanjekye added the comment: @eric.snow , you can review the PR I submitted for this. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 16:34:12 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 02 Apr 2019 20:34:12 +0000 Subject: [issue36485] Establish a uniform way to clear all caches in a given module In-Reply-To: <1553947019.94.0.789476600198.issue36485@roundup.psfhosted.org> Message-ID: <1554237252.9.0.552655111144.issue36485@roundup.psfhosted.org> Raymond Hettinger added the comment: > Did you mean importlib.reload() instead of sys.reload()? Yes. > And technically it would *if* you're okay with the other > side-effects of reloading, If you want to go forward with this, go for it. I would like to be able to explain to another person why this is needed, but personally can't visualize a circumstance where a person is testing module, doesn't know how to use the existing cache clearing APIs, but needs to clear caches (not sure why), and doesn't either know or want what happens on import. I've never seen this situation arise, but if it's something you want, I won't stand it the way. BTW, if you're going to have some sort of clear_all(), perhaps it should cover the sys.intern() dictionary and string hashes as well. AFAICT, there's nothing special about a regex cache that gives it a greater need to be cleared ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 17:21:07 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 02 Apr 2019 21:21:07 +0000 Subject: [issue36322] Argument typo in dbm.ndbm.open In-Reply-To: <1552767909.74.0.734583361576.issue36322@roundup.psfhosted.org> Message-ID: <1554240067.68.0.397891421548.issue36322@roundup.psfhosted.org> Brett Cannon added the comment: Actually, it's even more subtle as the arguments are positional-only. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 17:25:40 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 02 Apr 2019 21:25:40 +0000 Subject: [issue36322] Argument typo in dbm.ndbm.open In-Reply-To: <1552767909.74.0.734583361576.issue36322@roundup.psfhosted.org> Message-ID: <1554240340.77.0.491188890494.issue36322@roundup.psfhosted.org> Brett Cannon added the comment: So Terry is correct in so much as there is no parameter name. :) Both of the functions in question are positional-only, so the name actually doesn't matter beyond giving a way to reference the parameter in the documentation. So thanks for the PR, Marco, but I'm going to reject this as there's nothing actually wrong with the gdbm or ndbm docs. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 17:27:32 2019 From: report at bugs.python.org (cagney) Date: Tue, 02 Apr 2019 21:27:32 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554240452.19.0.103767252333.issue6721@roundup.psfhosted.org> cagney added the comment: I suspect 3b699932e5ac3e7 is causing a hang in libreswan's kvmrunner.py on Fedora. Looking at the Fedora RPMs: python3-3.7.0-9.fc29.x86_64 didn't contain the fix and worked python3-3.7.1-4.fc29.x86_64 reverted the fix (for anaconda) and worked python3-3.7.2-4.fc29.x86_64 included the fix; eventually hangs I believe the hang looks like: Traceback (most recent call last): File "/home/build/libreswan-web/master/testing/utils/fab/runner.py", line 389, in _process_test test_domains = _boot_test_domains(logger, test, domain_prefix, boot_executor) File "/home/build/libreswan-web/master/testing/utils/fab/runner.py", line 203, in _boot_test_domains TestDomain.boot_and_login) File "/home/build/libreswan-web/master/testing/utils/fab/runner.py", line 150, in submit_job_for_domain logger.debug("scheduled %s on %s", job, domain) File "/usr/lib64/python3.7/logging/__init__.py", line 1724, in debug File "/usr/lib64/python3.7/logging/__init__.py", line 1768, in log def __repr__(self): File "/usr/lib64/python3.7/logging/__init__.py", line 1449, in log """ File "/usr/lib64/python3.7/logging/__init__.py", line 1519, in _log break File "/usr/lib64/python3.7/logging/__init__.py", line 1529, in handle logger hierarchy. If no handler was found, output a one-off error File "/usr/lib64/python3.7/logging/__init__.py", line 1591, in callHandlers File "/usr/lib64/python3.7/logging/__init__.py", line 905, in handle try: File "/home/build/libreswan-web/master/testing/utils/fab/logutil.py", line 163, in emit stream_handler.emit(record) File "/usr/lib64/python3.7/logging/__init__.py", line 1038, in emit Handler.__init__(self) File "/usr/lib64/python3.7/logging/__init__.py", line 1015, in flush name += ' ' File "/usr/lib64/python3.7/logging/__init__.py", line 854, in acquire self.emit(record) KeyboardInterrupt ---------- nosy: +cagney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 17:34:08 2019 From: report at bugs.python.org (cagney) Date: Tue, 02 Apr 2019 21:34:08 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1554240848.46.0.331240596162.issue35866@roundup.psfhosted.org> cagney added the comment: I'm seeing cf-deadlock-alarm.py hangs on vanilla python 3.7.[0123] with: Linux 5.0.5-100.fc28.x86_64 #1 SMP Wed Mar 27 22:16:29 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux glibc-2.27-37.fc28.x86_64 can anyone reproduce this? I also wonder if this is connected to bpo-6721 where a recent "fix" made things worse - the fedora versions that work for libreswan don't have the "fix". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 18:21:33 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 02 Apr 2019 22:21:33 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554243693.76.0.262012241283.issue6721@roundup.psfhosted.org> Gregory P. Smith added the comment: We need a small test case that can reproduce your problem. I believe https://github.com/python/cpython/commit/3b699932e5ac3e76031bbb6d700fbea07492641d to be correct. acquiring locks before fork in the thread doing the forking and releasing them afterwards is always the safe thing to do. Example possibility: Does your code use any C code that forks on its own without properly calling the C Python PyOS_BeforeFork(), PyOS_AfterFork_Parent(), and PyOS_AfterFork_Child() APIs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 20:15:04 2019 From: report at bugs.python.org (bigbigliang) Date: Wed, 03 Apr 2019 00:15:04 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554223936.06.0.754158021206.issue36506@roundup.psfhosted.org> Message-ID: bigbigliang added the comment: Yes, as you said. I think this problem can be closed. My initial idea was that if a user carefully constructs a vulnerability point, it may cause some danger, such as 'getattr(os,"system")("/bin/sh")'. So I have some ideas about whether it is necessary to filter it. Thank you for your reply. from:bigbigliang Josh Rosenberg ?2019?4?3??? ??12:52??? > > Josh Rosenberg added the comment: > > I'll note that, based on the title, I'm skeptical of the claim of a > vulnerability. getattr is effectively *designed* to execute arbitrary code > if called on an appropriate object (one where the class defines > __getattribute__; defines __getattr__ without defining the name in > question; defines the name in question as a property, not an instance > attribute; or does something complicated with metaclasses that achieves a > similar result looking up the attribute on the class). > > In all of those cases, the "vulnerability" only exists if: > > 1. The object in question defines a vulnerable handler for the attribute > (that is, provides a code path for arbitrary execution that Python's > attribute lookup machinery wasn't responsible for except insofar as it > passed control to the unsafe handler in question) > 2. Untrusted user input is passed as the name to look up on the vulnerable > object > > If it's something more subtle than that (e.g. something where a "plain" > instance with no special execution path supports arbitrary execution), > that's an issue, but if it requires a Python developer to both create the > vulnerability and open a path to trigger it explicitly, that doesn't really > count. > > ---------- > keywords: +security_issue > nosy: +josh.r > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 20:49:45 2019 From: report at bugs.python.org (Ivan Pozdeev) Date: Wed, 03 Apr 2019 00:49:45 +0000 Subject: [issue36501] Remove POSIX.1e ACLs in tests that rely on default permissions behavior In-Reply-To: <1554173646.74.0.526062009257.issue36501@roundup.psfhosted.org> Message-ID: <1554252585.04.0.0104081427012.issue36501@roundup.psfhosted.org> Ivan Pozdeev added the comment: Seeing during PR composition how basically every mode check and every `test.support.temp_umask` use is broken by ACLs, I'm starting to doubt that fixing individual test cases is the way to go. Though we can simply not worry about supporting everything imaginable and solve problems as they come and declare highly unusual cases unsupported. For the record, other potential problems: * All open(O_CREAT) and umask uses anywhere in the tests are broken by default. * Though only 4 test files were affected for now -- test_pathlib, test_tarfile, test_os, test_import . * There are other overlay security frameworks that override POSIX permissions like NFSv4 and SELinux. And possible solutions: * Skip mode_t checks outright if overlay security is detected like it's already done in Windows * Embed cleanup code into test.support's temp_* and such. In the POSIX.1e case, will have to create temporary dirs or change permissions for the current dir. * I don't think regrtest's temporary dir is a good place for this 'cuz tests are supposed to be runnable directly with `unittest`, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 20:51:17 2019 From: report at bugs.python.org (Paul Monson) Date: Wed, 03 Apr 2019 00:51:17 +0000 Subject: [issue36513] Add support for building arm32 nuget package Message-ID: <1554252677.73.0.380918905446.issue36513@roundup.psfhosted.org> Change by Paul Monson : ---------- components: Build, Windows nosy: Paul Monson, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add support for building arm32 nuget package type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 20:55:40 2019 From: report at bugs.python.org (Paul Monson) Date: Wed, 03 Apr 2019 00:55:40 +0000 Subject: [issue36513] Add support for building arm32 nuget package Message-ID: <1554252940.22.0.653416645766.issue36513@roundup.psfhosted.org> Change by Paul Monson : ---------- keywords: +patch pull_requests: +12597 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 21:24:53 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 03 Apr 2019 01:24:53 +0000 Subject: [issue32941] mmap should expose madvise() In-Reply-To: <1519506923.52.0.467229070634.issue32941@psf.upfronthosting.co.za> Message-ID: <1554254693.16.0.461966397574.issue32941@roundup.psfhosted.org> Change by Giampaolo Rodola' : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 22:14:02 2019 From: report at bugs.python.org (Colin Dick) Date: Wed, 03 Apr 2019 02:14:02 +0000 Subject: [issue36514] -m switch revisited Message-ID: <1554257642.04.0.214620522086.issue36514@roundup.psfhosted.org> New submission from Colin Dick : -m switch revisited - see issue 27487 Win 10 64bit python 3.6.3 & 3.7.3 initially running code using py 3.6.3 with this command python -m vixsd.py produced C:\Python36\python.exe: Error while finding module specification for 'vixsd.py' (AttributeError: module 'vixsd' has no attribute '__path__') updated python from 3.6.3 to 3.7.3 searched & read web retried the 4 options with & without "-m" & ".py" results reproduced below c:\shared\python\vmw>python vixsd python: can't open file 'vixsd': [Errno 2] No such file or directory c:\shared\python\vmw>python vixsd.py A c:\shared\python\vmw>python -m vixsd A c:\shared\python\vmw>python -m vixsd.py A C:\Python3\python.exe: Error while finding module specification for 'vixsd.py' (ModuleNotFoundError: __path__ attribute not found on 'vixsd' while trying to find 'vixsd.py') while this was initially produced thru my ignorance, handling all 4 options still does not work correctly appears to have been a problem at least since issue 27487 cheers team, keep up the great work ColinDNZ ---------- messages: 339374 nosy: Colin Dick priority: normal severity: normal status: open title: -m switch revisited type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 22:33:56 2019 From: report at bugs.python.org (Yue Sun) Date: Wed, 03 Apr 2019 02:33:56 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1554258836.48.0.983105346753.issue31904@roundup.psfhosted.org> Change by Yue Sun : ---------- pull_requests: +12598 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 22:42:45 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 03 Apr 2019 02:42:45 +0000 Subject: [issue32941] mmap should expose madvise() In-Reply-To: <1519506923.52.0.467229070634.issue32941@psf.upfronthosting.co.za> Message-ID: <1554259365.85.0.991759274821.issue32941@roundup.psfhosted.org> Josh Rosenberg added the comment: It might be nice to expose a more limited API to prefetch memory in bulk while we're at it. Windows 8 and higher offers PrefetchVirtualMemory ( https://docs.microsoft.com/en-us/windows/desktop/api/memoryapi/nf-memoryapi-prefetchvirtualmemory ) which fills roughly the same niche as madvise/posix_madvise with the WILLNEED hint. I kept meaning to file an issue to suggest this, but kept getting hung up on how to make it as portable as possible and as powerful as possible, and where to implement it. It could go on mmap, but it's also useful for just about any contiguous buffer-supporting object, so it almost seems like adding an os.madvise (and/or os.prefetch) would make more sense than specifically tying it to the mmap module. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 23:36:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 03 Apr 2019 03:36:56 +0000 Subject: [issue36512] future_factory argument for Thread/ProcessPoolExecutor In-Reply-To: <1554234773.66.0.185942114441.issue36512@roundup.psfhosted.org> Message-ID: <1554262616.17.0.315966064254.issue36512@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +bquinlan, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 2 23:38:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 03 Apr 2019 03:38:56 +0000 Subject: [issue36501] Remove POSIX.1e ACLs in tests that rely on default permissions behavior In-Reply-To: <1554173646.74.0.526062009257.issue36501@roundup.psfhosted.org> Message-ID: <1554262736.68.0.146007825196.issue36501@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 00:14:33 2019 From: report at bugs.python.org (tejesh) Date: Wed, 03 Apr 2019 04:14:33 +0000 Subject: [issue36505] PYTHON-CAN with vector In-Reply-To: <1554212625.82.0.669161451897.issue36505@roundup.psfhosted.org> Message-ID: <1554264873.46.0.257563049873.issue36505@roundup.psfhosted.org> tejesh added the comment: THANKS for your response i have tried checking in Stackoverflow i did not get any help from the list Q&A's in Stackoverflow i sent out mail to python help also still i did not got any help i need help ASAP Thanks again ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 00:29:52 2019 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Wed, 03 Apr 2019 04:29:52 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554265792.55.0.299873510109.issue9883@roundup.psfhosted.org> Fred L. Drake, Jr. added the comment: Updated target to Python 3.8, since this has aged a bit. ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 01:12:15 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 03 Apr 2019 05:12:15 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554268335.91.0.392180975627.issue36440@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset cb0748d3939c31168ab5d3b80e3677494497d5e3 by Pablo Galindo (tyomitch) in branch 'master': bpo-36440: include node names in ParserError messages, instead of numeric IDs (GH-12565) https://github.com/python/cpython/commit/cb0748d3939c31168ab5d3b80e3677494497d5e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 01:22:07 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 03 Apr 2019 05:22:07 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554268927.32.0.82858296339.issue36440@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +12599 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 01:35:40 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 03 Apr 2019 05:35:40 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554269740.53.0.0110582060933.issue9883@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +scoder, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 01:41:19 2019 From: report at bugs.python.org (Matthias Klose) Date: Wed, 03 Apr 2019 05:41:19 +0000 Subject: [issue36515] unaligned memory access in the _sha3 extension Message-ID: <1554270079.02.0.655835284074.issue36515@roundup.psfhosted.org> New submission from Matthias Klose : This was seen when running an armhf binary on a 64bit kernel. The problem is that the implementation uses unaligned memory accesses, and even is well aware of that. The module allows misaligned memory accesses by default. The NO_MISALIGNED_ACCESSES macro is never defined. Now you can define it only on architectures where unaligned memory accesses are not allowed (ARM32 on 64bit kernels), or where there are performance penalties (AArch64), or just don't try to outsmart modern compilers and always define this macro. The attached patch only fixes the issue on ARM32 and AArch64, however the safe fix should be to always define the macro. ---------- components: Extension Modules files: arm-alignment.diff keywords: patch messages: 339379 nosy: christian.heimes, doko priority: high severity: normal status: open title: unaligned memory access in the _sha3 extension type: crash versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file48243/arm-alignment.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 02:27:07 2019 From: report at bugs.python.org (Jiongjiong Gao) Date: Wed, 03 Apr 2019 06:27:07 +0000 Subject: [issue36516] Python Launcher can not recognize pyw file as Python GUI Script file type correctly. Message-ID: <1554272827.64.0.548414335806.issue36516@roundup.psfhosted.org> New submission from Jiongjiong Gao : In Python Launcher Preferences there are two settings for file type, Python Script and Python GUI Script. But Python Launcher can not recognize pyw file as Python GUI Script file type correctly. ---------- components: macOS messages: 339380 nosy: gjj2828, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python Launcher can not recognize pyw file as Python GUI Script file type correctly. type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 03:14:44 2019 From: report at bugs.python.org (Matthias Klose) Date: Wed, 03 Apr 2019 07:14:44 +0000 Subject: [issue36445] bus error in test_gil test on armhf running with 64bit kernel In-Reply-To: <1553676257.29.0.460589277249.issue36445@roundup.psfhosted.org> Message-ID: <1554275684.18.0.836519070353.issue36445@roundup.psfhosted.org> Change by Matthias Klose : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> unaligned memory access in the _sha3 extension _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 03:32:13 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 03 Apr 2019 07:32:13 +0000 Subject: [issue36505] PYTHON-CAN with vector In-Reply-To: <1554212625.82.0.669161451897.issue36505@roundup.psfhosted.org> Message-ID: <1554276733.16.0.966782836274.issue36505@roundup.psfhosted.org> SilentGhost added the comment: Again, this is not the problem with Python as a language, its implementation in CPython or the standard library. Please, don't re-open this issue again. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 04:28:45 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 03 Apr 2019 08:28:45 +0000 Subject: [issue36514] -m switch revisited In-Reply-To: <1554257642.04.0.214620522086.issue36514@roundup.psfhosted.org> Message-ID: <1554280125.57.0.426820813664.issue36514@roundup.psfhosted.org> SilentGhost added the comment: Colin, sorry, are you reporting an issue? Because I have trouble understanding what is. The examples you've posted seem to work as expected, no? ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 04:31:21 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 03 Apr 2019 08:31:21 +0000 Subject: [issue36489] add filename_extension_map and/or content-types_map dict(s) to mimetypes In-Reply-To: <1553980712.92.0.44378409883.issue36489@roundup.psfhosted.org> Message-ID: <1554280281.04.0.474898291851.issue36489@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Library (Lib) nosy: +r.david.murray type: -> enhancement versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 04:38:00 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 03 Apr 2019 08:38:00 +0000 Subject: [issue36481] telnetlib process_rawq() callback In-Reply-To: <1553911873.53.0.089397149063.issue36481@roundup.psfhosted.org> Message-ID: <1554280680.57.0.917626273624.issue36481@roundup.psfhosted.org> SilentGhost added the comment: As a general rule, your PR would have to include documentation (including a NEWS entry) and tests for the new functionality. Naturally, by itself it's not a guarantee that this suggestion would be accepted. ---------- nosy: +SilentGhost, giampaolo.rodola versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 04:44:42 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 03 Apr 2019 08:44:42 +0000 Subject: [issue36053] pkgutil.walk_packages jumps out from given path if there is package with the same name in sys.path In-Reply-To: <1550680627.64.0.854320242724.issue36053@roundup.psfhosted.org> Message-ID: <1554281082.18.0.814134123804.issue36053@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +ncoghlan 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 Apr 3 04:45:32 2019 From: report at bugs.python.org (Alfred Sawaya) Date: Wed, 03 Apr 2019 08:45:32 +0000 Subject: [issue34430] Symmetrical chaining futures in asyncio.future.wrap_future In-Reply-To: <1534590140.17.0.56676864532.issue34430@psf.upfronthosting.co.za> Message-ID: <1554281132.13.0.61148942857.issue34430@roundup.psfhosted.org> Alfred Sawaya added the comment: Can be closed if not needed by the community. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 05:18:15 2019 From: report at bugs.python.org (Jiongjiong Gao) Date: Wed, 03 Apr 2019 09:18:15 +0000 Subject: [issue36516] Python Launcher can not recognize pyw file as Python GUI Script file type correctly. In-Reply-To: <1554272827.64.0.548414335806.issue36516@roundup.psfhosted.org> Message-ID: <1554283095.93.0.250736794069.issue36516@roundup.psfhosted.org> Change by Jiongjiong Gao : ---------- keywords: +patch pull_requests: +12600 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 05:33:02 2019 From: report at bugs.python.org (Christian Heimes) Date: Wed, 03 Apr 2019 09:33:02 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554283982.32.0.203779183062.issue36506@roundup.psfhosted.org> Christian Heimes added the comment: Could you please do us a favor and contact MITRE to get the CVE number revoked? Please CC security at python.org so we have a record of the emails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 06:42:42 2019 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 03 Apr 2019 10:42:42 +0000 Subject: [issue36514] -m switch revisited In-Reply-To: <1554257642.04.0.214620522086.issue36514@roundup.psfhosted.org> Message-ID: <1554288162.91.0.0897038643497.issue36514@roundup.psfhosted.org> Ronald Oussoren added the comment: This is not a bug: * "python -m NAME" runs module (or package) NAME as a script, NAME should therefore be a module name and not a filename (and hence not have a .py suffix) * "python NAME" runs a script in file NAME and should therefore by a complete file name, including a suffix when the file name has a suffix. In your examples "python -m vixsd.py" and "python vixsd" correctly raise an error. ---------- nosy: +ronaldoussoren resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 06:49:09 2019 From: report at bugs.python.org (Colin Dick) Date: Wed, 03 Apr 2019 10:49:09 +0000 Subject: [issue36514] -m switch revisited In-Reply-To: <1554288162.91.0.0897038643497.issue36514@roundup.psfhosted.org> Message-ID: Colin Dick added the comment: No, the first example is expected, BUT the middle two work HENCE the last should NOT have a problem either... No? Because the middle two work, so should the last complete without any errors. There were no code changes, Therefore the problem is with python On Wed, 3 Apr 2019, 23:42 Ronald Oussoren wrote: > > Ronald Oussoren added the comment: > > This is not a bug: > > * "python -m NAME" runs module (or package) NAME as a script, NAME should > therefore be a module name and not a filename (and hence not have a .py > suffix) > > * "python NAME" runs a script in file NAME and should therefore by a > complete file name, including a suffix when the file name has a suffix. > > In your examples "python -m vixsd.py" and "python vixsd" correctly raise > an error. > > ---------- > nosy: +ronaldoussoren > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 07:39:28 2019 From: report at bugs.python.org (James Socol) Date: Wed, 03 Apr 2019 11:39:28 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554291568.98.0.110812989196.issue9883@roundup.psfhosted.org> Change by James Socol : ---------- nosy: -jamessocol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 08:35:10 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 03 Apr 2019 12:35:10 +0000 Subject: [issue36489] add filename_extension_map and/or content-types_map dict(s) to mimetypes In-Reply-To: <1553980712.92.0.44378409883.issue36489@roundup.psfhosted.org> Message-ID: <1554294910.71.0.354186506525.issue36489@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > However this seems to compete with the functionality of the types map so another consideration is content-types_map where the content-type is the key and the pair values are lists of valid filename extensions: There is mimetypes.MimeTypes().types_map_inv > https://docs.python.org/3.8/library/mimetypes.html#mimetypes.MimeTypes.types_map_inv > Tuple containing two dictionaries, mapping MIME types to a list of filename extensions: the first dictionary is for the non-standards types and the second one is for the standard types. They are initialized by common_types and types_map. >>> mimetypes.MimeTypes().types_map_inv[1]['text/html'] ['.htm', '.html'] ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 08:58:24 2019 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 03 Apr 2019 12:58:24 +0000 Subject: [issue36514] -m switch revisited In-Reply-To: <1554257642.04.0.214620522086.issue36514@roundup.psfhosted.org> Message-ID: <1554296304.74.0.955266530178.issue36514@roundup.psfhosted.org> Ronald Oussoren added the comment: Given a python script in a file named foo.py in the current directory: * python -m foo Should, and does, work. * python -m foo.py Raises an error, because the command tries to run the submodule "py" of module "foo" as the __main__ module. For script files this will raise an error because module "foo" is not a package (hence the AttributeError about __path__). The error might get raised at the end of the script because the interpreter executes the module body on import before it looks for attributes and submodules. * python foo Does not work because there is no file named "foo". This is expected behaviour. * python foo.py Works because there is a file named foo.py. The interpreter executes the contents of the file. "python NAME" and "python -m NAME" are not the same, which is why the two invocations behave differently. This is expected behaviour and not a bug. See also "https://docs.python.org/3/using/cmdline.html#cmdoption-m" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 09:07:30 2019 From: report at bugs.python.org (Andrew Wason) Date: Wed, 03 Apr 2019 13:07:30 +0000 Subject: [issue36517] typing.NamedTuple does not support mixins Message-ID: <1554296850.04.0.71784053328.issue36517@roundup.psfhosted.org> New submission from Andrew Wason : Subclassing typing.NamedTuple an inheriting from a mixin class does not work. It does work for collections.namedtuple, and can be worked around by modifying typing.NamedTupleMeta: >>> import collections >>> import typing >>> >>> >>> class Mixin: ... def mixin(self): ... return "mixin" ... >>> >>> class CollectionsNamedTuple(Mixin, collections.namedtuple('CollectionsNamedTuple', [ ... "a", ... "b", ... ])): ... pass ... >>> >>> class TypingNamedTuple(Mixin, typing.NamedTuple): ... a: str ... b: str ... >>> >>> class NamedTupleMeta(typing.NamedTupleMeta): ... def __new__(cls, typename, bases, ns): ... cls_obj = super().__new__(cls, typename + '_nm_base', bases, ns) ... bases = bases + (cls_obj,) ... return type(typename, bases, {}) ... >>> >>> class FixedTypingNamedTuple(Mixin, metaclass=NamedTupleMeta): ... a: str ... b: str ... >>> >>> cnt = CollectionsNamedTuple("av", "bv") >>> tnt = TypingNamedTuple("av", "bv") >>> ftnt = FixedTypingNamedTuple("av", "bv") >>> >>> cnt.mixin() 'mixin' >>> ftnt.mixin() 'mixin' >>> tnt.mixin() Traceback (most recent call last): File "", line 1, in AttributeError: 'TypingNamedTuple' object has no attribute 'mixin' ---------- components: Library (Lib) messages: 339390 nosy: rectalogic priority: normal severity: normal status: open title: typing.NamedTuple does not support mixins type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 09:15:33 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 03 Apr 2019 13:15:33 +0000 Subject: [issue36517] typing.NamedTuple does not support mixins In-Reply-To: <1554296850.04.0.71784053328.issue36517@roundup.psfhosted.org> Message-ID: <1554297333.13.0.181563407054.issue36517@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 09:35:37 2019 From: report at bugs.python.org (Matej Cepl) Date: Wed, 03 Apr 2019 13:35:37 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1554298537.3.0.148287614893.issue36216@roundup.psfhosted.org> Matej Cepl added the comment: I am trying to investigate the impact of this bug on Python 2.6 (yes, it is for SLE), and I have hard to replicate the steps in the description even on 2.7: ~$ ipython2 Python 2.7.15 (default, May 21 2018, 17:53:03) [GCC] Type "copyright", "credits" or "license" for more information. IPython 5.8.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: from urlparse import urlsplit In [2]: u = "https://example.com\uFF03 at bing.com".encode("idna").decode("ascii") In [3]: u Out[3]: u'https://example.com\\uFF03 at bing.com' In [4]: urlsplit(u).netloc.rpartition('@')[2] Out[4]: u'bing.com' In [5]: u = "https://example.com\uFF03 at bing.com" In [6]: urlsplit(u).netloc.rpartition('@')[2] Out[6]: 'bing.com' In [7]: u = u.encode("idna").decode("ascii") In [8]: urlsplit(u).netloc.rpartition('@')[2] Out[8]: u'bing.com' In [9]: import unicodedata In [10]: u2 = unicodedata.normalize('NFKC', u) In [11]: u2 Out[11]: u'https://example.com\\uFF03 at bing.com' In [12]: urlsplit(u2) Out[12]: SplitResult(scheme=u'https', netloc=u'example.com\\uFF03 at bing.com', path=u'', query='', fragment='') In [13]: Yes, the results are weird, and most likely they would break any software relying on them, but I am not sure that it is a security issue. vstinner ? steve.dower ? What do you think? ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 10:12:04 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Wed, 03 Apr 2019 14:12:04 +0000 Subject: [issue36517] typing.NamedTuple does not support mixins In-Reply-To: <1554296850.04.0.71784053328.issue36517@roundup.psfhosted.org> Message-ID: <1554300724.5.0.522561355303.issue36517@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 10:14:02 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 03 Apr 2019 14:14:02 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function Message-ID: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> New submission from Serhiy Storchaka : This is yet one alternative to PEP 570. It does not solve all problems that PEP 570 is purposed to solve, but it significantly reduces the need in positional-only parameters. Currently the problem with implementing in Python functions that should accept arbitrary keyword arguments is that argument names can conflict with names of other parameters (in particularly "self"). For example, look at the function def log(fmt, **kwargs): print(fmt.format_map(kwargs)) You cannot call log('Format: {fmt}', fmt='binary'), because the argument for parameter "fmt" is specified twice: as positional argument and as keyword argument. The idea is that if the function has the var-keyword parameter, then keyword arguments with names which match passed positional arguments will be saved into the var-keyword dict instead of be error. The advantage of this idea over alternatives is that it does not need changing the user code. Implementing this feature will fix the user code that we do not even see. Most functions that otherwise would need positional only parameters (over 60 in the stdlib) will be automatically fixed by this feature. We could revert the deprecations added in issue36492 and simplify few functions that used the *args hack before. The change itself is very simple, just modification of few lines in ceval.c and inspect.py. The disadvantage is that it does not help with optional parameters. For example: def make_dict(dict=(), **kwargs): res = {} res.update(dict) res.update(kwargs) return res make_dict(dict={}, list=[]) will still return {'list': []} instead of {'dict': {}, list: []}. You still need to use the *args hack to get the latter result. But there are not much such functions. This idea was proposed by Steve [1]. [1] https://discuss.python.org/t/pep-570-python-positional-only-parameters/1078/39 ---------- components: Interpreter Core messages: 339392 nosy: gvanrossum, serhiy.storchaka, steve.dower priority: normal severity: normal status: open title: Avoid conflicts when pass arbitrary keyword arguments to Python function type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 10:15:44 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 03 Apr 2019 14:15:44 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function In-Reply-To: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> Message-ID: <1554300944.84.0.239756145796.issue36518@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +12601 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 10:37:36 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 03 Apr 2019 14:37:36 +0000 Subject: [issue36517] typing.NamedTuple does not support mixins In-Reply-To: <1554296850.04.0.71784053328.issue36517@roundup.psfhosted.org> Message-ID: <1554302256.87.0.844123657315.issue36517@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 10:40:50 2019 From: report at bugs.python.org (cagney) Date: Wed, 03 Apr 2019 14:40:50 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554302450.95.0.81244523865.issue6721@roundup.psfhosted.org> cagney added the comment: > Does your code use any C code that forks on its own without properly calling the C Python PyOS_BeforeFork(), PyOS_AfterFork_Parent(), and PyOS_AfterFork_Child() APIs? No. Is there a web page explaining how to pull a python backtrace from all the threads running within a daemon? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 10:52:11 2019 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 03 Apr 2019 14:52:11 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1554303131.71.0.772133660035.issue33261@roundup.psfhosted.org> Change by Petr Viktorin : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:04:35 2019 From: report at bugs.python.org (George King) Date: Wed, 03 Apr 2019 15:04:35 +0000 Subject: [issue36519] Blake2b/s implementations have minor GIL issues Message-ID: <1554303875.24.0.336244422636.issue36519@roundup.psfhosted.org> New submission from George King : I was browsing the Blake2b module implementation in master and noticed two subtle issues in blake2b_impl.c. There are two places where the GIL gets released; both of them appear flawed. py_blake2b_new_impl, line 221. The ALLOW_THREADS block fails to acquire/release self->lock. _blake2_blake2b_update, line 279. The lock is lazily allocated correctly on line 279. However the test on 282 that chooses to release the GIL or not fails to take into account the length test. This means that once a large block is fed to `update`, then every call to update will release the GIL, even if it is a single byte. It should look something more like this: ``` bool should_allow_threads = (buf.len >= HASHLIB_GIL_MINSIZE); if (should_allow_threads && self->lock == NULL) self->lock = PyThread_allocate_lock(); if (should_allow_threads && self->lock != NULL) { ... } else { ... } ``` This respects the size criterion, and also protects against the case where the lock allocation fails. ---------- components: Extension Modules messages: 339394 nosy: gwk priority: normal severity: normal status: open title: Blake2b/s implementations have minor GIL issues versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:10:40 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 03 Apr 2019 15:10:40 +0000 Subject: [issue36519] Blake2b/s implementations have minor GIL issues In-Reply-To: <1554303875.24.0.336244422636.issue36519@roundup.psfhosted.org> Message-ID: <1554304240.57.0.696825150909.issue36519@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +christian.heimes type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:12:55 2019 From: report at bugs.python.org (Mario Corchero) Date: Wed, 03 Apr 2019 15:12:55 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function In-Reply-To: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> Message-ID: <1554304375.39.0.838901215337.issue36518@roundup.psfhosted.org> Change by Mario Corchero : ---------- nosy: +mariocj89 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:17:11 2019 From: report at bugs.python.org (bigbigliang) Date: Wed, 03 Apr 2019 15:17:11 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554283982.32.0.203779183062.issue36506@roundup.psfhosted.org> Message-ID: bigbigliang added the comment: > > Certainly. > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:20:57 2019 From: report at bugs.python.org (Christian Heimes) Date: Wed, 03 Apr 2019 15:20:57 +0000 Subject: [issue36519] Blake2b/s implementations have minor GIL issues In-Reply-To: <1554303875.24.0.336244422636.issue36519@roundup.psfhosted.org> Message-ID: <1554304857.97.0.742764240306.issue36519@roundup.psfhosted.org> Christian Heimes added the comment: Thanks, I'll have a look. ---------- assignee: -> christian.heimes versions: +Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:40:34 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 03 Apr 2019 15:40:34 +0000 Subject: [issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects In-Reply-To: <1484310274.99.0.832491900546.issue29259@psf.upfronthosting.co.za> Message-ID: <1554306034.1.0.48811047038.issue29259@roundup.psfhosted.org> Jeroen Demeyer added the comment: See also PEP 590, which has very similar ideas. Also PEP 580 is related to this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:58:04 2019 From: report at bugs.python.org (sds) Date: Wed, 03 Apr 2019 15:58:04 +0000 Subject: [issue13947] gdbm reorganize() leaves hanging file descriptor In-Reply-To: <1328501616.08.0.882414908885.issue13947@psf.upfronthosting.co.za> Message-ID: <1554307084.08.0.735779519116.issue13947@roundup.psfhosted.org> sds added the comment: I observe the same behavior on Linux 4.18.0-17-generic #18-Ubuntu with Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]. gdbm 1.14.1-6: after db = dbm.gnu.open("asdf","n") db["a"] = "124" db.reorganize() db.close() I see $ lsof ~/asdf COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python3 22071 sds mem-W REG 8,2 16384 4328326 /home/sds/asdf and >>> db = dbm.gnu.open("asdf","r") Traceback (most recent call last): File "", line 1, in File "/home/sds/src/pyapp/tests/fileconv_test.py", line 1053, in _gdbm.error: [Errno 11] Resource temporarily unavailable ---------- nosy: +sam-s _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:58:13 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Wed, 03 Apr 2019 15:58:13 +0000 Subject: [issue21879] str.format() gives poor diagnostic on placeholder mismatch In-Reply-To: <1404052648.46.0.81950938275.issue21879@psf.upfronthosting.co.za> Message-ID: <1554307093.49.0.0712285291292.issue21879@roundup.psfhosted.org> Joannah Nanjekye added the comment: @franciscouzo any status on this? Do you need any help on this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:58:44 2019 From: report at bugs.python.org (sds) Date: Wed, 03 Apr 2019 15:58:44 +0000 Subject: [issue13947] gdbm reorganize() leaves hanging file descriptor In-Reply-To: <1328501616.08.0.882414908885.issue13947@psf.upfronthosting.co.za> Message-ID: <1554307124.8.0.666048120325.issue13947@roundup.psfhosted.org> Change by sds : ---------- components: +Library (Lib) versions: +Python 3.7 -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:59:05 2019 From: report at bugs.python.org (sds) Date: Wed, 03 Apr 2019 15:59:05 +0000 Subject: [issue13947] gdbm reorganize() leaves hanging file descriptor In-Reply-To: <1328501616.08.0.882414908885.issue13947@psf.upfronthosting.co.za> Message-ID: <1554307145.64.0.125064910964.issue13947@roundup.psfhosted.org> Change by sds : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 11:59:33 2019 From: report at bugs.python.org (sds) Date: Wed, 03 Apr 2019 15:59:33 +0000 Subject: [issue13947] gdbm reorganize() leaves hanging file descriptor In-Reply-To: <1328501616.08.0.882414908885.issue13947@psf.upfronthosting.co.za> Message-ID: <1554307173.77.0.223191504882.issue13947@roundup.psfhosted.org> Change by sds : ---------- versions: +Python 3.6 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 12:38:14 2019 From: report at bugs.python.org (Francisco Couzo) Date: Wed, 03 Apr 2019 16:38:14 +0000 Subject: [issue21879] str.format() gives poor diagnostic on placeholder mismatch In-Reply-To: <1404052648.46.0.81950938275.issue21879@psf.upfronthosting.co.za> Message-ID: <1554309494.21.0.123019485682.issue21879@roundup.psfhosted.org> Change by Francisco Couzo : ---------- pull_requests: +12602 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 12:39:43 2019 From: report at bugs.python.org (Francisco Couzo) Date: Wed, 03 Apr 2019 16:39:43 +0000 Subject: [issue21879] str.format() gives poor diagnostic on placeholder mismatch In-Reply-To: <1404052648.46.0.81950938275.issue21879@psf.upfronthosting.co.za> Message-ID: <1554309583.27.0.110698157103.issue21879@roundup.psfhosted.org> Francisco Couzo added the comment: I just made the pull request, I totally forgot I mentioned I was going to work on this, sorry! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 12:48:52 2019 From: report at bugs.python.org (Manjusaka) Date: Wed, 03 Apr 2019 16:48:52 +0000 Subject: [issue36054] Way to detect CPU count inside docker container In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1554310132.92.0.877520907674.issue36054@roundup.psfhosted.org> Manjusaka added the comment: Hi St?phane: I have checked the JVM implantation about container improvements. I confirm that maybe we need a new Libary for container environment. I don't think that combine it into the os module is a good idea. I will make a PR during this week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 12:55:00 2019 From: report at bugs.python.org (Agustin) Date: Wed, 03 Apr 2019 16:55:00 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1313477575.0.0.856648078618.issue12756@psf.upfronthosting.co.za> Message-ID: <1554310500.93.0.86040040679.issue12756@roundup.psfhosted.org> Agustin added the comment: Hi there, I was wondering if we re-open this issue breaking the backward compatibility now? ---------- nosy: +tin versions: +Python 3.9 -Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 12:59:37 2019 From: report at bugs.python.org (Aaron Hall) Date: Wed, 03 Apr 2019 16:59:37 +0000 Subject: [issue35625] Comprehension doc doesn't mention buggy class scope behavior In-Reply-To: <1546253280.49.0.920078772343.issue35625@roundup.psfhosted.org> Message-ID: <1554310777.81.0.40596943388.issue35625@roundup.psfhosted.org> Change by Aaron Hall : ---------- nosy: +Aaron Hall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:04:35 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 03 Apr 2019 17:04:35 +0000 Subject: [issue36466] Adding a way to strip annotations from compiled bytecode In-Reply-To: <1553825507.66.0.407362572806.issue36466@roundup.psfhosted.org> Message-ID: <1554311075.44.0.890687080293.issue36466@roundup.psfhosted.org> Ivan Levkivskyi added the comment: +1 from me. There are two ways to enable this: * Add -OOO that would remove all three: asserts, docstrings, annotations * Add separate --O-asserts --O-docstrings --O-annotations (or similar) I think I like the second option more. @cary Please note that our workflow changed, you can now submit a PR to our GitHub repo instead of sending a patch. Also please include tests and docs in your PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:05:14 2019 From: report at bugs.python.org (Christian Heimes) Date: Wed, 03 Apr 2019 17:05:14 +0000 Subject: [issue36054] Way to detect CPU count inside docker container In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1554311114.1.0.37624601408.issue36054@roundup.psfhosted.org> Christian Heimes added the comment: The JVM parses cgroups information from the proc filesystem and evaluates CPU count from the cgroup cpu.shares and cpu.cfs. https://github.com/openjdk/jdk/blob/d5686b87f31d6c57ec6b3e5e9c85a04209dbac7a/src/hotspot/os/linux/os_linux.cpp#L5304-L5336 https://github.com/openjdk/jdk/blob/2d5137e403e16b694800b2ffe18c3640396b757e/src/hotspot/os/linux/osContainer_linux.cpp#L517-L591 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:33:54 2019 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Wed, 03 Apr 2019 17:33:54 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function In-Reply-To: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> Message-ID: <1554312834.08.0.931571305915.issue36518@roundup.psfhosted.org> Change by L?szl? Kiss Koll?r : ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:36:40 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 03 Apr 2019 17:36:40 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554313000.22.0.421841836277.issue36504@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12603 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:47:25 2019 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 03 Apr 2019 17:47:25 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554313645.39.0.182733102581.issue9883@roundup.psfhosted.org> Stefan Behnel added the comment: Seems like a reasonable request to me, even if it hasn't been touched or re-requested for years. Funny enough, DocumentFragment is currently documented as "not implemented" (as for Entity, Notation, CDATASection, CharacterData, DOMImplementation, DocumentType). I'll add a PR to clean those up. https://docs.python.org/3/library/xml.dom.minidom.html#minidom-and-the-dom-standard ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:47:12 2019 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 03 Apr 2019 17:47:12 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554313632.88.0.570069352379.issue9883@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +12604 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:52:22 2019 From: report at bugs.python.org (Victor Kung) Date: Wed, 03 Apr 2019 17:52:22 +0000 Subject: [issue36260] Cpython/Lib vulnerability found and request a patch submission In-Reply-To: <1552288618.75.0.236192047967.issue36260@roundup.psfhosted.org> Message-ID: <1554313942.44.0.208601890216.issue36260@roundup.psfhosted.org> Victor Kung added the comment: Hello Python community, I?m curious why the patch or pitfall prevention in ZipFile are not suggested. I have no idea if everyone read documentation in detail. It seems straightforward to add the methods in ZipFile with well documented rather than just warn in documentation. Any comment would be appreciated. Victor Kung ---------- nosy: +Victor Kung _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 13:55:31 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 03 Apr 2019 17:55:31 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554314131.99.0.640030326901.issue36504@roundup.psfhosted.org> miss-islington added the comment: New changeset 9c08eeb30ca0e551323467b62ae40e08e30839b3 by Miss Islington (bot) in branch '3.7': bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). (GH-12660) https://github.com/python/cpython/commit/9c08eeb30ca0e551323467b62ae40e08e30839b3 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:09:44 2019 From: report at bugs.python.org (Christian Heimes) Date: Wed, 03 Apr 2019 18:09:44 +0000 Subject: [issue36260] Cpython/Lib vulnerability found and request a patch submission In-Reply-To: <1552288618.75.0.236192047967.issue36260@roundup.psfhosted.org> Message-ID: <1554314984.69.0.632440529876.issue36260@roundup.psfhosted.org> Christian Heimes added the comment: The suggested approach is merely a heuristic that reduces the impact of a zipbomb. An attacker can circumvent the heuristic. In best case scenario, the approach just increases the cost factor for a successful DoS. For example an attacker may have to upload 10 larger zip files instead of one smaller zip file to fill up the disk space of a server. The correct approach is to always verify all data from untrusted sources. It's the 101 of application security. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:18:24 2019 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 03 Apr 2019 18:18:24 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554315504.14.0.926037856179.issue36504@roundup.psfhosted.org> Change by Zackery Spytz : ---------- pull_requests: +12605 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:23:33 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 03 Apr 2019 18:23:33 +0000 Subject: [issue36466] Adding a way to strip annotations from compiled bytecode In-Reply-To: <1553825507.66.0.407362572806.issue36466@roundup.psfhosted.org> Message-ID: <1554315813.8.0.768695533983.issue36466@roundup.psfhosted.org> Guido van Rossum added the comment: @cary are you planning on updating with the suggested/requested improvements to the patch? If not, let us know and we'll see if someone else is interested in taking over. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:29:41 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 03 Apr 2019 18:29:41 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function In-Reply-To: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> Message-ID: <1554316181.72.0.564061755041.issue36518@roundup.psfhosted.org> Guido van Rossum added the comment: This will require a PEP discussion before it can move forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:33:38 2019 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 03 Apr 2019 18:33:38 +0000 Subject: [issue12756] datetime.datetime.utcnow should return a UTC timestamp In-Reply-To: <1313477575.0.0.856648078618.issue12756@psf.upfronthosting.co.za> Message-ID: <1554316418.78.0.546993047747.issue12756@roundup.psfhosted.org> Paul Ganssle added the comment: @tin utcnow is a semi-deprecated way to get a naive datetime that represents the time in UTC. The preferred replacement is to do this: from datetime import datetime, timezone datetime.now(tz=timezone.utc) Note that you can replace "timezone.utc" with *any* time zone. The result will be a timezone-aware time zone representing the current time in the time zone passed to the function. I think because there is already a preferred solution available in the standard library, there is no need to add a parameter that would make `utcnow` return an aware datetime. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:35:09 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 03 Apr 2019 18:35:09 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554316509.34.0.782364790668.issue36440@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 513d142993bb8c13e6803727fa086e44eafc360f by Pablo Galindo in branch '3.7': [3.7] bpo-36440: include node names in ParserError messages, instead of numeric IDs (GH-12565) (GH-12671) https://github.com/python/cpython/commit/513d142993bb8c13e6803727fa086e44eafc360f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:35:34 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 03 Apr 2019 18:35:34 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554316534.41.0.655001293676.issue36440@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks A. Skrobov for your contribution! :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 14:59:04 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 03 Apr 2019 18:59:04 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554317944.9.0.242571007195.issue36440@roundup.psfhosted.org> Serhiy Storchaka added the comment: Why was this merged in 3.7? This is a new feature, not a bug fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 15:00:12 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 03 Apr 2019 19:00:12 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554318012.72.0.983711070213.issue36504@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset fd83a823a6f268dc97ee2bf7d8a1a88d948446e5 by Serhiy Storchaka (Zackery Spytz) in branch '2.7': bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). (GH-12660) (GH-12678) https://github.com/python/cpython/commit/fd83a823a6f268dc97ee2bf7d8a1a88d948446e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 15:08:46 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 03 Apr 2019 19:08:46 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554318526.45.0.815036392532.issue36440@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Issue #36256 (a real bug) was backported to 3.7 but also includes a similar improvement regarding node names in error messages. I can revert it from 3.7 if you consider it should not be there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 15:58:38 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Wed, 03 Apr 2019 19:58:38 +0000 Subject: [issue36479] Exit threads when interpreter is finalizing rather than runtime. In-Reply-To: <1553896742.19.0.478613119545.issue36479@roundup.psfhosted.org> Message-ID: <1554321518.81.0.448317633676.issue36479@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12606 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 16:15:36 2019 From: report at bugs.python.org (Daniel Black) Date: Wed, 03 Apr 2019 20:15:36 +0000 Subject: [issue36489] add filename_extension_map and/or content-types_map dict(s) to mimetypes In-Reply-To: <1553980712.92.0.44378409883.issue36489@roundup.psfhosted.org> Message-ID: <1554322536.66.0.825644475077.issue36489@roundup.psfhosted.org> Daniel Black added the comment: Thanks Karthikeyan. That is a bit cumbersome but gets it done. Any value seen in adding as proposed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 18:15:37 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 03 Apr 2019 22:15:37 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554329737.43.0.856941365072.issue6721@roundup.psfhosted.org> Gregory P. Smith added the comment: I'd start with faulthandler.register with all_threads=True and see if that gives you what you need. https://docs.python.org/3/library/faulthandler.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 19:15:00 2019 From: report at bugs.python.org (Jonathan Horn) Date: Wed, 03 Apr 2019 23:15:00 +0000 Subject: [issue36520] Email header folded incorrectly Message-ID: <1554333300.49.0.663084865399.issue36520@roundup.psfhosted.org> New submission from Jonathan Horn : I encountered a problem with replacing the 'Subject' header of an email. After serializing it again, the utf8 encoding was wrong. It seems to be occurring when folding the internal header objects. Example: >> email.policy.default.fold_binary('Subject', email.policy.default.header_store_parse('Subject', 'Hello W?rld! Hello W?rld! Hello W?rld! Hello W?rld!Hello W?rld!')[1]) Expected output: b'Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=\n Hello =?utf-8?q?W=C3=B6rld!Hello_W=C3=B6rld!?=\n' (or similar) Actual output: b'Subject: Hello =?utf-8?q?W=C3=B6rld!_Hello_W=C3=B6rld!_Hello_W=C3=B6rld!?=\n Hello =?utf-8?=?utf-8?q?q=3FW=3DC3=3DB6rld!Hello=3F=3D_W=C3=B6rld!?=\n' I'm running Python 3.7.3 on Arch Linux using Linux 5.0. ---------- components: email messages: 339419 nosy: Jonathan Horn, barry, r.david.murray priority: normal severity: normal status: open title: Email header folded incorrectly type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 20:53:24 2019 From: report at bugs.python.org (Rune Tynan) Date: Thu, 04 Apr 2019 00:53:24 +0000 Subject: [issue18697] Unify arguments names in Unicode object C API documentation In-Reply-To: <1376074126.58.0.40251146149.issue18697@psf.upfronthosting.co.za> Message-ID: <1554339204.73.0.9152543464.issue18697@roundup.psfhosted.org> Rune Tynan added the comment: Another inconsistency I've noticed is that the code sometimes refers to Py_ssize_t instances as a 'length' and sometimes as a 'size'. It seems like 'size' is the more common one in the docs, but the headers more often use 'length'. Which would be the better one to keep for the common case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 20:53:50 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 04 Apr 2019 00:53:50 +0000 Subject: [issue36466] Adding a way to strip annotations from compiled bytecode In-Reply-To: <1553825507.66.0.407362572806.issue36466@roundup.psfhosted.org> Message-ID: <1554339230.44.0.665135244095.issue36466@roundup.psfhosted.org> Raymond Hettinger added the comment: FYI, this partially breaks functools.singledispatch() and completely breaks both typing.NamedTuple() and dataclasses.dataclass(). A user may be able to avoid these in their own code, but I don't see how they can avoid it in third-party code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 21:04:15 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 04 Apr 2019 01:04:15 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects Message-ID: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> New submission from Raymond Hettinger : Function objects provide __doc__ as a documented writeable attribute. However, code objects also have the same information in co_consts[0]. When __doc__ is changed, the latter keeps a reference to the old string. Also, the disassembly shows that co_consts[0] is never used. Can we remove the entry in co_consts? It looks like a compilation artifact rather than something that we need or want. >>> def f(x): 'y' >>> f.__doc__ 'y' >>> f.__code__.co_consts[0] 'y' >>> f.__doc__ = 'z' >>> f.__code__.co_consts[0] 'y' >>> from dis import dis >>> dis(f) 2 0 LOAD_CONST 1 (None) 2 RETURN_VALUE ---------- components: Interpreter Core messages: 339422 nosy: rhettinger priority: normal severity: normal status: open title: Consider removing docstrings from co_consts in code objects type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 21:09:28 2019 From: report at bugs.python.org (bigbigliang) Date: Thu, 04 Apr 2019 01:09:28 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554283982.32.0.203779183062.issue36506@roundup.psfhosted.org> Message-ID: bigbigliang added the comment: Thank you for your answer. I am a student and very interested in python. I want to continue digging for Python bugs, but I am not good at this area. I want to keep looking for loopholes. from:bigbigliang Christian Heimes ?2019?4?3??? ??5:33??? > > Christian Heimes added the comment: > > Could you please do us a favor and contact MITRE to get the CVE number > revoked? Please CC security at python.org so we have a record of the emails. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 21:15:23 2019 From: report at bugs.python.org (Rune Tynan) Date: Thu, 04 Apr 2019 01:15:23 +0000 Subject: [issue18697] Unify arguments names in Unicode object C API documentation In-Reply-To: <1376074126.58.0.40251146149.issue18697@psf.upfronthosting.co.za> Message-ID: <1554340523.91.0.277279488574.issue18697@roundup.psfhosted.org> Change by Rune Tynan : ---------- keywords: +patch pull_requests: +12607 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 22:45:33 2019 From: report at bugs.python.org (Matt Houglum) Date: Thu, 04 Apr 2019 02:45:33 +0000 Subject: [issue36522] http/client.py does not print duplicate header values in debug Message-ID: <1554345933.73.0.102710422294.issue36522@roundup.psfhosted.org> New submission from Matt Houglum : This is a follow-up to https://bugs.python.org/issue33365. The fix for that issue (see https://github.com/python/cpython/pull/6611) added a statement to also print header values, but it does not account for the case where multiple values exist for the same header name, e.g. if my response contained these headers: x-goog-hash: crc32c=KAwGng== x-goog-hash: md5=eB5eJF1ptWaXm4bijSPyxw== then the debug output would print whichever of those values is returned from `self.headers.get("x-goog-hash")` for both prints: header: x-goog-hash: crc32c=KAwGng== header: x-goog-hash: crc32c=KAwGng== The iteration should instead be done using self.headers.items(), which will return the key and value pair to be printed. I'll send a GitHub PR shortly. ---------- components: Library (Lib) messages: 339424 nosy: Matt Houglum priority: normal severity: normal status: open title: http/client.py does not print duplicate header values in debug versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 22:51:46 2019 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 04 Apr 2019 02:51:46 +0000 Subject: [issue36466] Adding a way to strip annotations from compiled bytecode In-Reply-To: <1553825507.66.0.407362572806.issue36466@roundup.psfhosted.org> Message-ID: <1554346306.3.0.946706763819.issue36466@roundup.psfhosted.org> Guido van Rossum added the comment: One way would be to compile only their own source to bytecode using this flag. But I agree it doesn't look very viable in general. I'll talk to Cary offline. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 22:58:06 2019 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 04 Apr 2019 02:58:06 +0000 Subject: [issue36466] Adding a way to strip annotations from compiled bytecode In-Reply-To: <1554339230.44.0.665135244095.issue36466@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: (I just found out that Cary is on vacation until 4/17.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 23:37:00 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 03:37:00 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1554349020.61.0.202538454963.issue36521@roundup.psfhosted.org> Serhiy Storchaka added the comment: co_consts[0] is used for setting the initial value of __doc__. See PyFunction_NewWithQualName(). consts = ((PyCodeObject *)code)->co_consts; if (PyTuple_Size(consts) >= 1) { doc = PyTuple_GetItem(consts, 0); if (!PyUnicode_Check(doc)) doc = Py_None; } else doc = Py_None; Py_INCREF(doc); op->func_doc = doc; ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 23:41:27 2019 From: report at bugs.python.org (Roundup Robot) Date: Thu, 04 Apr 2019 03:41:27 +0000 Subject: [issue36522] http/client.py does not print duplicate header values in debug In-Reply-To: <1554345933.73.0.102710422294.issue36522@roundup.psfhosted.org> Message-ID: <1554349287.13.0.0969911703173.issue36522@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12608 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 23:42:50 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 04 Apr 2019 03:42:50 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1554349370.86.0.344286732745.issue36216@roundup.psfhosted.org> Steve Dower added the comment: You need a "u" prefix on some of your strings or they're probably being immediately decomposed. The result of urlsplit should be unicode on Python 2 for a Unicode input, and yours are not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 23:43:22 2019 From: report at bugs.python.org (Manjusaka) Date: Thu, 04 Apr 2019 03:43:22 +0000 Subject: [issue36054] Way to detect CPU count inside docker container In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1554349402.23.0.702627251664.issue36054@roundup.psfhosted.org> Manjusaka added the comment: Yes, not only but also support get real memory limit. look at https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 3 23:47:14 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 04 Apr 2019 03:47:14 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1554349634.72.0.835422244929.issue36521@roundup.psfhosted.org> Raymond Hettinger added the comment: > co_consts[0] is used for setting the initial value of __doc__. Why is __doc__ set this way, but __name__ is set directly on the function object? Setting __doc__ from the code object seems like an odd implementation hack that puts the responsibility in the wrong place and that leaves a dangling reference when __doc__ is updated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 00:01:00 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 04 Apr 2019 04:01:00 +0000 Subject: [issue36489] add filename_extension_map and/or content-types_map dict(s) to mimetypes In-Reply-To: <1553980712.92.0.44378409883.issue36489@roundup.psfhosted.org> Message-ID: <1554350460.98.0.734220481255.issue36489@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The docs state the tuple contains two dictionaries depending on how common the type is. I guess you want a merged dict to be provided as an API? I will leave it to @r.david.murray on that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 00:12:41 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 04 Apr 2019 04:12:41 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1554351161.49.0.595205088846.issue36521@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 00:36:52 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 04:36:52 +0000 Subject: [issue36522] http/client.py does not print duplicate header values in debug In-Reply-To: <1554345933.73.0.102710422294.issue36522@roundup.psfhosted.org> Message-ID: <1554352612.22.0.450609772509.issue36522@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 461c416dd78a98f2bba7f323af8c9738e060b6f2 by Serhiy Storchaka (Matt Houglum) in branch 'master': bpo-36522: Print all values for headers with multiple values. (GH-12681) https://github.com/python/cpython/commit/461c416dd78a98f2bba7f323af8c9738e060b6f2 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 00:37:25 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 04 Apr 2019 04:37:25 +0000 Subject: [issue36522] http/client.py does not print duplicate header values in debug In-Reply-To: <1554345933.73.0.102710422294.issue36522@roundup.psfhosted.org> Message-ID: <1554352645.35.0.513553007814.issue36522@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12610 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 01:31:15 2019 From: report at bugs.python.org (Matej Cepl) Date: Thu, 04 Apr 2019 05:31:15 +0000 Subject: [issue36216] CVE-2019-9636: urlsplit does not handle NFKC normalization In-Reply-To: <1551893840.49.0.433864450493.issue36216@roundup.psfhosted.org> Message-ID: <1554355875.85.0.724074881889.issue36216@roundup.psfhosted.org> Matej Cepl added the comment: You are right. Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 04:03:57 2019 From: report at bugs.python.org (Marcin Niemira) Date: Thu, 04 Apr 2019 08:03:57 +0000 Subject: [issue36523] missing docs for IOBase writelines Message-ID: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> New submission from Marcin Niemira : Hey, There is a missing function doc in `io.IOBase` ```python import os help(io.IOBase.writelines) ``` produces output like: ``` Help on method_descriptor: writelines(self, lines, /) ``` I'll be happy to provide PR for this issue. Cheers, Marcin ---------- assignee: docs at python components: Documentation messages: 339434 nosy: Marcin Niemira, docs at python priority: normal severity: normal status: open title: missing docs for IOBase writelines versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 04:13:01 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 04 Apr 2019 08:13:01 +0000 Subject: [issue36523] missing docs for IOBase writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1554365581.33.0.521157813462.issue36523@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 04:17:29 2019 From: report at bugs.python.org (Marcin Niemira) Date: Thu, 04 Apr 2019 08:17:29 +0000 Subject: [issue36523] missing docs for IOBase writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1554365849.4.0.216958892607.issue36523@roundup.psfhosted.org> Change by Marcin Niemira : ---------- keywords: +patch pull_requests: +12611 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 04:26:04 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 08:26:04 +0000 Subject: [issue36522] http/client.py does not print duplicate header values in debug In-Reply-To: <1554345933.73.0.102710422294.issue36522@roundup.psfhosted.org> Message-ID: <1554366364.11.0.670007289338.issue36522@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6f9cd142a20d0d2a5825a9db376ce0ddf1933694 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7': bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682) https://github.com/python/cpython/commit/6f9cd142a20d0d2a5825a9db376ce0ddf1933694 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 04:27:34 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 08:27:34 +0000 Subject: [issue36522] http/client.py does not print duplicate header values in debug In-Reply-To: <1554345933.73.0.102710422294.issue36522@roundup.psfhosted.org> Message-ID: <1554366454.37.0.551803342842.issue36522@roundup.psfhosted.org> Serhiy Storchaka added the comment: 3.6 take only security bugs fixes now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 04:40:34 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 08:40:34 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1554367234.76.0.589006891219.issue36521@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it is for historical reasons. Currently statements consisting of a constant expression are not compiled to a bytecode and do not add a value to co_consts. But when this optimization was not yet added, the first element of co_consts with a docstring was a docstring. So why add co_doc if the docstring is already available? This can be changed, but this is a breaking change, and what we will got instead? Function's __name__ is set from code object's co_name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 05:16:32 2019 From: report at bugs.python.org (Petter S) Date: Thu, 04 Apr 2019 09:16:32 +0000 Subject: [issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error In-Reply-To: <1470313993.65.0.630797703267.issue27682@psf.upfronthosting.co.za> Message-ID: <1554369392.52.0.150495508522.issue27682@roundup.psfhosted.org> Petter S added the comment: The pull request solves this problem, but the discussion over there is really slow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 05:37:14 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Thu, 04 Apr 2019 09:37:14 +0000 Subject: [issue36054] Way to detect CPU count inside docker container In-Reply-To: <1554349402.23.0.702627251664.issue36054@roundup.psfhosted.org> Message-ID: <20190404093710.GA16697@xps> St?phane Wirtel added the comment: >Yes, not only but also support get real memory limit. > >look at https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits Yep, but in this case, you have to create an other issue for the memory limit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 06:00:05 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 10:00:05 +0000 Subject: [issue16954] Add docstrings for ElementTree module In-Reply-To: <1358090813.12.0.93631082121.issue16954@psf.upfronthosting.co.za> Message-ID: <1554372005.33.0.113911451203.issue16954@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- stage: patch review -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 06:31:15 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 04 Apr 2019 10:31:15 +0000 Subject: [issue36347] Renaming the constants for the .flags of PyMemberDef In-Reply-To: <1552920150.75.0.888906424388.issue36347@roundup.psfhosted.org> Message-ID: <1554373875.3.0.669481025625.issue36347@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- pull_requests: +12612 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 06:34:55 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Thu, 04 Apr 2019 10:34:55 +0000 Subject: [issue36347] Renaming the constants for the .flags of PyMemberDef In-Reply-To: <1554373875.31.0.500838609856.issue36347@roundup.psfhosted.org> Message-ID: <20190404103451.GA27863@xps> St?phane Wirtel added the comment: For that, where did you see the macro was not used? maybe by an external library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 08:25:01 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 04 Apr 2019 12:25:01 +0000 Subject: [issue26415] Excessive peak memory consumption by the Python parser In-Reply-To: <1456182380.09.0.81920177296.issue26415@psf.upfronthosting.co.za> Message-ID: <1554380701.01.0.172419118291.issue26415@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 08:28:43 2019 From: report at bugs.python.org (Rocco Santoro) Date: Thu, 04 Apr 2019 12:28:43 +0000 Subject: [issue36524] identity operator Message-ID: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> New submission from Rocco Santoro : Hi all Why the identity operator and '==' are both applied to the type (see above)? Is it not convenient to distinguish them? I mean the identity operator applied to the type and '==' applied to the outcome. Thanks for the attention Best regards Rocco Santoro Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import math >>> x = math.log(10000000) >>> y = math.log(10) >>> print(x/y) == x/y 7.0 False >>> print(math.log(10000000)/math.log(10)) == math.log(10000000)/math.log(10) 7.0 False >>> x = math.sin(32) >>> y = math.cos(41) >>> print(y/x) == y/x -1.7905177807148493 False >>> x = math.pi >>> y = math.tau >>> x/y == print(x/y) 0.5 False >>> x = 153 >>> y = 245 >>> print(x/y) == x/y 0.6244897959183674 False >>> print(x+y) == x + y 398 False >>> print(x*y) == x*y 37485 False >>> s1 = 'Hello, ' >>> s2 = 'how are you?' >>> print(s1 + s2) == s1 + s2 Hello, how are you? False >>> print(s1 + s2) is s1 + s2 Hello, how are you? False >>> type(print(s1 + s2)) Hello, how are you? >>> type(s1 + s2) >>> type(print(y/x)) 1.6013071895424837 >>> type(x/y) ---------- assignee: terry.reedy components: IDLE messages: 339441 nosy: roccosan, terry.reedy priority: normal severity: normal status: open title: identity operator type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 08:35:16 2019 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 04 Apr 2019 12:35:16 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554381316.64.0.749112811009.issue36524@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not sure what you're asking here. You're comparing the result of the print function to a value. Print returns None, so it doesn't compare equal to any of the values you're comparing it to. To see what's happening, try: >>> print(None) == None None True But really, your problem is probably a misunderstanding of the return value of the print function. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 08:37:01 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 04 Apr 2019 12:37:01 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554381421.86.0.614868861331.issue36524@roundup.psfhosted.org> SilentGhost added the comment: You seem to be confused by the fact that print function returns None and therefore all the comparisons you're making return False. There is not type vs "outcome" difference in your code sample. ---------- assignee: terry.reedy -> nosy: +SilentGhost -eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 09:08:32 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 04 Apr 2019 13:08:32 +0000 Subject: [issue36525] Deprecate instance method Message-ID: <1554383312.87.0.791083072255.issue36525@roundup.psfhosted.org> New submission from Jeroen Demeyer : The "instance method" class is not used anywhere and there are no obvious use cases. We should just deprecate it to simplify Python. See discussion at https://mail.python.org/pipermail/python-dev/2019-April/156975.html ---------- messages: 339444 nosy: christian.heimes, jdemeyer priority: normal severity: normal status: open title: Deprecate instance method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 09:08:50 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 04 Apr 2019 13:08:50 +0000 Subject: [issue1587] instancemethod wrapper for PyCFunctions In-Reply-To: <1197376819.43.0.564314385803.issue1587@psf.upfronthosting.co.za> Message-ID: <1554383330.98.0.805346602804.issue1587@roundup.psfhosted.org> Jeroen Demeyer added the comment: > I'm tempted to call YAGNI on this. Indeed. See https://bugs.python.org/issue36525 ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 09:12:45 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 04 Apr 2019 13:12:45 +0000 Subject: [issue36525] Deprecate instancemethod In-Reply-To: <1554383312.87.0.791083072255.issue36525@roundup.psfhosted.org> Message-ID: <1554383565.31.0.699183398389.issue36525@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- title: Deprecate instance method -> Deprecate instancemethod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 09:42:59 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 04 Apr 2019 13:42:59 +0000 Subject: [issue36525] Deprecate instancemethod In-Reply-To: <1554383312.87.0.791083072255.issue36525@roundup.psfhosted.org> Message-ID: <1554385379.26.0.2615069264.issue36525@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +12613 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 10:44:58 2019 From: report at bugs.python.org (Alex Chandel) Date: Thu, 04 Apr 2019 14:44:58 +0000 Subject: [issue29883] asyncio: Windows Proactor Event Loop UDP Support In-Reply-To: <1490210881.18.0.553215827239.issue29883@psf.upfronthosting.co.za> Message-ID: <1554389098.36.0.0052082686204.issue29883@roundup.psfhosted.org> Alex Chandel added the comment: Could this be merged? UDP and pipes are critical for non-trivial asyncio programs on Windows, and this should be merged before the 3.8 feature window closes. ---------- nosy: +Alex Chandel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:03:00 2019 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 04 Apr 2019 15:03:00 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1554390180.5.0.250828143943.issue9194@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12614 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:11:56 2019 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 04 Apr 2019 15:11:56 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1554390716.16.0.730812671837.issue9194@roundup.psfhosted.org> Zackery Spytz added the comment: I've created a PR for this issue. ---------- nosy: +ZackerySpytz, eryksun versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:12:11 2019 From: report at bugs.python.org (Ahmed Soliman) Date: Thu, 04 Apr 2019 15:12:11 +0000 Subject: [issue36526] python crash when loading some .pyc file Message-ID: <1554390731.41.0.407793699332.issue36526@roundup.psfhosted.org> New submission from Ahmed Soliman : I was fuzzing python pyc and I got this segmentation fault ``` ==25016==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000007d147f bp 0x7ffc6875cfc0 sp 0x7ffc6875c7e0 T0) ==25016==The signal is caused by a WRITE memory access. ==25016==Hint: address points to the zero page. #0 0x7d147e in _Py_INCREF /home/cpython/./Include/object.h:453:18 #1 0x7d147e in _PyEval_EvalFrameDefault /home/cpython/Python/ceval.c:1186 #2 0x7e38bc in PyEval_EvalFrameEx /home/cpython/Python/ceval.c:625:12 #3 0x7e38bc in _PyEval_EvalCodeWithName /home/cpython/Python/ceval.c:4036 #4 0x7b72d3 in PyEval_EvalCodeEx /home/cpython/Python/ceval.c:4065:12 #5 0x7b72d3 in PyEval_EvalCode /home/cpython/Python/ceval.c:602 #6 0x911643 in run_eval_code_obj /home/cpython/Python/pythonrun.c:1047:9 #7 0x911643 in run_pyc_file /home/cpython/Python/pythonrun.c:1100 #8 0x911643 in PyRun_SimpleFileExFlags /home/cpython/Python/pythonrun.c:420 #9 0x9102cb in PyRun_AnyFileExFlags /home/cpython/Python/pythonrun.c:85:16 #10 0x517df8 in pymain_run_file /home/cpython/Modules/main.c:346:15 #11 0x517df8 in pymain_run_python /home/cpython/Modules/main.c:511 #12 0x517df8 in _Py_RunMain /home/cpython/Modules/main.c:583 #13 0x51901a in pymain_main /home/cpython/Modules/main.c:612:12 #14 0x5193e3 in _Py_UnixMain /home/cpython/Modules/main.c:636:12 #15 0x7fd06244375a in __libc_start_main (/lib64/libc.so.6+0x2375a) #16 0x437919 in _start (/home/cpython/python+0x437919) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/cpython/./Include/object.h:453:18 in _Py_INCREF ==25016==ABORTING ``` Python version Python 3.8.0a3+ (heads/master:cb0748d393, Apr 4 2019, 16:40:18) [Clang 8.0.0 (tags/RELEASE_800/final)] on linux ---------- files: id:000147,sig:11,src:000000,op:arith8,pos:53,val:-23 messages: 339448 nosy: Ahmed Soliman priority: normal severity: normal status: open title: python crash when loading some .pyc file versions: Python 3.8 Added file: https://bugs.python.org/file48244/id:000147,sig:11,src:000000,op:arith8,pos:53,val:-23 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:15:32 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 04 Apr 2019 15:15:32 +0000 Subject: [issue36526] python crash when loading some .pyc file In-Reply-To: <1554390731.41.0.407793699332.issue36526@roundup.psfhosted.org> Message-ID: <1554390932.77.0.837573591907.issue36526@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Interpreter Core nosy: +serhiy.storchaka type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:45:14 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 04 Apr 2019 15:45:14 +0000 Subject: [issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty In-Reply-To: <1534189001.92.0.56676864532.issue34396@psf.upfronthosting.co.za> Message-ID: <1554392714.22.0.907222206195.issue34396@roundup.psfhosted.org> Jeroen Demeyer added the comment: > Amusingly, this is because of an old hack to make directly calling somedict.__getitem__ fast: https://github.com/python/cpython/commit/8f5cdaa784f555149adf5e94fd2e989f99d6b1db But what's the use case of making somedict.__getitem__(x) fast? One should just write somedict[x] instead. If PEP 580 or PEP 590 is accepted, it should be easy to simply make wrapper descriptors such as somedict.__getitem__ faster, removing the need for METH_COEXIST. ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:54:05 2019 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 04 Apr 2019 15:54:05 +0000 Subject: [issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty In-Reply-To: <1534189001.92.0.56676864532.issue34396@psf.upfronthosting.co.za> Message-ID: <1554393245.21.0.742372086432.issue34396@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 11:56:23 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 15:56:23 +0000 Subject: [issue36526] python crash when loading some .pyc file In-Reply-To: <1554390731.41.0.407793699332.issue36526@roundup.psfhosted.org> Message-ID: <1554393383.44.0.977656762589.issue36526@roundup.psfhosted.org> Serhiy Storchaka added the comment: Using random binary data instead of a .pyc file is an undefined behavior. .pyc file is a cache of the .py file. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 12:04:24 2019 From: report at bugs.python.org (cagney) Date: Thu, 04 Apr 2019 16:04:24 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1554393864.5.0.129124917135.issue35866@roundup.psfhosted.org> cagney added the comment: More info from adding a faulthandler ... 15 def f(): 16 import ctypes 17 18 for i in range(0,50): 19 sys.stdout.write("\r%d" % i) 20 sys.stdout.flush() 21 signal.alarm(60*2) 22 for j in range(0,1000): 23 with concurrent.futures.ProcessPoolExecutor() as executor: 24 ftr = executor.submit(f) 25 ftr.result() Thread 0x00007f1ce7fff700 (most recent call first): File "/home/python/v3.7.3/lib/python3.7/threading.py", line 296 in wait File "/home/python/v3.7.3/lib/python3.7/multiprocessing/queues.py", line 224 in _feed File "/home/python/v3.7.3/lib/python3.7/threading.py", line 865 in run File "/home/python/v3.7.3/lib/python3.7/threading.py", line 917 in _bootstrap_inner File "/home/python/v3.7.3/lib/python3.7/threading.py", line 885 in _bootstrap Thread 0x00007f1cec917700 (most recent call first): File "/home/python/v3.7.3/lib/python3.7/selectors.py", line 415 in select File "/home/python/v3.7.3/lib/python3.7/multiprocessing/connection.py", line 920 in wait File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 354 in _queue_management_worker File "/home/python/v3.7.3/lib/python3.7/threading.py", line 865 in run File "/home/python/v3.7.3/lib/python3.7/threading.py", line 917 in _bootstrap_inner File "/home/python/v3.7.3/lib/python3.7/threading.py", line 885 in _bootstrap Current thread 0x00007f1cfd9486c0 (most recent call first): File "/home/python/v3.7.3/lib/python3.7/threading.py", line 296 in wait File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/_base.py", line 427 in result File "cf-deadlock.py", line 25 in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 12:08:41 2019 From: report at bugs.python.org (Dmitry Marakasov) Date: Thu, 04 Apr 2019 16:08:41 +0000 Subject: [issue36527] unused parameter warnings in Include/object.h (affecting building third party code) Message-ID: <1554394121.78.0.720691487188.issue36527@roundup.psfhosted.org> New submission from Dmitry Marakasov : Python 3.8 and nightly introduces unused (in some cases) parameters in object.h header. This makes compilation of third party code which includes the header fail if it's built with -Werror. Build log excerpt: --- g++ -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -UNDEBUG -Wall -Wextra -Werror -fPIC -I/usr/include/yajl -I/opt/python/3.8-dev/include/python3.8m -c src/construct_handlers.cc -o build/temp.linux-x86_64-3.8/src/construct_handlers.o -std=c++11 -DJSONSLICER_VERSION="0.1.4" -DUSE_BYTES_INTERNALLY -fno-exceptions -fno-rtti In file included from /opt/python/3.8-dev/include/python3.8m/pytime.h:6:0, from /opt/python/3.8-dev/include/python3.8m/Python.h:85, from src/pyobjlist.hh:26, from src/jsonslicer.hh:26, from src/construct_handlers.hh:26, from src/construct_handlers.cc:23: /opt/python/3.8-dev/include/python3.8m/object.h:441:50: error: unused parameter ?op? [-Werror=unused-parameter] static inline void _Py_ForgetReference(PyObject *op) ^ /opt/python/3.8-dev/include/python3.8m/object.h:458:43: error: unused parameter ?filename? [-Werror=unused-parameter] static inline void _Py_DECREF(const char *filename, int lineno, ^ /opt/python/3.8-dev/include/python3.8m/object.h:458:57: error: unused parameter ?lineno? [-Werror=unused-parameter] static inline void _Py_DECREF(const char *filename, int lineno, ^ --- Full build log: https://travis-ci.org/AMDmi3/jsonslicer/jobs/515771366 Possible solutions: - Add (void)param; to silence the warning as it's already done in Include/internal/pycore_atomic.h - Make distutils list python include directory with -isystem instead of -I. This way, python include won't generate warnings for third party code. ---------- components: Build messages: 339452 nosy: amdmi3 priority: normal severity: normal status: open title: unused parameter warnings in Include/object.h (affecting building third party code) type: compile error versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 12:13:40 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 04 Apr 2019 16:13:40 +0000 Subject: [issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty In-Reply-To: <1534189001.92.0.56676864532.issue34396@psf.upfronthosting.co.za> Message-ID: <1554394420.72.0.350413588079.issue34396@roundup.psfhosted.org> Serhiy Storchaka added the comment: > But what's the use case of making somedict.__getitem__(x) fast? One should just write somedict[x] instead. Using them in itertools functions. somedict.__getitem__ is faster that lambda: somedict[x]. As for map() and filter(), comprehensions are almost as fast as map() and filter() with somedict.__getitem__ and are more readable. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 12:15:00 2019 From: report at bugs.python.org (Roundup Robot) Date: Thu, 04 Apr 2019 16:15:00 +0000 Subject: [issue36527] unused parameter warnings in Include/object.h (affecting building third party code) In-Reply-To: <1554394121.78.0.720691487188.issue36527@roundup.psfhosted.org> Message-ID: <1554394500.55.0.36117707297.issue36527@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12615 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 13:11:09 2019 From: report at bugs.python.org (cagney) Date: Thu, 04 Apr 2019 17:11:09 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554397869.1.0.168746766878.issue6721@roundup.psfhosted.org> cagney added the comment: > acquiring locks before fork in the thread doing the forking and releasing them afterwards is always the safe thing to do. It's also an easy way to cause a deadlock: - register_at_fork() et.al. will cause per-logger locks to be acquired before the global lock (this isn't immediately obvious from the code) If a thread were to grab its logging lock before the global lock then it would deadlock. I'm guessing this isn't allowed - however I didn't see any comments to this effect? Can I suggest documenting this, and also merging the two callbacks so that the ordering of these two acquires is made explicit. - the per-logger locks are acquired in a random order If a thread were to acquire two per-logger locks in a different order then things would deadlock. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 13:11:19 2019 From: report at bugs.python.org (David Chin) Date: Thu, 04 Apr 2019 17:11:19 +0000 Subject: [issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support In-Reply-To: <1530609211.5.0.56676864532.issue34028@psf.upfronthosting.co.za> Message-ID: <1554397879.2.0.0970169225713.issue34028@roundup.psfhosted.org> David Chin added the comment: OS: RHEL 6.8 I installed OpenSSL 1.1.1b from source into /usr/local. Because it's RHEL, the libs are in /usr/local/lib64 (as set up by default with the OpenSSL "make install") which the configure script does not seem to know about. My workaround: before running configure for Python, set the environment variable: LDFLAGS="-L/usr/local/lib -L/usr/local/lib64 -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/local/lib64" Once that is set, configure manages to find the proper libssl: checking for openssl/ssl.h in /usr/local... yes checking whether compiling and linking against OpenSSL works... yes checking for X509_VERIFY_PARAM_set1_host in libssl... yes ---------- nosy: +hairygristle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 13:21:29 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 04 Apr 2019 17:21:29 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554398489.05.0.00968989930134.issue36524@roundup.psfhosted.org> Terry J. Reedy added the comment: Rocco, please ask questions about Python on python-list or places like stackoverflow.com. 1. If python behavior puzzles you, the chance that it is a python bug is well less than 1 in 1000. 2. The answer you get will be much more visible to others who have similar questions. Also, when you use the IDLE IDE to execute your python code, IDLE submits your code to a running python.exe process and displays the answer received from that process. The answer is nearly always the same as when you submit the same code to python yourself. 'IDLE' is for questions about IDLE behavior rather than Python behavior. ---------- components: -IDLE _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 13:29:02 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 04 Apr 2019 17:29:02 +0000 Subject: [issue36528] Remove duplicate tests in Lib/tests/re_tests.py Message-ID: <1554398942.85.0.973114316102.issue36528@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Currently Lib/tests/re_tests.py has duplicate elements in the tests list variable. This is a followup on https://github.com/python/cpython/pull/12662 where there seems to be around 100 elements that are duplicates in the list. This seems to have been due to some merge commits made long time ago. Sample duplicates : https://github.com/python/cpython/pull/12662#issuecomment-479852101 ---------- components: Tests messages: 339457 nosy: serhiy.storchaka, xtreak priority: normal severity: normal status: open title: Remove duplicate tests in Lib/tests/re_tests.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 13:29:17 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 04 Apr 2019 17:29:17 +0000 Subject: [issue36528] Remove duplicate tests in Lib/tests/re_tests.py In-Reply-To: <1554398942.85.0.973114316102.issue36528@roundup.psfhosted.org> Message-ID: <1554398957.71.0.847241942973.issue36528@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 13:35:46 2019 From: report at bugs.python.org (cagney) Date: Thu, 04 Apr 2019 17:35:46 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554399346.05.0.115658735961.issue6721@roundup.psfhosted.org> cagney added the comment: Below is a backtrace from the deadlock. It happens because the logging code is trying to acquire two per-logger locks; and in an order different to the random order used by the fork() handler. The code in question has a custom class DebugHandler(logging.Handler). The default logging.Handler.handle() method grabs its lock and calls .emit() vis: if rv: self.acquire() try: self.emit(record) finally: self.release() the custom .emit() then sends the record to a sub-logger stream vis: def emit(self, record): for stream_handler in self.stream_handlers: stream_handler.emit(record) if _DEBUG_STREAM: _DEBUG_STREAM.emit(record) and one of these emit() functions calls flush() which tries to acquire a further lock. Thread 0x00007f976b7fe700 (most recent call first): File "/usr/lib64/python3.7/logging/__init__.py", line 854 in acquire File "/usr/lib64/python3.7/logging/__init__.py", line 1015 in flush def flush(self): """ Flushes the stream. """ self.acquire() <---- try: if self.stream and hasattr(self.stream, "flush"): self.stream.flush() finally: self.release() File "/usr/lib64/python3.7/logging/__init__.py", line 1038 in emit self.flush() <---- File "/home/build/libreswan-web/master/testing/utils/fab/logutil.py", line 163 in emit def emit(self, record): for stream_handler in self.stream_handlers: stream_handler.emit(record) <--- if _DEBUG_STREAM: _DEBUG_STREAM.emit(record) File "/usr/lib64/python3.7/logging/__init__.py", line 905 in handle def handle(self, record): """ Conditionally emit the specified logging record. Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the record for emission. """ rv = self.filter(record) if rv: self.acquire() try: self.emit(record) <--- finally: self.release() return rv File "/usr/lib64/python3.7/logging/__init__.py", line 1591 in callHandlers hdlr.handle(record) File "/usr/lib64/python3.7/logging/__init__.py", line 1529 in handle self.callHandlers(record) File "/usr/lib64/python3.7/logging/__init__.py", line 1519 in _log self.handle(record) File "/usr/lib64/python3.7/logging/__init__.py", line 1449 in log self._log(level, msg, args, **kwargs) File "/usr/lib64/python3.7/logging/__init__.py", line 1768 in log self.logger.log(level, msg, *args, **kwargs) File "/usr/lib64/python3.7/logging/__init__.py", line 1724 in debug self.log(DEBUG, msg, *args, **kwargs) File "/home/build/libreswan-web/master/testing/utils/fab/shell.py", line 110 in write self.logger.debug(self.message, ascii(text)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 14:01:34 2019 From: report at bugs.python.org (A. Jesse Jiryu Davis) Date: Thu, 04 Apr 2019 18:01:34 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554400894.97.0.58962364691.issue6721@roundup.psfhosted.org> Change by A. Jesse Jiryu Davis : ---------- nosy: -emptysquare _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 14:25:29 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 04 Apr 2019 18:25:29 +0000 Subject: [issue35512] patch.dict resolves in_dict eagerly (should be late resolved) In-Reply-To: <1544993007.41.0.788709270274.issue35512@psf.upfronthosting.co.za> Message-ID: <1554402329.11.0.225594617215.issue35512@roundup.psfhosted.org> Jason R. Coombs added the comment: Confirmed the fix. Thank you very much! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 14:34:11 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 04 Apr 2019 18:34:11 +0000 Subject: [issue36528] Remove duplicate tests in Lib/tests/re_tests.py In-Reply-To: <1554398942.85.0.973114316102.issue36528@roundup.psfhosted.org> Message-ID: <1554402851.35.0.770661263671.issue36528@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +12616 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 15:57:28 2019 From: report at bugs.python.org (Ilya Kazakevich) Date: Thu, 04 Apr 2019 19:57:28 +0000 Subject: [issue36529] Python from WindowsStore: can't install package using "-m pip" Message-ID: <1554407848.88.0.523569372633.issue36529@roundup.psfhosted.org> New submission from Ilya Kazakevich : No packages could be installed with "-m pip" because of "Access Denied". It seems that it tries to install package to "site-packages' instead of "local-packages". However, "pip.exe" works. Does it mean "pip.exe" is patched somehow, but not python itself? c:\>"c:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\python" -m pip install flask Collecting flask Using cached https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl ... Installing collected packages: flask Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\flask' Consider using the `--user` option or check the permissions. ---- But: c:\>"c:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\pip" install flask Collecting flask Using cached https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl Installing collected packages: flask The script flask.exe is installed in 'C:\Users\SomeUser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed flask-1.0.2 ---------- components: Installation messages: 339460 nosy: Ilya Kazakevich priority: normal severity: normal status: open title: Python from WindowsStore: can't install package using "-m pip" type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 16:23:15 2019 From: report at bugs.python.org (Rocco Santoro) Date: Thu, 04 Apr 2019 20:23:15 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554409395.57.0.101309275616.issue36524@roundup.psfhosted.org> Rocco Santoro added the comment: Thanks you very much for the explanations. I am sorry for bothering you, actually my question concerned the use of identity operator. I suggest that '==' means equal not identity. Therefore, it concerns the instance not the ontology and makes a comparison between the values not the types. In my modest opinion this is a bug. Anyway, you have explain very well the class None and the role of print as function in Python. My little remark is that a communication act should not change the type of object that shows. Instead it transforms the object in Noneclass. This is a peculiar of Python. Warm regards. Rocco ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 16:32:38 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 04 Apr 2019 20:32:38 +0000 Subject: [issue36525] Deprecate instancemethod In-Reply-To: <1554383312.87.0.791083072255.issue36525@roundup.psfhosted.org> Message-ID: <1554409958.7.0.958073645566.issue36525@roundup.psfhosted.org> Josh Rosenberg added the comment: Actually, there is a use case, and it's one I've been intermittently trying to replicate ever since the functionality vanished in the Python 2 to 3 transition (or so I thought). The use case is taking an existing built-in function (as in a CPython function defined in C, and therefore not naturally obeying the descriptor protocol) and converting it to the equivalent of an unbound method for assignment to a class. In Python 2, a trick I'd use to make int-like classes work identically on Python 2 and Python 3 was to define it like so: import types import sys class MyInt: def __index__(self): return SOMEINTEGER if sys.version_info[0] == 2: from future_builtins import hex, oct MyInt.__hex__ = types.MethodType(hex, None, MyInt) MyInt.__oct__ = types.MethodType(oct, None, MyInt) del hex, oct Essentially it took the built-in methods from future_builtins that used __index__ and converted them to unbound methods of MyInt so even people using my code with the non-future hex/oct would get the correct behavior (the old hex would call __hex__, which was actually the future hex, and would therefore delegate to __index__). And it did it at C speed; no additional bytecode was executed whether you used the class with old or future hex. That specific use case doesn't actually apply to hex/oct anymore (conveniently, it was only needed when on the version that supported it), but it's a general purpose tool. In Python 3, types.MethodType lost the final argument (because now Python level code only had functions and bound methods, no in-between concept of unbound methods). But this removed some functionality I liked; in particular I'd liked the idea of using operator.attrgetter to define rich comparisons and hashing in terms of a key method (__key__ has been proposed before for this purpose IIRC) implemented in C (to reduce overhead from delegating all of those methods to yet another method). Now that you've pointed out this API to me, I could actually do that. Not prettily (since it involves using ctypes to gain access), but it's possible. If exposed at the Python layer (or in the case of my testing, manually loaded using ctypes), I can implement __key__ on a class with: class Foo: # Compare based on attributes x, y and z __key__ = PyInstanceMethod_New(operator.attrgetter('x', 'y', 'z')) def __eq__(self, other): if not isinstance(other, Foo): return NotImplemented return self.__key__() == other.__key__() def __hash__(self): return hash(self.__key__()) and if I have a Foo instance, instance.__key__() just works (and slightly faster than def __key__(self): return self.x, self.y, self.z would), and all the random comparison and hashing stuff can be implemented in terms of it (I'd likely be writing a C accelerated decorator for use in contexts like functools.total_ordering that depended solely on the existence of a __key__, so comparisons and hashing and the like could all be implemented without ending up back in bytecode, which has some performance advantages for large sorts and dedupes, and lets you write otherwise Python level classes that benefit from GIL thread safety). The only way I've been able to mimic this before was wrapping in functools.partialmethod, but that's implemented in Python (so no CPython thread safety or reduced bytecode advantages) and supports a ton of other features that make it *much* slower for this use case. In local microbenchmarks, Foo using PyInstanceMethod_New took 227 ns to call foo.__key__(), using the "obvious" approach took 238 ns, and using partialmethod took 3.1 us, over 10x longer. An in-between approach of: class Foo: _getkey = attrgetter('x', 'y', 'z') def __key__(self): return self._getkey(self) is okay, taking 317 ns, but adding additional layering, requiring the separate caching of the attrgetter, etc. Yes, it's kind of a fiddly thing; all it really does is make it possible to reuse existing built-ins taking a single argument as methods on a class. But I'd like to have that option; we've got a ton of built-ins that do fiddly things, and it would be nice to reuse them easily. Point is, rather than deprecating it, I'd kind of like it if we could make it accessible via the types module for this sort of use case (without requiring ctypes hackery), as types.InstanceMethodType or the like. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 16:42:08 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 04 Apr 2019 20:42:08 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554410528.04.0.25229817876.issue36524@roundup.psfhosted.org> SilentGhost added the comment: Rocco, == is an equality operator, "is" is used for identity testing. If you have an example of documentation that states that == is an identity operator, do report it and we'd be glad to fix it. The print function does not change the object, it's the print function itself that return None. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 16:45:27 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 04 Apr 2019 20:45:27 +0000 Subject: [issue36529] Python from WindowsStore: can't install package using "-m pip" In-Reply-To: <1554407848.88.0.523569372633.issue36529@roundup.psfhosted.org> Message-ID: <1554410727.31.0.359476250388.issue36529@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Demos and Tools -Installation nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 17:45:30 2019 From: report at bugs.python.org (cagney) Date: Thu, 04 Apr 2019 21:45:30 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1554414330.36.0.822807033283.issue35866@roundup.psfhosted.org> cagney added the comment: Here's the children; yes there are somehow 4 children sitting around. Hopefully this is enough to figure out where things deadlock. 29970 8752 8752 29970 pts/6 8752 Sl+ 1000 1:00 | | \_ ./v3.7.3/bin/python3 cf-deadlock.py 8752 8975 8752 29970 pts/6 8752 S+ 1000 0:00 | | \_ ./v3.7.3/bin/python3 cf-deadlock.py 8752 8976 8752 29970 pts/6 8752 S+ 1000 0:00 | | \_ ./v3.7.3/bin/python3 cf-deadlock.py 8752 8977 8752 29970 pts/6 8752 S+ 1000 0:00 | | \_ ./v3.7.3/bin/python3 cf-deadlock.py 8752 8978 8752 29970 pts/6 8752 S+ 1000 0:00 | | \_ ./v3.7.3/bin/python3 cf-deadlock.py 8975 Current thread 0x00007f3be65126c0 (most recent call first): File "", line 219 in _call_with_frames_removed File "", line 1043 in create_module File "", line 583 in module_from_spec File "", line 670 in _load_unlocked File "", line 967 in _find_and_load_unlocked File "", line 983 in _find_and_load File "/home/python/v3.7.3/lib/python3.7/ctypes/__init__.py", line 7 in File "", line 219 in _call_with_frames_removed File "", line 728 in exec_module File "", line 677 in _load_unlocked File "", line 967 in _find_and_load_unlocked File "", line 983 in _find_and_load File "cf-deadlock.py", line 17 in f File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 232 in _process_worker File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 99 in run File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 297 in _bootstrap File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 74 in _launch File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 20 in __init__ File "/home/python/v3.7.3/lib/python3.7/multiprocessing/context.py", line 277 in _Popen File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 112 in start File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 593 in _adjust_process_count File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 569 in _start_queue_management_thread File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 615 in submit File "cf-deadlock.py", line 25 in 8976 Current thread 0x00007f3be65126c0 (most recent call first): File "/home/python/v3.7.3/lib/python3.7/multiprocessing/connection.py", line 379 in _recv File "/home/python/v3.7.3/lib/python3.7/multiprocessing/connection.py", line 407 in _recv_bytes File "/home/python/v3.7.3/lib/python3.7/multiprocessing/connection.py", line 216 in recv_bytes File "/home/python/v3.7.3/lib/python3.7/multiprocessing/queues.py", line 94 in get File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 226 in _process_worker File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 99 in run File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 297 in _bootstrap File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 74 in _launch File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 20 in __init__ File "/home/python/v3.7.3/lib/python3.7/multiprocessing/context.py", line 277 in _Popen File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 112 in start File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 593 in _adjust_process_count File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 569 in _start_queue_management_thread File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 615 in submit File "cf-deadlock.py", line 25 in 8977 Current thread 0x00007f3be65126c0 (most recent call first): File "/home/python/v3.7.3/lib/python3.7/multiprocessing/synchronize.py", line 95 in __enter__ File "/home/python/v3.7.3/lib/python3.7/multiprocessing/queues.py", line 93 in get File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 226 in _process_worker File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 99 in run File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 297 in _bootstrap File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 74 in _launch File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 20 in __init__ File "/home/python/v3.7.3/lib/python3.7/multiprocessing/context.py", line 277 in _Popen File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 112 in start File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 593 in _adjust_process_count File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 569 in _start_queue_management_thread File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 615 in submit File "cf-deadlock.py", line 25 in 8978 Current thread 0x00007f3be65126c0 (most recent call first): File "/home/python/v3.7.3/lib/python3.7/multiprocessing/synchronize.py", line 95 in __enter__ File "/home/python/v3.7.3/lib/python3.7/multiprocessing/queues.py", line 93 in get File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 226 in _process_worker File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 99 in run File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 297 in _bootstrap File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 74 in _launch File "/home/python/v3.7.3/lib/python3.7/multiprocessing/popen_fork.py", line 20 in __init__ File "/home/python/v3.7.3/lib/python3.7/multiprocessing/context.py", line 277 in _Popen File "/home/python/v3.7.3/lib/python3.7/multiprocessing/process.py", line 112 in start File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 593 in _adjust_process_count File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 569 in _start_queue_management_thread File "/home/python/v3.7.3/lib/python3.7/concurrent/futures/process.py", line 615 in submit File "cf-deadlock.py", line 25 in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 17:46:51 2019 From: report at bugs.python.org (Eryk Sun) Date: Thu, 04 Apr 2019 21:46:51 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1554414411.15.0.182176918252.issue9194@roundup.psfhosted.org> Eryk Sun added the comment: There's still a potential problem when Reg2Py calls wcslen(str[index]). This could be addressed by having fixupMultiSZ take an int array to store the length of each string. For example: static void fixupMultiSZ(wchar_t **strings, int *lengths, wchar_t *data, int len) { wchar_t *P, *Q = data + len; int i; for (P = data, i = 0; P < Q && *P; P++, i++) { strings[i] = P; lengths[i] = 0; for (; P < Q && *P; P++) { lengths[i]++; } } } We'd have to allocate the lengths array in Reg2Py, like we do for the strings array. Also, we can remove the overflow error check prior to PyUnicode_FromWideChar. The longest possible length is `retDataSize / 2`, which occurs if a single string is stored without any null terminators. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 18:21:41 2019 From: report at bugs.python.org (Rocco Santoro) Date: Thu, 04 Apr 2019 22:21:41 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554416501.88.0.348311290819.issue36524@roundup.psfhosted.org> Rocco Santoro added the comment: You are right. The documentation, that I know, is clear. Anyway in this case "is" and "==" provides the same outcome and this is my remark, that I called bug, wrongly. The reason is the nature of print(), as function, that always remains always NoneType with only the value None. Nevertheless, print, as method, could be referred to the object. This is my goofy remark about the contraddiction between the message of the communication by print method and the nature of the communication by print function. Therefore, the monitor tells you that two things are not equals because they are two different ways to say the same message. Thanks a lot for the patience ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 18:26:09 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 04 Apr 2019 22:26:09 +0000 Subject: [issue36530] Document codecs decode_encode() and encode_decode() APIs Message-ID: <1554416769.95.0.261313535534.issue36530@roundup.psfhosted.org> New submission from Gregory P. Smith : The codecs module has public decode_encode() and encode_decode() functions. They have never been documented, but are recommended for some uses such as: https://stackoverflow.com/questions/14820429/how-do-i-decodestring-escape-in-python3/23151714#23151714 As public APIs, we should document them. ---------- assignee: docs at python components: Documentation messages: 339467 nosy: docs at python, gregory.p.smith, njs priority: normal severity: normal stage: needs patch status: open title: Document codecs decode_encode() and encode_decode() APIs versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 19:53:40 2019 From: report at bugs.python.org (Eddie Elizondo) Date: Thu, 04 Apr 2019 23:53:40 +0000 Subject: [issue36531] PyType_FromSpec wrong behavior with multiple Py_tp_members Message-ID: <1554422020.37.0.786317222832.issue36531@roundup.psfhosted.org> New submission from Eddie Elizondo : If a user accidentally defined more than one Py_tp_members in the spec, PyType_FromSpec will ignore all but the last use case. However, the number of members count will cause the type to allocate more memory than needed. This leads to weird behavior and crashes. The solution is a one line fix to just restart the count if multiple Py_tp_members are defined. ---------- messages: 339468 nosy: eelizondo priority: normal severity: normal status: open title: PyType_FromSpec wrong behavior with multiple Py_tp_members _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 19:57:53 2019 From: report at bugs.python.org (Eddie Elizondo) Date: Thu, 04 Apr 2019 23:57:53 +0000 Subject: [issue36531] PyType_FromSpec wrong behavior with multiple Py_tp_members In-Reply-To: <1554422020.37.0.786317222832.issue36531@roundup.psfhosted.org> Message-ID: <1554422273.4.0.577469557971.issue36531@roundup.psfhosted.org> Change by Eddie Elizondo : ---------- keywords: +patch pull_requests: +12617 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 20:58:33 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 05 Apr 2019 00:58:33 +0000 Subject: [issue36524] identity operator In-Reply-To: <1554380923.58.0.948935452429.issue36524@roundup.psfhosted.org> Message-ID: <1554425913.08.0.384004319623.issue36524@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 21:02:19 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 01:02:19 +0000 Subject: [issue36530] Document codecs decode_encode() and encode_decode() APIs In-Reply-To: <1554416769.95.0.261313535534.issue36530@roundup.psfhosted.org> Message-ID: <1554426139.53.0.244730496286.issue36530@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- superseder: -> Missing documentation for codecs.escape_decode _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 21:02:33 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 01:02:33 +0000 Subject: [issue36530] Document codecs decode_encode() and encode_decode() APIs In-Reply-To: <1554416769.95.0.261313535534.issue36530@roundup.psfhosted.org> Message-ID: <1554426153.57.0.373322964979.issue36530@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 21:03:29 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 01:03:29 +0000 Subject: [issue30588] Missing documentation for codecs.escape_decode In-Reply-To: <1496847775.57.0.842403144977.issue30588@psf.upfronthosting.co.za> Message-ID: <1554426209.5.0.476019568668.issue30588@roundup.psfhosted.org> Gregory P. Smith added the comment: We can't change it or remove it, it is public by virtue of its name. We should document it. Removing or renaming it to be _private requires a PendingDeprecationWarning -> DeprecationWarning -> removal cycle. it is well known and used. https://stackoverflow.com/questions/14820429/how-do-i-decodestring-escape-in-python3/23151714#23151714 ---------- nosy: +gregory.p.smith, njs versions: +Python 3.8 -Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 4 21:03:44 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 01:03:44 +0000 Subject: [issue30588] Missing documentation for codecs.escape_decode In-Reply-To: <1496847775.57.0.842403144977.issue30588@psf.upfronthosting.co.za> Message-ID: <1554426224.78.0.429291892489.issue30588@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 01:14:14 2019 From: report at bugs.python.org (spaceman_spiff) Date: Fri, 05 Apr 2019 05:14:14 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style Message-ID: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> New submission from spaceman_spiff : It was not quite clear how to use the logging library with the new str.format style so I added an example in the logging cookbook ---------- assignee: docs at python components: Documentation messages: 339470 nosy: docs at python, spaceman_spiff priority: normal severity: normal status: open title: Example of logging.formatter with new str.format style versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 01:14:22 2019 From: report at bugs.python.org (spaceman_spiff) Date: Fri, 05 Apr 2019 05:14:22 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554441262.09.0.599109708569.issue36532@roundup.psfhosted.org> Change by spaceman_spiff : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 01:15:28 2019 From: report at bugs.python.org (Roundup Robot) Date: Fri, 05 Apr 2019 05:15:28 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554441328.36.0.349998775083.issue36532@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12618 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 01:40:17 2019 From: report at bugs.python.org (Roman Evstifeev) Date: Fri, 05 Apr 2019 05:40:17 +0000 Subject: [issue32776] asyncio SIGCHLD scalability problems In-Reply-To: <1517865762.95.0.467229070634.issue32776@psf.upfronthosting.co.za> Message-ID: <1554442817.72.0.0672139445899.issue32776@roundup.psfhosted.org> Change by Roman Evstifeev : ---------- nosy: +Roman.Evstifeev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 01:48:28 2019 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Fri, 05 Apr 2019 05:48:28 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554443308.12.0.651883598239.issue36532@roundup.psfhosted.org> Change by Fred L. Drake, Jr. : ---------- nosy: +fdrake _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 01:49:55 2019 From: report at bugs.python.org (twisteroid ambassador) Date: Fri, 05 Apr 2019 05:49:55 +0000 Subject: [issue32776] asyncio SIGCHLD scalability problems In-Reply-To: <1517865762.95.0.467229070634.issue32776@psf.upfronthosting.co.za> Message-ID: <1554443395.17.0.414559133527.issue32776@roundup.psfhosted.org> twisteroid ambassador added the comment: The child watchers are documented now, see here: https://docs.python.org/3/library/asyncio-policy.html#process-watchers Sounds like FastChildWatcher https://docs.python.org/3/library/asyncio-policy.html#asyncio.FastChildWatcher is exactly what you need if you stick with the stock event loop. ---------- nosy: +twisteroid ambassador _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 02:29:00 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 05 Apr 2019 06:29:00 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554445740.75.0.554170701304.issue36532@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip versions: -Python 3.5, Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:15:51 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 08:15:51 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) Message-ID: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> New submission from Gregory P. Smith : I'm spawning a dicussion buried in the way too long thread of https://bugs.python.org/issue6721 over here into its own specific issue to treat as a 3.7 release blocker for a rollback or repair decision before 3.7.4. https://github.com/python/cpython/commit/3b699932e5ac3e76031bbb6d700fbea07492641d I believe that was released in 3.7.1 is leading to a behavior regression for an application (the Fedora installer's libreswan kvmrunner?). Full details can be found in the messages of the other issue starting with: https://bugs.python.org/issue6721#msg329474 TL;DR - logging.Handler instances each have their own threading.Rlock. libreswan implements at least one logging.Handler subclass. That subclass's custom emit() implementation directly calls potentially many other sub-handlers emit() methods. Some of those emit() methods (such as logging.StreamHandler) call flush() which acquires the handler's lock. So they've got a dependency between these two locks, the first's must be acquired before the second. But the logging module APIs have no concept of sub-handlers and lock ordering. I see many flaws with the libreswan code's design (I'm already ignoring the futility of threading + fork) but this still caused a behavior regression in the stable 3.7 release. (more comments coming as followups to avoid a wall of text with too many topics) ---------- assignee: gregory.p.smith components: Library (Lib) keywords: 3.7regression messages: 339472 nosy: cagney, gregory.p.smith, ned.deily, vstinner priority: release blocker severity: normal status: open title: logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:17:15 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 08:17:15 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554452235.21.0.426574199739.issue6721@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks for the debugging details! I've filed https://bugs.python.org/issue36533 to specifically track this potential regression in the 3.7 stable branch. lets carry on there where the discussion thread isn't too long for bug tracker sanity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:23:09 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 08:23:09 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554452589.95.0.0723849823313.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: That custom DebugHandler's emit() implementation that calls into one or more sub-handlers suggests that libreswan _might_ be able to fix it in the custom DebugHandler by implementing custom acquire() and release() methods... BUT that is a fundamentally flawed problem: It requires acquiring multiple locks in a single atomic operation OR guaranteeing that they will always be acquired in a single specific order. Given the logging module's fork-time code maintains no order, even implementing a custom acquire() and release() method in your custom DebugHandler would not be sufficient as sub-handler locks could be acquired first during fork. also, that would be assuming your sub-handlers are not also used directly elsewhere within all possible coexisting logger configurations. An implementable _gross workaround_ that libreswan or anything else in this boat could implement satisfying that constraint would be to force all potentially related handlers to share the same single RLock instance. :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:27:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 Apr 2019 08:27:39 +0000 Subject: [issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0 In-Reply-To: <1456920893.87.0.933592382559.issue26470@psf.upfronthosting.co.za> Message-ID: <1554452859.84.0.150902610275.issue26470@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12619 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:41:40 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 08:41:40 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554453700.04.0.573434218252.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: Within the logging module we could go beyond using a WeakSet and maintain an ordering. But we'd need to allow a way for Handler subclasses to indicate what order matters; that'd require a new API (not suitable for 3.7) An ordering itself may be insufficient as code can implement arbitrary Handler code with cyclic graphs of handlers calling directly into other handlers such that no possible order could ever satisfy them all. This pulls us back into "stop having multiple locks" for any code that creates relationships between handlers. Which is good advice for Handler authors and something we should document if it isn't already. Side note: We should also document that Handler.emit() as an API MUST be called with the Handler's lock acquired via Handler.acquire() first. That is the undocumented contracted way logging.Logger.handle()'s code always calls into handler emit().... The libreswan code calling other handler's emit() methods without doing that smells wrong. But that has no relation to their current problem: Even if it did, it'd still deadlock, just sooner rather than within the other handler's emit()->flush()->acquire() call chain. Logging library users are better off never directly calling another handler. Put message onto queues with a dedicated thread processing those into the relevant handlers. Only block waiting for those queued items to have been processed _after_ releasing your own lock if you want to maintain the synchronicity of logging API calls returning only after the message has been handled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:43:55 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 Apr 2019 08:43:55 +0000 Subject: [issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion In-Reply-To: <1536176195.07.0.56676864532.issue34589@psf.upfronthosting.co.za> Message-ID: <1554453835.55.0.230070632561.issue34589@roundup.psfhosted.org> STINNER Victor added the comment: I fixed the issue in Python 3.8 with bpo-36443: commit d929f1838a8fba881ff0148b7fc31f6265703e3d Author: Victor Stinner Date: Wed Mar 27 18:28:46 2019 +0100 bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589) I'm not sure if it would be accceptable to the behavior in Python 3.7.x, especially without PEP 587 which targets Python 3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:52:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 Apr 2019 08:52:44 +0000 Subject: [issue36301] Add _Py_PreInitialize() function In-Reply-To: <1552652968.58.0.444379921918.issue36301@roundup.psfhosted.org> Message-ID: <1554454364.09.0.171859225351.issue36301@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12620 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:52:58 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 05 Apr 2019 08:52:58 +0000 Subject: [issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty In-Reply-To: <1534189001.92.0.56676864532.issue34396@psf.upfronthosting.co.za> Message-ID: <1554454378.15.0.773369077719.issue34396@roundup.psfhosted.org> Jeroen Demeyer added the comment: OK, makes sense. Also super() calls I guess: you can write super().__getitem__(x) but not super()[x] (although the latter *could* be implemented if we wanted to). I see two ways of fixing this: 1. Make wrapper descriptors faster, removing the need for the METH_COEXIST hack in the first place. 2. Deal better with METH_COEXIST methods when inheriting. Since both of these solutions are closely related to the topic of PEP 580/PEP 590, I suggest to try to fix this after either is implemented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:54:30 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 08:54:30 +0000 Subject: [issue36404] Document PendingDeprecationWarning as deprecated Message-ID: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> New submission from Inada Naoki : New changeset 176d26364bb67801fa522f52f20cbe44420d6942 by Inada Naoki in branch 'master': bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505) https://github.com/python/cpython/commit/176d26364bb67801fa522f52f20cbe44420d6942 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:55:46 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 08:55:46 +0000 Subject: [issue36404] Document PendingDeprecationWarning is not so useful. In-Reply-To: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> Message-ID: <1554454546.26.0.804052073759.issue36404@roundup.psfhosted.org> Inada Naoki added the comment: After discussion on ML, I just recommend DeprecationWarning over PendingDeprecationWarning in this time. PendingDeprecationWarning is not deprecated for now. ---------- title: Document PendingDeprecationWarning as deprecated -> Document PendingDeprecationWarning is not so useful. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:55:51 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 08:55:51 +0000 Subject: [issue36404] Document PendingDeprecationWarning is not so useful. In-Reply-To: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> Message-ID: <1554454551.66.0.138842935467.issue36404@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 04:59:32 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 05 Apr 2019 08:59:32 +0000 Subject: [issue36404] Document PendingDeprecationWarning is not so useful. In-Reply-To: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> Message-ID: <1554454772.15.0.0292490461377.issue36404@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12621 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 05:02:35 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 09:02:35 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554454955.19.0.2889074277.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: Now to back up: Why was this application using fork() in a threaded application at all? That is a fundamental flaw. Should we be doing work to support things that so far merely _happen_ to work on such broken designs? Another alternative for the DebugHandler implementation in whatever code implemented it is for it to de-register itself from the logging library's private WeakSet of handler locks to acquire at fork time from its own constructor. We don't have a public API for this so the workaround doing that on 3.7.1 - 3.7.3 would look like: def __init__(self, ...): super().__init__(...) if hasattr(logging, '_at_fork_acquire_release_weakset'): logging._at_fork_acquire_release_weakset.discard(self) This means it'd still have the bug the code already had on all prior to versions of Python before this logging library "acquire the locks before fork" fix went in: Namely if the forked child tries to log it could deadlock due to forking while the inherited logging handler lock held. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 05:02:41 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 09:02:41 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554454961.3.0.297805315579.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: A stdlib alternative to this whole mess would be to avoid acquiring the logging locks before fork() as we currently do and just blindly re-initialize all of them afterwards under the assumption that they "can't" be protecting anything in a newly forked child process. Handlers that need specific resource synchronization around fork would then be required to deal with their own os.register_at_fork() calls. (ex: to avoid multiple processes writing to the same file or fd at once) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 05:07:28 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 05 Apr 2019 09:07:28 +0000 Subject: [issue36404] Document PendingDeprecationWarning is not so useful. In-Reply-To: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> Message-ID: <1554455248.74.0.968239536738.issue36404@roundup.psfhosted.org> miss-islington added the comment: New changeset 86fbe0287dd774022fd2b6c2dcbfbb5573a0b874 by Miss Islington (bot) in branch '3.7': bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505) https://github.com/python/cpython/commit/86fbe0287dd774022fd2b6c2dcbfbb5573a0b874 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 05:44:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 Apr 2019 09:44:09 +0000 Subject: [issue36301] Add _Py_PreInitialize() function In-Reply-To: <1552652968.58.0.444379921918.issue36301@roundup.psfhosted.org> Message-ID: <1554457449.61.0.636004754353.issue36301@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01 by Victor Stinner in branch 'master': bpo-36301: Fix _PyPreConfig_Read() compiler warning (GH-12695) https://github.com/python/cpython/commit/6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 05:45:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 Apr 2019 09:45:58 +0000 Subject: [issue36496] Local variables can be used uninitialized in _PyPreConfig_Read() In-Reply-To: <1554050763.93.0.364085310832.issue36496@roundup.psfhosted.org> Message-ID: <1554457558.48.0.655759870312.issue36496@roundup.psfhosted.org> STINNER Victor added the comment: Fixed by commit 6a8c3139ae9ada89d4a95985ec7cf8bb7d03bc01. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 05:46:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 05 Apr 2019 09:46:15 +0000 Subject: [issue36496] Local variables can be used uninitialized in _PyPreConfig_Read() In-Reply-To: <1554050763.93.0.364085310832.issue36496@roundup.psfhosted.org> Message-ID: <1554457575.34.0.78888001087.issue36496@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for your bug report and fix Brad Larsen ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:04:31 2019 From: report at bugs.python.org (Cristi Fati) Date: Fri, 05 Apr 2019 10:04:31 +0000 Subject: [issue36534] tarfile: handling Windows (path) illegal characters in archive member names Message-ID: <1554458671.74.0.11308540457.issue36534@roundup.psfhosted.org> New submission from Cristi Fati : Although tar is a Nix based (and mostly used) format, it gains popularity on Win too. As tarfile is running on Win, I think it should handle (work around) path incompatibilities, as zipfile (`ZipFile._sanitize_windows_name`) does. Applies to all branches. More details on [Tarfile/Zipfile extractall() changing filename of some files](https://stackoverflow.com/questions/55340013/tarfile-zipfile-extractall-changing-filename-of-some-files/55348443#55348443). Regarding the current zipfile handling: it also can be improved (as it has a small bug), for example if the archive contains 2 files ("file:" and "file_") it won't work as expected. But this is a rare corner case. I didn't prepare a patch, since I did so for another issue (https://bugs.python.org/issue36247 - which I consider an ugly one), and it wasn't well received, also it was rejected (for different reasons). If this issue gets the green light from whomever is in charge, I'll be happy to provide one. ---------- components: Library (Lib) messages: 339486 nosy: CristiFati priority: normal severity: normal status: open title: tarfile: handling Windows (path) illegal characters in archive member names type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:04:49 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 10:04:49 +0000 Subject: [issue14017] Make it easy to create a new TextIOWrapper based on an existing In-Reply-To: <1329263373.63.0.201487376726.issue14017@psf.upfronthosting.co.za> Message-ID: <1554458689.41.0.523496086696.issue14017@roundup.psfhosted.org> Inada Naoki added the comment: TextIOWrapper now has reconfigure() method. Can this issue be closed? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:08:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 10:08:52 +0000 Subject: [issue29202] Improve dict iteration In-Reply-To: <1483869036.69.0.874318106576.issue29202@psf.upfronthosting.co.za> Message-ID: <1554458932.5.0.191045106419.issue29202@roundup.psfhosted.org> Inada Naoki added the comment: New changeset f66e336f455b5a6bb0ca857d61c43be410d0df13 by Inada Naoki (Cheryl Sabella) in branch 'master': bpo-29202: improve dict iteration (GH-11900) https://github.com/python/cpython/commit/f66e336f455b5a6bb0ca857d61c43be410d0df13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:09:00 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 10:09:00 +0000 Subject: [issue29202] Improve dict iteration In-Reply-To: <1483869036.69.0.874318106576.issue29202@psf.upfronthosting.co.za> Message-ID: <1554458940.54.0.712019220322.issue29202@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:10:02 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 05 Apr 2019 10:10:02 +0000 Subject: [issue29209] Remove old-deprecated ElementTree features In-Reply-To: <1483898185.03.0.0187159979308.issue29209@psf.upfronthosting.co.za> Message-ID: <1554459002.3.0.427580280152.issue29209@roundup.psfhosted.org> Jeroen Demeyer added the comment: This should be closed. ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:12:42 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 05 Apr 2019 10:12:42 +0000 Subject: [issue36534] tarfile: handling Windows (path) illegal characters in archive member names In-Reply-To: <1554458671.74.0.11308540457.issue36534@roundup.psfhosted.org> Message-ID: <1554459162.55.0.966208744756.issue36534@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +lars.gustaebel, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:13:10 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 10:13:10 +0000 Subject: [issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem() In-Reply-To: <1544525657.6.0.788709270274.issue35459@psf.upfronthosting.co.za> Message-ID: <1554459190.15.0.0284261353082.issue35459@roundup.psfhosted.org> Inada Naoki added the comment: Serhiy, can this issue be closed? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:17:17 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 05 Apr 2019 10:17:17 +0000 Subject: [issue25451] tkinter: PhotoImage transparency methods In-Reply-To: <1445417795.5.0.279905447074.issue25451@psf.upfronthosting.co.za> Message-ID: <1554459437.15.0.973177248084.issue25451@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 50866e9ed3e4e0ebb60c20c3483a8df424c02722 by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-25451: Add transparency methods to tkinter.PhotoImage. (GH-10406) https://github.com/python/cpython/commit/50866e9ed3e4e0ebb60c20c3483a8df424c02722 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:27:28 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 05 Apr 2019 10:27:28 +0000 Subject: [issue34090] Python function call optimization: avoid temporary tuple to pass **kwargs In-Reply-To: <1531264419.35.0.56676864532.issue34090@psf.upfronthosting.co.za> Message-ID: <1554460048.57.0.163266341476.issue34090@roundup.psfhosted.org> Jeroen Demeyer added the comment: This might be solvable using PEP 580 by using METH_VARARGS instead of METH_FASTCALL for such functions. This would still require a temporary tuple for the positional args but no additional dict would need to be allocated. ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:29:17 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 05 Apr 2019 10:29:17 +0000 Subject: [issue25451] tkinter: PhotoImage transparency methods In-Reply-To: <1445417795.5.0.279905447074.issue25451@psf.upfronthosting.co.za> Message-ID: <1554460157.81.0.249332582174.issue25451@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:32:51 2019 From: report at bugs.python.org (A. Skrobov) Date: Fri, 05 Apr 2019 10:32:51 +0000 Subject: [issue36256] parser module fails on legal input In-Reply-To: <1552235819.03.0.691593467494.issue36256@roundup.psfhosted.org> Message-ID: <1554460371.03.0.681769645086.issue36256@roundup.psfhosted.org> A. Skrobov added the comment: Is it intentional that the fix is not backported to 3.6 as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 06:51:14 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 10:51:14 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1554461474.26.0.0755531875814.issue36050@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 07:00:57 2019 From: report at bugs.python.org (Manjusaka) Date: Fri, 05 Apr 2019 11:00:57 +0000 Subject: [issue36535] Windows build failure when use the code from the GitHub master branch Message-ID: <1554462057.39.0.0549572180819.issue36535@roundup.psfhosted.org> New submission from Manjusaka : I use Visual Studio 2017 to build the source code from the master branch. But it failed. The output message shows that I lose my ffi.h. I find that the developer had removed the libffi_module directory under cpython/modules/_ctypes since 32119e10b792ad7ee4e5f951a2d89ddbaf111cc5 I guess that maybe that's the problem why I get failure ---------- components: Windows messages: 339494 nosy: Manjusaka, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows build failure when use the code from the GitHub master branch versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 07:25:01 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 05 Apr 2019 11:25:01 +0000 Subject: [issue14841] os.get_terminal_size() should check stdin as a fallback In-Reply-To: <1337275274.3.0.172049776796.issue14841@psf.upfronthosting.co.za> Message-ID: <1554463501.59.0.913122522112.issue14841@roundup.psfhosted.org> Change by daniel hahler : ---------- keywords: +patch pull_requests: +12622 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 07:52:14 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 05 Apr 2019 11:52:14 +0000 Subject: [issue14841] os.get_terminal_size() should check stdin as a fallback In-Reply-To: <1337275274.3.0.172049776796.issue14841@psf.upfronthosting.co.za> Message-ID: <1554465134.6.0.413662138654.issue14841@roundup.psfhosted.org> daniel hahler added the comment: Created a PR at https://github.com/python/cpython/pull/12697. It prefers stdin and stderr over stdout. I think stdin is most likely connected to a terminal, and wondered why ncurses uses stderr/stdout first, and only then stdin. stdin handling was added there in https://github.com/mirror/ncurses/commit/aa70bf3c#diff-10ad6ea20599ac9258757354665b80cbR1295, and it looks just like an oversight maybe - it is also not that critical in C I guess. ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 07:57:37 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 11:57:37 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1554465457.86.0.6929260245.issue36050@roundup.psfhosted.org> Inada Naoki added the comment: issue1296004 is too old (512MB RAM machine!) and I can not confirm it. But I think it was caused by inefficient realloc() in CRT. See https://github.com/python/cpython/blob/6c52d76db8b1cb836c136bd6a1044e85bfe8241e/Lib/socket.py#L298-L303 _fileobject called socket.recv with remaining size. Typically, socket can't return MBs at once. So it cause: 1. Large (at most `amt`, some MBs) string (bytes) are allocated. (malloc) 2. recv is called. 3. _PyString_Resize() (realloc) is called with smaller bytes (typically ~128KiB) 4. amt -= received 5. if amt == 0: exit; goto 1. This might stress malloc and realloc in CRT. It caused fragmentation and MemoryError. --- For now, almost everything is rewritten. In case of _pyio, BufferedIOReader calls RawIOBase.read(). It copies from bytearray to bytes. So call only malloc and free. Stress for realloc will be reduced. https://github.com/python/cpython/blob/50866e9ed3e4e0ebb60c20c3483a8df424c02722/Lib/_pyio.py#L586-L591 In case of C _io module, it is more efficient. It allocate PyBytes once and calls SocketIO.read_into directly. No temporary bytes objects are created. https://github.com/python/cpython/blob/50866e9ed3e4e0ebb60c20c3483a8df424c02722/Modules/_io/bufferedio.c#L1632 https://github.com/python/cpython/blob/50866e9ed3e4e0ebb60c20c3483a8df424c02722/Modules/_io/bufferedio.c#L1658 https://github.com/python/cpython/blob/50866e9ed3e4e0ebb60c20c3483a8df424c02722/Modules/_io/bufferedio.c#L1470 ---------- type: -> performance versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:05:53 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 05 Apr 2019 12:05:53 +0000 Subject: [issue36256] parser module fails on legal input In-Reply-To: <1552235819.03.0.691593467494.issue36256@roundup.psfhosted.org> Message-ID: <1554465953.52.0.556733784985.issue36256@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: 3.6 only accepts security fixes at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:12:46 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 12:12:46 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1554466366.92.0.405114636863.issue36050@roundup.psfhosted.org> Inada Naoki added the comment: Additionally, _safe_read calls fp.read() multiple times to handle EINTR. But EINTR is handled by socket module now (PEP 475). Now the function can be very simple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:32:44 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 12:32:44 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1554467564.24.0.601523710968.issue36050@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +12623 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:40:52 2019 From: report at bugs.python.org (wis) Date: Fri, 05 Apr 2019 12:40:52 +0000 Subject: [issue36536] is there a python implementation of the cpython commandline interpretor? Message-ID: <1554468052.35.0.435218217698.issue36536@roundup.psfhosted.org> New submission from wis : this algorithm: https://github.com/python/cpython/blob/34ef64fe5947bd7e1b075c785fc1125c4e600cd4/Python/coreconfig.c#L1644 I need a python library that does that to fix this answer https://stackoverflow.com/a/55413882/4178053 I need to get the correct path of the script from the commandline of the python process. I searched for libraries or implementations and couldn't find one, can someone help me? I can't read C. ---------- components: Argument Clinic messages: 339499 nosy: larry, wis priority: normal severity: normal status: open title: is there a python implementation of the cpython commandline interpretor? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:41:50 2019 From: report at bugs.python.org (Larry Hastings) Date: Fri, 05 Apr 2019 12:41:50 +0000 Subject: [issue36536] is there a python implementation of the cpython commandline interpretor? In-Reply-To: <1554468052.35.0.435218217698.issue36536@roundup.psfhosted.org> Message-ID: <1554468110.74.0.515769579108.issue36536@roundup.psfhosted.org> Larry Hastings added the comment: The Python bug tracker is not your personal resource for answering programming questions. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:50:53 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 12:50:53 +0000 Subject: [issue35551] Encoding and alias issues In-Reply-To: <1545386892.27.0.788709270274.issue35551@psf.upfronthosting.co.za> Message-ID: <1554468653.84.0.87986081089.issue35551@roundup.psfhosted.org> Change by Inada Naoki : ---------- assignee: -> lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:57:33 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 05 Apr 2019 12:57:33 +0000 Subject: [issue36044] PROFILE_TASK for PGO build is not a good workload In-Reply-To: <1550608790.89.0.306917505619.issue36044@roundup.psfhosted.org> Message-ID: <1554469053.21.0.57350179473.issue36044@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 08:59:15 2019 From: report at bugs.python.org (Eryk Sun) Date: Fri, 05 Apr 2019 12:59:15 +0000 Subject: [issue36534] tarfile: handling Windows (path) illegal characters in archive member names In-Reply-To: <1554458671.74.0.11308540457.issue36534@roundup.psfhosted.org> Message-ID: <1554469155.18.0.637460646837.issue36534@roundup.psfhosted.org> Eryk Sun added the comment: _sanitize_windows_name() fails to translate the reserved control characters (0x01-0x1F) and backslash in names. What I've seen done in some cases (e.g. Unix network shares mapped to SMB) is to translate names using the private use area block, e.g. 0xF001 - 0xF07F. Windows has no problem with characters in this range in a filename. (Displaying these characters sensibly is another matter.) For Windows 10, this is especially useful since the Linux subsystem automatically translates this PUA block back to ASCII when accessing a Windows volume via drvfs. For example: C:\Temp\pua>python -q >>> import sys >>> sys.platform 'win32' >>> name = ''.join(map(chr, range(0xf001, 0xf080))) >>> _ = open(name, 'w') >>> ^Z C:\Temp\pua>bash -c "python3 -q" >>> import os, sys >>> sys.platform 'linux' >>> os.listdir() ['\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ `abcdefghijklmnopqrstuvwxyz{|}~\x7f'] Also, while _sanitize_windows_name() handles trailing dots, for some reason it overlooks trailing spaces. It also doesn't handle reserved DOS device names. The reserved names include NUL, CON, CONIN$, CONOUT$, AUX, PRN, COM[1-9], LPT[1-9], and these names plus zero or more spaces and possibly a dot or colon and any subsequent characters. For example: >>> os.path._getfullpathname('con') '\\\\.\\con' >>> os.path._getfullpathname('con ') '\\\\.\\con' >>> os.path._getfullpathname('con:') '\\\\.\\con' >>> os.path._getfullpathname('con :') '\\\\.\\con' >>> os.path._getfullpathname('con : spam') '\\\\.\\con' >>> os.path._getfullpathname('con . eggs') '\\\\.\\con' It's not a reserved device name if the first character after zero or more spaces is not a dot or colon. For example: >>> os.path._getfullpathname('con spam') 'C:\\con spam' We can create filenames with reserved device names or trailing spaces and dots by using a \\?\ prefixed path (i.e. a non-normalized device path). However, most programs don't use \\?\ paths, so it's probably better to translate these names. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 09:11:51 2019 From: report at bugs.python.org (Roman Evstifeev) Date: Fri, 05 Apr 2019 13:11:51 +0000 Subject: [issue33533] Provide an async-generator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1554469911.02.0.0600615911994.issue33533@roundup.psfhosted.org> Change by Roman Evstifeev : ---------- nosy: +Roman.Evstifeev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 09:40:42 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 05 Apr 2019 13:40:42 +0000 Subject: [issue35983] tp_dealloc trashcan shouldn't be called for subclasses In-Reply-To: <1550055751.42.0.717332216151.issue35983@roundup.psfhosted.org> Message-ID: <1554471642.59.0.577236089383.issue35983@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- pull_requests: +12624 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 10:22:06 2019 From: report at bugs.python.org (Zack Weinberg) Date: Fri, 05 Apr 2019 14:22:06 +0000 Subject: [issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1554474126.61.0.633595085267.issue18748@roundup.psfhosted.org> Zack Weinberg added the comment: I have observed this problem in a production application using Python 3.5 and 3.6 (system-packaged interpreters from Ubuntu) and I would like to mention that this is an effective workaround: ``` import ctypes libgcc_s = ctypes.CDLL("libgcc_s.so.1") ``` provided you do it before creating any threads, and the variable `libgcc_s` remains live until after all threads are terminated. ---------- nosy: +zwol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 11:11:07 2019 From: report at bugs.python.org (cagney) Date: Fri, 05 Apr 2019 15:11:07 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: cagney added the comment: On Fri, 5 Apr 2019 at 04:15, Gregory P. Smith wrote: > > > New submission from Gregory P. Smith : > > I'm spawning a dicussion buried in the way too long thread of https://bugs.python.org/issue6721 over here into its own specific issue to treat as a 3.7 release blocker for a rollback or repair decision before 3.7.4. > > https://github.com/python/cpython/commit/3b699932e5ac3e76031bbb6d700fbea07492641d > > I believe that was released in 3.7.1 is leading to a behavior regression for an application (the Fedora installer's libreswan kvmrunner?). Full details can be found in the messages of the other issue starting with: > https://bugs.python.org/issue6721#msg329474 Two separate applications have tripped up on this: - Fedora's installer aka anaconda I don't know any further details. - libreswan's test framework aka kvmrunner kvmrunner uses pexpect pexpect uses ptyprocess ptyprocess uses pty.fork() + os.exec*(); but, hey, who knew! I didn't until this week. this seems to be a long standing concern: https://github.com/pexpect/ptyprocess/issues/43 > TL;DR - logging.Handler instances each have their own threading.Rlock. > libreswan implements at least one logging.Handler subclass. That subclass's custom emit() implementation directly calls potentially many other sub-handlers emit() methods. Some of those emit() methods (such as logging.StreamHandler) call flush() which acquires the handler's lock. # Implement log-level inversion. # # Ref: https://docs.python.org/2/howto/logging.html#logging-flow # # By default, a parent (root) logger, regardless of its log-level, # will log all the records logged by a child. For instance, if a # child logger is logging at DEBUG-level, then the parent will log # (display on the console) those DEBUG-level records even when it has # been configured to log only INFO-level records. This is because the # default log-level ("Logger enabled for level of call?") check is # only applied once at record-creation. # # This code allows DEBUG-level logging to a file, while simultaneously # (the inversion) restricting console log records to just INFO-level # say. The logging.Handler's lock ensures that the two sub-streams are kept in ordered. It prevents threads interleaving their writes. > So they've got a dependency between these two locks, the first's must be acquired before the second. > > But the logging module APIs have no concept of sub-handlers and lock ordering. > > I see many flaws with the libreswan code's design (I'm already ignoring the futility of threading + fork) but this still caused a behavior regression in the stable 3.7 release. Always first understand the problem. > (more comments coming as followups to avoid a wall of text with too many topics) > > ---------- > assignee: gregory.p.smith > components: Library (Lib) > keywords: 3.7regression > messages: 339472 > nosy: cagney, gregory.p.smith, ned.deily, vstinner > priority: release blocker > severity: normal > status: open > title: logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) > type: behavior > versions: Python 3.7 > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 11:25:32 2019 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 05 Apr 2019 15:25:32 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554477932.65.0.710829896847.issue36532@roundup.psfhosted.org> Vinay Sajip added the comment: But there is an example in the cookbook already: https://docs.python.org/3/howto/logging-cookbook.html#use-of-alternative-formatting-styles It's right there in the first code sample in that section. You might want to amend your change to point to this section from the one where you want to make the change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 12:05:36 2019 From: report at bugs.python.org (cagney) Date: Fri, 05 Apr 2019 16:05:36 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554454961.3.0.297805315579.issue36533@roundup.psfhosted.org> Message-ID: cagney added the comment: On Fri, 5 Apr 2019 at 05:02, Gregory P. Smith wrote: > > > Gregory P. Smith added the comment: > > A stdlib alternative to this whole mess would be to avoid acquiring the logging locks before fork() as we currently do and just blindly re-initialize all of them afterwards under the assumption that they "can't" be protecting anything in a newly forked child process. Handlers that need specific resource synchronization around fork would then be required to deal with their own os.register_at_fork() calls. (ex: to avoid multiple processes writing to the same file or fd at once) FYI, below is a simpler, but related, test. _at_fork_acquire_release_weakset doesn't seem to be locked: Ignoring exception from logging atfork release method: cannot release un-acquired lock Exception ignored in: Traceback (most recent call last): File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 269, in _after_at_fork_weak_calls _at_fork_weak_calls('release') File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 254, in _at_fork_weak_calls for instance in _at_fork_acquire_release_weakset: File "/home/python/v3.7.3/lib/python3.7/_weakrefset.py", line 60, in __iter__ for itemref in self.data: RuntimeError: Set changed size during iteration Exception in thread Thread-1: Traceback (most recent call last): File "/home/python/v3.7.3/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/home/python/v3.7.3/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "./btc.py", line 11, in lockie h = logging.Handler() File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 824, in __init__ self.createLock() File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 847, in createLock _register_at_fork_acquire_release(self) File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 250, in _register_at_fork_acquire_release _at_fork_acquire_release_weakset.add(instance) File "/home/python/v3.7.3/lib/python3.7/_weakrefset.py", line 83, in add self._commit_removals() File "/home/python/v3.7.3/lib/python3.7/_weakrefset.py", line 56, in _commit_removals discard(l.pop()) IndexError: pop from empty list ---- import logging import os import sys import threading def lockie(): while True: # this adds handle to _at_fork_acquire_release_weakset #sys.stdout.write(".") #sys.stdout.flush() h = logging.Handler() threading.Thread(target=lockie).start() for n in range(0,100000): if n % 100 == 0: sys.stdout.write("%d" % n) sys.stdout.flush() pid = os.fork() if pid != 0: os.wait() else: os._exit(0) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 12:15:16 2019 From: report at bugs.python.org (Ebizz Infotech) Date: Fri, 05 Apr 2019 16:15:16 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554480916.9.0.0229491719593.issue36533@roundup.psfhosted.org> Ebizz Infotech added the comment: The best-recommended method is hiring php web development services. https://www.ebizzinfotech.com/php-web-development/ ---------- nosy: +ebizzinfotech _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 12:21:38 2019 From: report at bugs.python.org (Ned Deily) Date: Fri, 05 Apr 2019 16:21:38 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554481298.81.0.837828796317.issue36533@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg339506 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 12:41:35 2019 From: report at bugs.python.org (Christian Heimes) Date: Fri, 05 Apr 2019 16:41:35 +0000 Subject: [issue36525] Deprecate instancemethod In-Reply-To: <1554383312.87.0.791083072255.issue36525@roundup.psfhosted.org> Message-ID: <1554482495.31.0.238662858292.issue36525@roundup.psfhosted.org> Christian Heimes added the comment: After some discussion we came to the conclusion that the API is still useful for some people. https://mail.python.org/pipermail/python-dev/2019-April/156986.html ---------- components: +Interpreter Core resolution: -> rejected stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 13:02:47 2019 From: report at bugs.python.org (Hugh Redelmeier) Date: Fri, 05 Apr 2019 17:02:47 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1554483767.72.0.216823126818.issue6721@roundup.psfhosted.org> Change by Hugh Redelmeier : ---------- nosy: +hugh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 13:03:11 2019 From: report at bugs.python.org (Hugh Redelmeier) Date: Fri, 05 Apr 2019 17:03:11 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554483791.96.0.935193511141.issue36533@roundup.psfhosted.org> Change by Hugh Redelmeier : ---------- nosy: +hugh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 13:27:11 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 05 Apr 2019 17:27:11 +0000 Subject: [issue36487] Make C-API docs clear about what the "main" interpreter is In-Reply-To: <1553961350.55.0.679076430542.issue36487@roundup.psfhosted.org> Message-ID: <1554485231.7.0.796110883683.issue36487@roundup.psfhosted.org> Eric Snow added the comment: I should have added something like this earlier, but here are key points to consider covering: * "main" interpreter is the original, created when the runtime initializes * historically almost always the only Python interpreter in a process * this is changing (more projects using subinterpreters, PEP 554) * in the "python" executable, subinterpreters available via extension modules (but uncommon) * it has extra responsiblities: * signal handling, in main thread * "pending calls", in main thread * not necessarily something to publicize :) * running in the "main" thread * can be taken over by a sub-interpreter, but not likely * execution *during* runtime initialization * usually (always?) the active interpreter during runtime finalization * others? * no strong link between interpreters (e.g. main <--> sub <--> sub) * no record of what interpreter was active (if any) when a subinterpreter was created * no "parent" interpreter * thread states may share thread ID * a bunch of stuff in the C-API and in the runtime still assumes that the main interpreter is running in the current OS thread * other stuff? Not all of that necessarily belongs there in the docs, but a lot of it does. :) ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 13:32:06 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 05 Apr 2019 17:32:06 +0000 Subject: [issue36487] Make C-API docs clear about what the "main" interpreter is In-Reply-To: <1553961350.55.0.679076430542.issue36487@roundup.psfhosted.org> Message-ID: <1554485526.89.0.913628400199.issue36487@roundup.psfhosted.org> Joannah Nanjekye added the comment: Thanks for this feedback. Let me see how I can incorporate this in the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:22:24 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 18:22:24 +0000 Subject: [issue36484] Can't reorder TLS 1.3 ciphersuites In-Reply-To: <1553945035.34.0.303610202958.issue36484@roundup.psfhosted.org> Message-ID: <1554488544.2.0.0670479956088.issue36484@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- type: -> enhancement versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:28:55 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 18:28:55 +0000 Subject: [issue36486] Bugs and inconsistencies in unicodedata In-Reply-To: <1553956873.19.0.268771747568.issue36486@roundup.psfhosted.org> Message-ID: <1554488935.39.0.846799067048.issue36486@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> needs patch versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:31:36 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 18:31:36 +0000 Subject: [issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR In-Reply-To: <1553964458.43.0.741059488448.issue36488@roundup.psfhosted.org> Message-ID: <1554489096.77.0.277394888642.issue36488@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: os.sendfile() on BSD and macOS does not return bytes sent on EINTR -> os.sendfile() on BSD, macOS don't return bytes sent on EINTR type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:33:48 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 18:33:48 +0000 Subject: [issue36490] Modernize function signature in Archiving section of shutil doc In-Reply-To: <1554005288.19.0.789880523073.issue36490@roundup.psfhosted.org> Message-ID: <1554489228.35.0.209907677111.issue36490@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> needs patch title: Modernize function signature format in Archiving section of shutil doc -> Modernize function signature in Archiving section of shutil doc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:38:44 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 18:38:44 +0000 Subject: [issue36502] str.isspace() for U+00A0 and U+202F differs from document In-Reply-To: <1554186967.56.0.21483381742.issue36502@roundup.psfhosted.org> Message-ID: <1554489524.44.0.503280863531.issue36502@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: The behavior of str.isspace() for U+00A0 and U+202F is different from what is documented -> str.isspace() for U+00A0 and U+202F differs from document versions: -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:43:36 2019 From: report at bugs.python.org (Saim Raza) Date: Fri, 05 Apr 2019 18:43:36 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). Message-ID: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> New submission from Saim Raza : If pdb.set_trace() is the last statement in the first code snippet, variable 'err' is (wrongly?) excluded from locals(). Adding any code after the pdb.set_trace() statement makes 'err' available in locals. In [2]: try: ...: raise ValueError("I am ValueError") ...: except ValueError as err: ...: print("err" in locals()) ...: import pdb; pdb.set_trace() ...: True --Return-- > (5)()->None -> import pdb; pdb.set_trace() (Pdb) print("err" in locals()) False <-------------- BUG?? (Pdb) c In [3]: try: ...: raise ValueError("I am ValueError") ...: except ValueError as err: ...: print("err" in locals()) ...: import pdb; pdb.set_trace() ...: import os # Dummy code - makes variable 'err' available inside the debugger. ...: True > (6)()->None -> import os # Dummy code - makes variable err available inside debugger (Pdb) print("err" in locals()) True In [4]: sys.version_info Out[4]: sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0) FTR, the variable 'err' is available in both cases in case of Python 2.7. Also, this happens with ipdb as well. Please note that I am aware that I need to assign the variable 'err' to some variable inside the except block to access it outside the except block. However, the pdb statement is still inside the except block in both cases. ---------- components: Library (Lib) messages: 339510 nosy: Saim Raza priority: normal severity: normal status: open title: except statement block incorrectly assumes end of scope(?). type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 14:44:05 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 05 Apr 2019 18:44:05 +0000 Subject: [issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR In-Reply-To: <1553964458.43.0.741059488448.issue36488@roundup.psfhosted.org> Message-ID: <1554489845.25.0.336875274229.issue36488@roundup.psfhosted.org> Giampaolo Rodola' added the comment: sendfile() on BSD/OSX is complicated by the headers/trailers args. You'll have to take that into account in the retry logic, adding unnecessary complexity. Since sendfile() may already return fewer bytes than requested (e.g. non-blocking sockets or big files) it's just easier to return the bytes sent thus far (if any). I can work on a patch once I find some time. > Wasn't the point of PEP475 that all EINTR returns would be explicitly handled by retrying rather than forcing the user to handle it? >From PEP475: <<[...] to relieve application code from the burden of doing so>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:06:37 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 05 Apr 2019 19:06:37 +0000 Subject: [issue36535] Windows build failure when use the code from the GitHub master branch In-Reply-To: <1554462057.39.0.0549572180819.issue36535@roundup.psfhosted.org> Message-ID: <1554491197.8.0.698187785087.issue36535@roundup.psfhosted.org> Steve Dower added the comment: We added a new dependency. Run a build using PCbuild/build.bat and it will download it for you. Then building through VS should work again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:07:11 2019 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Fri, 05 Apr 2019 19:07:11 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554491231.35.0.952806803497.issue36532@roundup.psfhosted.org> Fred L. Drake, Jr. added the comment: Good catch, Vinay! Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:11:25 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 19:11:25 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1554491485.79.0.326077438536.issue36521@roundup.psfhosted.org> Terry J. Reedy added the comment: So we have the same issue with f.__name__ and f.__code__.co_name becoming unsynchronized. FWIW, I would prefer that the code docstring be co_doc, rather than hidden in co_constants, so that 'name' and 'doc' follow the same pattern. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:18:21 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 19:18:21 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1554491901.41.0.634703584176.issue36523@roundup.psfhosted.org> Terry J. Reedy added the comment: Verified. >>> import io >>> io.IOBase.writelines.__doc__ >>> ---------- nosy: +terry.reedy title: missing docs for IOBase writelines -> Add docstring to io.IOBase.writelines _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:20:37 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 19:20:37 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1554492037.91.0.338431587299.issue36523@roundup.psfhosted.org> Terry J. Reedy added the comment: I assume that this can be backported even though it touches .c rather than .rst. ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:25:03 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 05 Apr 2019 19:25:03 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1554492303.09.0.767223229513.issue36537@roundup.psfhosted.org> SilentGhost added the comment: Can confirm also on 3.6, but this seems to be something particular to set_trace, when pdb is entered via post_mortem, the variable is available in locals(). ---------- nosy: +SilentGhost, barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:33:28 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 05 Apr 2019 19:33:28 +0000 Subject: [issue36529] Python from WindowsStore: can't install package using "-m pip" In-Reply-To: <1554407848.88.0.523569372633.issue36529@roundup.psfhosted.org> Message-ID: <1554492808.55.0.0320747475103.issue36529@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 15:48:22 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 05 Apr 2019 19:48:22 +0000 Subject: [issue36495] Out-of-bounds array reads in Python/ast.c In-Reply-To: <1554043972.42.0.422033771745.issue36495@roundup.psfhosted.org> Message-ID: <1554493702.94.0.768779730891.issue36495@roundup.psfhosted.org> Change by Ivan Levkivskyi : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 16:07:07 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 05 Apr 2019 20:07:07 +0000 Subject: [issue36538] _thread.interrupt_main() no longer interrupts Lock.wait Message-ID: <1554494827.92.0.565969475506.issue36538@roundup.psfhosted.org> New submission from Gregory P. Smith : In Python 2.7 our threading implementation was so poor that a thread join ultimately called our lock wait implementation that busy looped polling and sleeping to check for a lock acquisition success. calling thread.interrupt_main() which is just PyErr_SetInterrupt() C API in disguise successfully broke out of that lock wait loop. In Python 3 with our drastically improved threading implementation, a lock wait is a pthreads sem_timedwait() or sem_trywait() API call, blocking within the pthreads library or OS kernel. PyErr_SetInterrupt() obviously has no effect on that. Only an actual signal arriving can interrupt that. Thus instead of code using _thread.interrupt_main() - in 2and3 compatible applications, six.moves._thread.interrupt_main() - they should instead write: os.kill(os.getpid(), signal.SIGINT) Given that _thread is a private module making _thread.interrupt_main() a private API, do we need to keep it? If we do, we should at least document this behavior and recommend actually sending the signal. It is less capable of actually interrupting the main thread from some common blocking operations today. Sending the signal seems like it would always be better. ---------- assignee: docs at python components: Documentation, Extension Modules, Library (Lib) messages: 339518 nosy: docs at python, gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: _thread.interrupt_main() no longer interrupts Lock.wait type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 16:35:14 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 05 Apr 2019 20:35:14 +0000 Subject: [issue35983] tp_dealloc trashcan shouldn't be called for subclasses In-Reply-To: <1550055751.42.0.717332216151.issue35983@roundup.psfhosted.org> Message-ID: <1554496514.8.0.900757617649.issue35983@roundup.psfhosted.org> Jeroen Demeyer added the comment: I realized that there is a nasty interaction between the trashcan and __del__: if you're very close to the trashcan limit and you're calling __del__, then objects that should have been deallocated in __del__ (in particular, an object involving self) might instead end up in the trashcan. So self might be resurrected when it shouldn't be. This is causing test failures in the 2.7 backport due to a different implementation of __del__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 17:13:22 2019 From: report at bugs.python.org (Dan Yeaw) Date: Fri, 05 Apr 2019 21:13:22 +0000 Subject: [issue36539] Distutils VC 6.0 Errors When Using mingw-w64 GCC Message-ID: <1554498802.41.0.202471650795.issue36539@roundup.psfhosted.org> New submission from Dan Yeaw : I am using the mingw-w64-x86_64-python3 in MSYS2 on Windows to package a PyGObject app. When I try to pip install the app, I am getting errors about the VC 6.0 isn't supported. It looks like setuptools is trying to patch distutils msvc. The msvc9compiler module in distutils uses a get_build_version function to get the version of MSVC on the system. This version of Python 3 is compiled with GCC 8.3.0 so the function doesn't find the "MSC v." prefix and returns version 6. Here is the full error: $ pip install -e . Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... error Complete output from command C:/tools/msys64/mingw64/bin/python3.exe C:/tools/msys64/mingw64/lib/python3.7/site-packages\pip install --ignore-installed --no-user --prefix C:/Users/dyeaw/AppData/Local/Temp/pip-build-env-bfwge_92/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- gaphas>=1.0.0,<2.0.0 PyGObject>=3.30,<4.0 pycairo>=1.18,<2.0 zope.component>=4.5,<5.0: Collecting gaphas<2.0.0,>=1.0.0 Using cached https://files.pythonhosted.org/packages/68/1d/4c8501535889538fe2144b5b8836fa2b3296e06d4a3d9f7e4e7e8cc1e90f/gaphas-1.0.0-py2.py3-none-any.whl Collecting PyGObject<4.0,>=3.30 Using cached https://files.pythonhosted.org/packages/0b/fd/56ac6898afc5c7f5718026103bd8f0b44714b6f79ac20d7eb8990c9a7eab/PyGObject-3.32.0.tar.gz Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'error' Complete output from command C:/tools/msys64/mingw64/bin/python3.exe C:/tools/msys64/mingw64/lib/python3.7/site-packages/pep517/_in_process.py get_requires_for_build_wheel C:/Users/dyeaw/AppData/Local/Temp/tmp8lre6w7i: Traceback (most recent call last): File "C:/tools/msys64/mingw64/lib/python3.7/site-packages/pep517/_in_process.py", line 207, in main() File "C:/tools/msys64/mingw64/lib/python3.7/site-packages/pep517/_in_process.py", line 197, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "C:/tools/msys64/mingw64/lib/python3.7/site-packages/pep517/_in_process.py", line 48, in get_requires_for_build_wheel backend = _build_backend() File "C:/tools/msys64/mingw64/lib/python3.7/site-packages/pep517/_in_process.py", line 34, in _build_backend obj = import_module(mod_path) File "C:/tools/msys64/mingw64/lib/python3.7\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 953, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "C:/Users/dyeaw/AppData/Local/Temp/pip-build-env-5pamh2nb/overlay/lib/python3.7/site-packages\setuptools\__init__.py", line 228, in monkey.patch_all() File "C:/Users/dyeaw/AppData/Local/Temp/pip-build-env-5pamh2nb/overlay/lib/python3.7/site-packages\setuptools\monkey.py", line 101, in patch_all patch_for_msvc_specialized_compiler() File "C:/Users/dyeaw/AppData/Local/Temp/pip-build-env-5pamh2nb/overlay/lib/python3.7/site-packages\setuptools\monkey.py", line 164, in patch_for_msvc_specialized_compiler patch_func(*msvc9('find_vcvarsall')) File "C:/Users/dyeaw/AppData/Local/Temp/pip-build-env-5pamh2nb/overlay/lib/python3.7/site-packages\setuptools\monkey.py", line 151, in patch_params mod = import_module(mod_name) File "C:/tools/msys64/mingw64/lib/python3.7\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "C:/tools/msys64/mingw64/lib/python3.7\distutils\msvc9compiler.py", line 296, in raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module Others are getting this error as well: https://stackoverflow.com/questions/52166914/msys2-mingw64-pip-vc-6-0-is-not-supported-by-this-module One way to fix may be to not raise the error if it occurs: VERSION = get_build_version() if VERSION < 8.0: - raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) + pass If you think this should be fixed in Setuptools to not try to patch distutils in this instance, or downstream in mingw-w64 packages, please point me in the right direction. I am also glad to help submit a PR if I can have some guidance on the best approach. ---------- components: Distutils messages: 339520 nosy: danyeaw, dstufft, eric.araujo priority: normal severity: normal status: open title: Distutils VC 6.0 Errors When Using mingw-w64 GCC type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 17:37:50 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 05 Apr 2019 21:37:50 +0000 Subject: [issue32280] Expose `_PyRuntime` through a section name In-Reply-To: <1513034681.19.0.213398074469.issue32280@psf.upfronthosting.co.za> Message-ID: <1554500270.11.0.228702455452.issue32280@roundup.psfhosted.org> Change by Eric Snow : ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 21:06:03 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 06 Apr 2019 01:06:03 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters Message-ID: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : This issue will serve to track development and PRs for the implementation of PEP 570: Python Positional-Only Parameters. ---------- assignee: pablogsal components: Interpreter Core messages: 339521 nosy: pablogsal priority: normal severity: normal status: open title: PEP 570: Python Positional-Only Parameters versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 21:06:36 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 06 Apr 2019 01:06:36 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1554512796.92.0.957995327023.issue36540@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +12625 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 21:12:08 2019 From: report at bugs.python.org (Eric N. Vander Weele) Date: Sat, 06 Apr 2019 01:12:08 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1554513128.8.0.3137599438.issue36540@roundup.psfhosted.org> Change by Eric N. Vander Weele : ---------- nosy: +ericvw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 21:41:20 2019 From: report at bugs.python.org (Tim Hatch) Date: Sat, 06 Apr 2019 01:41:20 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python Message-ID: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> New submission from Tim Hatch : The grammar in lib2to3 is out of date and can't parse `:=` nor `f(**not x)` from running on real code. I've done a cursory `diff -uw Grammar/Grammar Lib/lib2to3/grammar.txt`, and would like to fix lib2to3 so we can merge into both fissix and blib2to3, to avoid further divergence of the forks. I'm unsure if I need a separate bug per pull request, but need at least one to get started. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 339522 nosy: georg.brandl, lukasz.langa, thatch priority: normal severity: normal status: open title: Make lib2to3 grammar more closely match Python type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 21:42:20 2019 From: report at bugs.python.org (Roundup Robot) Date: Sat, 06 Apr 2019 01:42:20 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1554514940.68.0.95213216917.issue36541@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12626 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 21:55:27 2019 From: report at bugs.python.org (Tim Hatch) Date: Sat, 06 Apr 2019 01:55:27 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1554515727.68.0.223996970893.issue36541@roundup.psfhosted.org> Change by Tim Hatch : ---------- pull_requests: +12627 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 5 22:28:55 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 06 Apr 2019 02:28:55 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1554517735.27.0.641798299009.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: There is idea about reading docstring lazily, when func.__doc__ is accessed. I don't think the idea can be implemented by 3.8. But if we change code object now, I want new API can be used to implement this idea. One breaking change is better than two. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 00:27:51 2019 From: report at bugs.python.org (Manjusaka) Date: Sat, 06 Apr 2019 04:27:51 +0000 Subject: [issue36535] Windows build failure when use the code from the GitHub master branch In-Reply-To: <1554462057.39.0.0549572180819.issue36535@roundup.psfhosted.org> Message-ID: <1554524871.61.0.998860386901.issue36535@roundup.psfhosted.org> Manjusaka added the comment: Done,thx ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 00:28:28 2019 From: report at bugs.python.org (Manjusaka) Date: Sat, 06 Apr 2019 04:28:28 +0000 Subject: [issue36535] Windows build failure when use the code from the GitHub master branch In-Reply-To: <1554462057.39.0.0549572180819.issue36535@roundup.psfhosted.org> Message-ID: <1554524908.69.0.52841872629.issue36535@roundup.psfhosted.org> Change by Manjusaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 00:41:43 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 04:41:43 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1554525703.76.0.387210124022.issue36540@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 02:27:10 2019 From: report at bugs.python.org (Christoph Reiter) Date: Sat, 06 Apr 2019 06:27:10 +0000 Subject: [issue36539] Distutils VC 6.0 Errors When Using mingw-w64 GCC In-Reply-To: <1554498802.41.0.202471650795.issue36539@roundup.psfhosted.org> Message-ID: <1554532030.72.0.86554029368.issue36539@roundup.psfhosted.org> Christoph Reiter added the comment: MSYS2 patches setuptools to work with GCC and the MSYS2 Python, so you can't use setuptools as is from pip. See https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-setuptools for the current set of patches. ---------- nosy: +lazka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 02:44:03 2019 From: report at bugs.python.org (spaceman_spiff) Date: Sat, 06 Apr 2019 06:44:03 +0000 Subject: [issue36532] Example of logging.formatter with new str.format style In-Reply-To: <1554441254.46.0.943587700045.issue36532@roundup.psfhosted.org> Message-ID: <1554533043.19.0.958507482406.issue36532@roundup.psfhosted.org> spaceman_spiff added the comment: I was under the impression that this was all it takes to use loggers with the normal string.format syntax. e.g.: log.info('{}', 'Test') Turns out when I tested it I used f-strings in the first parameters - so I got it wrong. Imho this can be closed and the pr rejected. Sorry for wasting your time :) ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 03:19:46 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 07:19:46 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554535186.29.0.358682095896.issue36440@roundup.psfhosted.org> Serhiy Storchaka added the comment: Since the parser module did not work in 3.7, I think this will not harm. But in general new features (including changes in error messages) are added only in the developed version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 03:28:06 2019 From: report at bugs.python.org (Eryk Sun) Date: Sat, 06 Apr 2019 07:28:06 +0000 Subject: [issue36538] _thread.interrupt_main() no longer interrupts Lock.wait In-Reply-To: <1554494827.92.0.565969475506.issue36538@roundup.psfhosted.org> Message-ID: <1554535686.19.0.830037870996.issue36538@roundup.psfhosted.org> Eryk Sun added the comment: Windows doesn't implement POSIX signals in the kernel, so _thread.interrupt_main (i.e. PyErr_SetInterrupt) can be useful as an abstraction. Currently PyErr_SetInterrupt (Modules/signalmodule.c) doesn't set our SIGINT event in Windows. It was suggested in issue 29926 to replace the trip_signal call with raise(SIGINT). That works for Windows -- as long as we're not concerned about emulating Ctrl+C exactly as if the user typed it in the console (if we're attached to a console). In POSIX, raise(SIGINT) won't interrupt the main thread if it's in a blocking system call, since it targets pthread_self(), so PyErr_SetInterrupt can instead call kill(getpid(), SIGINT), as you suggest, or pthread_kill(main_thread, SIGINT). 3.8 adds signal.raise_signal (see issue 35568), so it's possible to implement this in pure Python. Either way, it would be nice to keep it as a cross-platform function, and hopefully make it public and documented. Another option would be to enhance our Windows implementation of os.kill to more closely match POSIX kill(), such that os.kill(os.getpid(), signal.SIGINT) is implemented as raise(SIGINT). That would be a breaking change since currently it calls TerminateProcess (an abrupt termination like POSIX SIGKILL). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 03:47:33 2019 From: report at bugs.python.org (Xavier Combelle) Date: Sat, 06 Apr 2019 07:47:33 +0000 Subject: [issue36440] more helpful diagnostics for parser module In-Reply-To: <1553614408.8.0.416681237128.issue36440@roundup.psfhosted.org> Message-ID: <1554536853.64.0.509183024347.issue36440@roundup.psfhosted.org> Change by Xavier Combelle : ---------- nosy: -xcombelle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 04:00:55 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 06 Apr 2019 08:00:55 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554537655.96.0.0289206656624.issue36533@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +12628 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 04:03:15 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 06 Apr 2019 08:03:15 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554537795.07.0.867276986969.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: Here's a PR that goes the re-initialization route rather than attempting to acquire/release anything other than the single module _lock. ---------- nosy: +lukasz.langa versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 04:33:41 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 08:33:41 +0000 Subject: [issue36542] Allow to overwrite the signature for Python functions Message-ID: <1554539621.71.0.0901781243935.issue36542@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently __text_signature__ can be used for specifying signature of functions implemented in C. It is ignored for functions implemented in Python. The proposed PR allows to override the real signature of Python functions by setting the __text_signature__ attribute. This is needed to restore useful signatures in functions that use the *args hack to implement positional-only parameters. See the discussion for PR 12637. ---------- components: Library (Lib) messages: 339530 nosy: gvanrossum, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Allow to overwrite the signature for Python functions type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 04:36:56 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 08:36:56 +0000 Subject: [issue36542] Allow to overwrite the signature for Python functions In-Reply-To: <1554539621.71.0.0901781243935.issue36542@roundup.psfhosted.org> Message-ID: <1554539816.79.0.238881527865.issue36542@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +12629 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 04:45:28 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 08:45:28 +0000 Subject: [issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem() In-Reply-To: <1544525657.6.0.788709270274.issue35459@psf.upfronthosting.co.za> Message-ID: <1554540328.25.0.413719588401.issue35459@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +12630 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 05:04:51 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 06 Apr 2019 09:04:51 +0000 Subject: [issue36527] unused parameter warnings in Include/object.h (affecting building third party code) In-Reply-To: <1554394121.78.0.720691487188.issue36527@roundup.psfhosted.org> Message-ID: <1554541491.77.0.249859967491.issue36527@roundup.psfhosted.org> Inada Naoki added the comment: New changeset a0da131a74acdb147ecd64d729c86d65fecd0cff by Inada Naoki (Dmitry Marakasov) in branch 'master': bpo-36527: silence -Wunused-parameter warnings in object.h (GH-12688) https://github.com/python/cpython/commit/a0da131a74acdb147ecd64d729c86d65fecd0cff ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 05:06:21 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 06 Apr 2019 09:06:21 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1554541581.83.0.364182439837.issue36050@roundup.psfhosted.org> Inada Naoki added the comment: New changeset d6bf6f2d0c83f0c64ce86e7b9340278627798090 by Inada Naoki in branch 'master': bpo-36050: optimize HTTPResponse.read() (GH-12698) https://github.com/python/cpython/commit/d6bf6f2d0c83f0c64ce86e7b9340278627798090 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 05:06:31 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 06 Apr 2019 09:06:31 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1554541591.93.0.643077593886.issue36050@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:06:22 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:06:22 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) Message-ID: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> New submission from Serhiy Storchaka : The proposed PR removes old-deprecated ElementTree features. * Methods Element.getchildren(), Element.getiterator() and ElementTree.getiterator() deprecated in 2.7 and 3.2. They were deprecated in the documentation only, and started to emit a warning in 3.8. Use list(elem) or iteration instead of getchildren(), methods iter() instead of getiterator(). * The xml.etree.cElementTree module deprecated in 3.3. It was deprecated documentation only because adding a runtime warning will cause more harm than removing it because of the common idiom of using it since Python 2: try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET TODO: Add a What's New entry after the start of developing 3.9. ---------- assignee: serhiy.storchaka components: XML messages: 339533 nosy: eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal status: open title: Remove old-deprecated ElementTree features (part 2) type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:13:29 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:13:29 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1554567209.85.0.42705836082.issue36543@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +12631 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:16:03 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:16:03 +0000 Subject: [issue29209] Remove old-deprecated ElementTree features In-Reply-To: <1483898185.03.0.0187159979308.issue29209@psf.upfronthosting.co.za> Message-ID: <1554567363.34.0.462063218926.issue29209@roundup.psfhosted.org> Serhiy Storchaka added the comment: The rest will be removed in issue36543. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:16:22 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:16:22 +0000 Subject: [issue36543] Remove old-deprecated ElementTree features (part 2) In-Reply-To: <1554566782.39.0.176680363975.issue36543@roundup.psfhosted.org> Message-ID: <1554567382.71.0.732794961033.issue36543@roundup.psfhosted.org> Serhiy Storchaka added the comment: See also issue29209. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:18:21 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 06 Apr 2019 16:18:21 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing Message-ID: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> New submission from Xavier de Gaye : Python is built natively in a docker container (based on ubuntu bionic) that lacks openssl. pydev at 979e9e009b08:~/build/python-native$ ./python Python 3.8.0a3+ (heads/master-dirty:d6bf6f2, Apr 6 2019, 14:43:30) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import hashlib ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha512 ERROR:root:code for hash blake2b was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type blake2b ERROR:root:code for hash blake2s was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type blake2s ERROR:root:code for hash sha3_224 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha3_224 ERROR:root:code for hash sha3_256 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha3_256 ERROR:root:code for hash sha3_384 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha3_384 ERROR:root:code for hash sha3_512 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha3_512 ERROR:root:code for hash shake_128 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type shake_128 ERROR:root:code for hash shake_256 was not found. Traceback (most recent call last): File "/home/pydev/cpython/Lib/hashlib.py", line 244, in globals()[__func_name] = __get_hash(__func_name) File "/home/pydev/cpython/Lib/hashlib.py", line 113, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type shake_256 >>> ---------- components: Build messages: 339536 nosy: vstinner, xdegaye priority: normal severity: normal stage: needs patch status: open title: cannot import hashlib when openssl is missing type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:24:57 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:24:57 +0000 Subject: [issue36506] [security] CVE-2019-10268: An arbitrary execution vulnerability exists in the built-in function getattr In-Reply-To: <1554216526.55.0.671553927904.issue36506@roundup.psfhosted.org> Message-ID: <1554567897.17.0.715633980991.issue36506@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:26:27 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 06 Apr 2019 16:26:27 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554567987.82.0.186519783757.issue36544@roundup.psfhosted.org> Xavier de Gaye added the comment: Changeset 5ec33a1c25a586552751ca35c85ab7ecb6b06ec3 appends to the new detect_openssl_hashlib() method, the detection for the _sha256, _sha512, _md5, ... extension modules. These modules were detected unconditionnaly before this change and are not detected anymore now when openssl is not supported by the platform. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:29:39 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 06 Apr 2019 16:29:39 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554568179.15.0.670855561874.issue36544@roundup.psfhosted.org> Xavier de Gaye added the comment: Working on a PR ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:50:45 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:50:45 +0000 Subject: [issue36504] Signed integer overflow in _ctypes.c's PyCArrayType_new() In-Reply-To: <1554199741.58.0.0522165887843.issue36504@roundup.psfhosted.org> Message-ID: <1554569445.36.0.93442450939.issue36504@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:56:48 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 06 Apr 2019 16:56:48 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554569808.88.0.0259002801845.issue36544@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +12632 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:56:48 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 06 Apr 2019 16:56:48 +0000 Subject: [issue36146] Refactor setup.py In-Reply-To: <1551368254.14.0.622163548129.issue36146@roundup.psfhosted.org> Message-ID: <1554569808.92.0.645657662419.issue36146@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- pull_requests: +12633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:57:46 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 06 Apr 2019 16:57:46 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554569866.05.0.312183746556.issue9883@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2ea8099523581cf2ecc060831a53debb57ff98ee by Serhiy Storchaka (Stefan Behnel) in branch 'master': bpo-9883: Update list of unimplemented interfaces in minidom. (GH-12677) https://github.com/python/cpython/commit/2ea8099523581cf2ecc060831a53debb57ff98ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 12:58:25 2019 From: report at bugs.python.org (miss-islington) Date: Sat, 06 Apr 2019 16:58:25 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554569905.2.0.376697900583.issue9883@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 13:07:14 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 06 Apr 2019 17:07:14 +0000 Subject: [issue36542] Allow to overwrite the signature for Python functions In-Reply-To: <1554539621.71.0.0901781243935.issue36542@roundup.psfhosted.org> Message-ID: <1554570434.78.0.000604194478099.issue36542@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 13:45:21 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 06 Apr 2019 17:45:21 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1554572721.43.0.118960801168.issue36537@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 14:03:38 2019 From: report at bugs.python.org (Steve Dower) Date: Sat, 06 Apr 2019 18:03:38 +0000 Subject: [issue36529] Python from WindowsStore: can't install package using "-m pip" In-Reply-To: <1554407848.88.0.523569372633.issue36529@roundup.psfhosted.org> Message-ID: <1554573818.45.0.783447287648.issue36529@roundup.psfhosted.org> Steve Dower added the comment: Yeah, right now you need to also pass --local when you use -m (the bundled pip.exe does this automatically). Your user account does not have permission to install into the global site directory. Once we update the bundled pip I can add a site-specific configuration file to handle both cases transparently (I had to enable it in pip first before we could make CPython handle it). ---------- assignee: -> steve.dower components: +Windows nosy: +tim.golden, zach.ware versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 14:04:09 2019 From: report at bugs.python.org (Philip Deegan) Date: Sat, 06 Apr 2019 18:04:09 +0000 Subject: [issue36545] Python 3.5 OOM during test_socket on make Message-ID: <1554573849.92.0.0783609732408.issue36545@roundup.psfhosted.org> New submission from Philip Deegan : Building Python 3.5.3 or 3.5.6 on my Kernel 5.0.2 Debian 9 install has runaway memory usage during "test_socket" while running make after ./configure CFLAGS="-g3 -O3 -march=native -fPIC -I/usr/include/openssl" CXXFLAGS="-g3 -O3 -march=native -fPIC -I/usr/include/openssl" --enable-shared LDFLAGS="-L/usr/lib -L/usr/lib/x86_64-linux-gnu -Wl,-rpath=/usr/lib/x86_64-linux-gnu" --prefix=$PWD --with-valgrind --enable-optimizations --with-ensurepip=install ---------- messages: 339541 nosy: dekken priority: normal severity: normal status: open title: Python 3.5 OOM during test_socket on make _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 14:46:55 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 06 Apr 2019 18:46:55 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1554576415.42.0.150282687376.issue36541@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 15:48:02 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 06 Apr 2019 19:48:02 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1554580082.12.0.893294687173.issue36537@roundup.psfhosted.org> Xavier de Gaye added the comment: This is not a bug. On the first pdb session from the OP: True --Return-- > (5)()->None -> import pdb; pdb.set_trace() (Pdb) print("err" in locals()) False <-------------- BUG?? Pdb has stopped on a '--Return--' line event, so we are already outside the scope of the except clause and the 'err' local variable cannot be accessed outside the except block. The following code snippet shows that pdb stops at the line following the set_trace() call: ================== def foo(): try: 1/0 except Exception as err: import pdb; pdb.set_trace() x= 1 foo() ================== And the corresponding pdb session: $ python foo.py > /path/to/foo.py(6)foo() -> x= 1 (Pdb) err *** NameError: name 'err' is not defined (Pdb) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 15:55:12 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 06 Apr 2019 19:55:12 +0000 Subject: [issue33775] argparse: the word 'default' (in help) is not marked as translatable In-Reply-To: <1528236755.92.0.592728768989.issue33775@psf.upfronthosting.co.za> Message-ID: <1554580512.96.0.779612193603.issue33775@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: @paul.j3 I assume this is an easy issue of wrapping "default" with _() at [0]. There doesn't seem to be any tests for localization in argparse. https://github.com/python/cpython/blob/2ea8099523581cf2ecc060831a53debb57ff98ee/Lib/argparse.py#L682 ---------- components: +Library (Lib) nosy: +paul.j3, xtreak versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:22:16 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 06 Apr 2019 21:22:16 +0000 Subject: [issue36546] Add quantiles() to the statistics module Message-ID: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> New submission from Raymond Hettinger : It is a common and useful data analysis technique to examine quartiles, deciles, and percentiles. It is especially helpful for comparing distinct datasets (heights of boys versus heights of girls) or for comparing against a reference distribution (empirical data versus a normal distribution for example). --- sample session --- >>> from statistics import NormalDist, quantiles >>> from pylab import plot # SAT exam scores >>> sat = NormalDist(1060, 195) >>> list(map(round, quantiles(sat, n=4))) # quartiles [928, 1060, 1192] >>> list(map(round, quantiles(sat, n=10))) # deciles [810, 896, 958, 1011, 1060, 1109, 1162, 1224, 1310] # Summarize a dataset >>> data = [110, 96, 155, 87, 98, 82, 156, 88, 172, 102, 91, 184, 105, 114, 104] >>> quantiles(data, n=2) # median [104.0] >>> quantiles(data, n=4) # quartiles [91.0, 104.0, 155.0] >>> quantiles(data, n=10) # deciles [85.0, 88.6, 95.0, 99.6, 104.0, 108.0, 122.2, 155.8, 176.8] # Assess when data is normally distributed by comparing quantiles >>> reference_dist = NormalDist.from_samples(data) >>> quantiles(reference_dist, n=4) [93.81594518619364, 116.26666666666667, 138.71738814713967] # Make a QQ plot to visualize how well the data matches a normal distribution # plot(quantiles(data, n=7), quantiles(reference_dist, n=7)) ---------- components: Library (Lib) messages: 339544 nosy: rhettinger priority: normal severity: normal status: open title: Add quantiles() to the statistics module type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:25:34 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 06 Apr 2019 21:25:34 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1554585934.23.0.755137886295.issue36546@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +12635 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:30:18 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 06 Apr 2019 21:30:18 +0000 Subject: [issue31369] re.RegexFlag is not included in __all__, makes type inference less useful In-Reply-To: <1504730402.58.0.544251648863.issue31369@psf.upfronthosting.co.za> Message-ID: <1554586218.43.0.903986591176.issue31369@roundup.psfhosted.org> Ivan Levkivskyi added the comment: I am totally fine with making RegexFlag public (this may be indeed useful for static typing purposes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:34:20 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 06 Apr 2019 21:34:20 +0000 Subject: [issue36517] typing.NamedTuple does not support mixins In-Reply-To: <1554296850.04.0.71784053328.issue36517@roundup.psfhosted.org> Message-ID: <1554586460.97.0.905165325599.issue36517@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Hm, it looks like we can support this. I however don't think the proposed "patch" is the right way to fix it, since this makes the implementation with and without a mixin quite different. Also I am not sure I will have time to work on this in the nearest month. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:35:44 2019 From: report at bugs.python.org (paul j3) Date: Sat, 06 Apr 2019 21:35:44 +0000 Subject: [issue33775] argparse: the word 'default' (in help) is not marked as translatable In-Reply-To: <1528236755.92.0.592728768989.issue33775@psf.upfronthosting.co.za> Message-ID: <1554586544.96.0.280222516236.issue33775@roundup.psfhosted.org> paul j3 added the comment: I haven't paid much attention to the localization issues in `argparse`. The issue is with the help modification done by the: class ArgumentDefaultsHelpFormatter help += ' (default: %(default)s)' This formatter is a convenience, not something critical. The programmer could always include that 'default' string in the help line with their preferred terminology. They don't have to use this formatter to show the default values in their help lines. _() is used mostly for error messages with the format msg = _('message %(value)s') raise Error( msg % args) So the following change might work: help += _(' (default: %(default)s)') But I'm not in a position to test it or evaluate its usefulness. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:38:29 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 06 Apr 2019 21:38:29 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1554586709.92.0.377901402168.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: https://patch-diff.githubusercontent.com/raw/python/cpython/pull/12710.diff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:40:03 2019 From: report at bugs.python.org (paul j3) Date: Sat, 06 Apr 2019 21:40:03 +0000 Subject: [issue33775] argparse: the word 'default' (in help) is not marked as translatable In-Reply-To: <1528236755.92.0.592728768989.issue33775@psf.upfronthosting.co.za> Message-ID: <1554586803.74.0.351279008979.issue33775@roundup.psfhosted.org> paul j3 added the comment: https://bugs.python.org/issue16786 points out that the 'version' action isn't localizable either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 17:52:06 2019 From: report at bugs.python.org (Saim Raza) Date: Sat, 06 Apr 2019 21:52:06 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1554587526.12.0.387205777765.issue36537@roundup.psfhosted.org> Saim Raza added the comment: https://docs.python.org/3/reference/compound_stmts.html#the-try-statement says ============= except E as N: foo ============= is converted to the following statement: ============= except E as N: try: foo finally: del N ============= In the examples in this thread, foo is 'import pdb; pdb.set_trace()'. So, I was expecting 'del N' to be executed only after executing foo. This implies that err should have been available in the scope. Further, isn't the code execution supposed to be stopped at the set_trace() line and not on the next line. Should it at least respect the scope (indentation) and not execute the '--Return--' line event until the user actually executes the next line (x=1 in your example)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 21:15:00 2019 From: report at bugs.python.org (Dan Yeaw) Date: Sun, 07 Apr 2019 01:15:00 +0000 Subject: [issue36539] Distutils VC 6.0 Errors When Using mingw-w64 GCC In-Reply-To: <1554498802.41.0.202471650795.issue36539@roundup.psfhosted.org> Message-ID: <1554599700.75.0.239460733066.issue36539@roundup.psfhosted.org> Dan Yeaw added the comment: lazka: Thanks for you response. You are correct, the issue was that I had a pip installed version of setuptools somehow. It sounds like you think that all issues should go downstream to fixing them in the MINGW-packages. I am OK with this, it just seams like there are many many issues with Python in MSYS2. Basics like virtualenvs aren't currently working at all. I will start submitting the issues I am having there with proposed fixes, and then we can push them upstream if we think there are things that the core Python team can help out with. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 21:22:39 2019 From: report at bugs.python.org (Inada Naoki) Date: Sun, 07 Apr 2019 01:22:39 +0000 Subject: [issue36527] unused parameter warnings in Include/object.h (affecting building third party code) In-Reply-To: <1554394121.78.0.720691487188.issue36527@roundup.psfhosted.org> Message-ID: <1554600159.98.0.465034422338.issue36527@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 21:57:01 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 07 Apr 2019 01:57:01 +0000 Subject: [issue36547] bedevere is not working Message-ID: <1554602221.86.0.735080241242.issue36547@roundup.psfhosted.org> New submission from Emmanuel Arias : Hi! I don't know if here is the correct place to this, but bedevere is not working from a day ago. ---------- messages: 339552 nosy: eamanu priority: normal severity: normal status: open title: bedevere is not working _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 22:53:53 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 07 Apr 2019 02:53:53 +0000 Subject: [issue33775] argparse: the word 'default' (in help) is not marked as translatable In-Reply-To: <1528236755.92.0.592728768989.issue33775@psf.upfronthosting.co.za> Message-ID: <1554605633.4.0.581056576965.issue33775@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- keywords: +patch pull_requests: +12636 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 22:53:53 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 07 Apr 2019 02:53:53 +0000 Subject: [issue16786] argparse doesn't offer localization interface for "version" action In-Reply-To: <1356527998.28.0.00679479762722.issue16786@psf.upfronthosting.co.za> Message-ID: <1554605633.46.0.956792452793.issue16786@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- pull_requests: +12637 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 22:55:57 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 07 Apr 2019 02:55:57 +0000 Subject: [issue36547] bedevere is not working In-Reply-To: <1554602221.86.0.735080241242.issue36547@roundup.psfhosted.org> Message-ID: <1554605757.9.0.78907916631.issue36547@roundup.psfhosted.org> Emmanuel Arias added the comment: https://github.com/python/bedevere/issues/162 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 23:06:16 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 07 Apr 2019 03:06:16 +0000 Subject: [issue36547] bedevere is not working In-Reply-To: <1554602221.86.0.735080241242.issue36547@roundup.psfhosted.org> Message-ID: <1554606376.7.0.657639558665.issue36547@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is a workflow issue and already seems to have a report. I am closing this as third party. Please don't create issues related to workflow or one of the bots here since they have separate GitHub repos where their development takes place. ---------- nosy: +xtreak resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 6 23:33:52 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 07 Apr 2019 03:33:52 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1554608032.44.0.854173470283.issue36546@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 00:47:53 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 04:47:53 +0000 Subject: [issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive In-Reply-To: <1497403539.2.0.760105950979.issue30661@psf.upfronthosting.co.za> Message-ID: <1554612473.96.0.731322426599.issue30661@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset 89a894403cfa880d7f9d1d67070f61456d14cbde by Nick Coghlan (CAM Gerlach) in branch 'master': bpo-30661: Improve docs for tarfile pax change and effect on shutil (GH-12635) https://github.com/python/cpython/commit/89a894403cfa880d7f9d1d67070f61456d14cbde ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 00:50:17 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 04:50:17 +0000 Subject: [issue30661] Support tarfile.PAX_FORMAT in shutil.make_archive In-Reply-To: <1497403539.2.0.760105950979.issue30661@psf.upfronthosting.co.za> Message-ID: <1554612617.3.0.0380598822995.issue30661@roundup.psfhosted.org> Nick Coghlan added the comment: Thanks for the technical clarification Lars, and for the docs update C.A.M. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 01:15:06 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 07 Apr 2019 05:15:06 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554614106.33.0.312404316446.issue9883@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12638 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 02:46:19 2019 From: report at bugs.python.org (py.user) Date: Sun, 07 Apr 2019 06:46:19 +0000 Subject: [issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default In-Reply-To: <1473217852.97.0.553971829799.issue27992@psf.upfronthosting.co.za> Message-ID: <1554619579.01.0.544108051552.issue27992@roundup.psfhosted.org> py.user added the comment: @Karthikeyan Singaravelan Thank you for the point. I added a new patch. ---------- Added file: https://bugs.python.org/file48245/argparse_sys-argv-0-basename.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 02:48:42 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 07 Apr 2019 06:48:42 +0000 Subject: [issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default In-Reply-To: <1473217852.97.0.553971829799.issue27992@psf.upfronthosting.co.za> Message-ID: <1554619722.5.0.749180541109.issue27992@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: CPython now accepts GitHub PRs. Please see the workflow at https://devguide.python.org . You can raise a PR against master branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 03:48:06 2019 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 07 Apr 2019 07:48:06 +0000 Subject: [issue35726] QueueHandler formatting affects other handlers In-Reply-To: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org> Message-ID: <1554623286.71.0.194775027065.issue35726@roundup.psfhosted.org> Change by Vinay Sajip : ---------- pull_requests: -11460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 03:48:12 2019 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 07 Apr 2019 07:48:12 +0000 Subject: [issue35726] QueueHandler formatting affects other handlers In-Reply-To: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org> Message-ID: <1554623292.73.0.641975306006.issue35726@roundup.psfhosted.org> Change by Vinay Sajip : ---------- pull_requests: -11459 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 03:48:19 2019 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 07 Apr 2019 07:48:19 +0000 Subject: [issue35726] QueueHandler formatting affects other handlers In-Reply-To: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org> Message-ID: <1554623299.26.0.383244058342.issue35726@roundup.psfhosted.org> Change by Vinay Sajip : ---------- pull_requests: -11458 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 03:51:40 2019 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 07 Apr 2019 07:51:40 +0000 Subject: [issue35726] QueueHandler formatting affects other handlers In-Reply-To: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org> Message-ID: <1554623500.91.0.42655966427.issue35726@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 2dad96013ca24abdc5ba5a369ea42d70ff02487a by Vinay Sajip (Xtreak) in branch 'master': bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) https://github.com/python/cpython/commit/2dad96013ca24abdc5ba5a369ea42d70ff02487a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 03:52:00 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 07 Apr 2019 07:52:00 +0000 Subject: [issue35726] QueueHandler formatting affects other handlers In-Reply-To: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org> Message-ID: <1554623520.55.0.426269743554.issue35726@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12639 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 04:00:48 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 08:00:48 +0000 Subject: [issue35936] Give modulefinder some much-needed updates. In-Reply-To: <1549596039.09.0.478412891062.issue35936@roundup.psfhosted.org> Message-ID: <1554624048.26.0.313543827426.issue35936@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset 9d7b2c0909b78800d1376fd696f73824ea680463 by Nick Coghlan (Brandt Bucher) in branch 'master': bpo-35936: Updates to modulefinder (GH-11787) https://github.com/python/cpython/commit/9d7b2c0909b78800d1376fd696f73824ea680463 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 04:03:40 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 08:03:40 +0000 Subject: [issue35936] Give modulefinder some much-needed updates. In-Reply-To: <1549596039.09.0.478412891062.issue35936@roundup.psfhosted.org> Message-ID: <1554624220.41.0.990705192945.issue35936@roundup.psfhosted.org> Nick Coghlan added the comment: Thanks Brandt! I'll also go back and close #17396, #35376, and #25160 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 04:06:01 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 08:06:01 +0000 Subject: [issue17396] modulefinder fails if module contains syntax error In-Reply-To: <1363003425.82.0.865184669213.issue17396@psf.upfronthosting.co.za> Message-ID: <1554624361.34.0.570802144699.issue17396@roundup.psfhosted.org> Nick Coghlan added the comment: Fixed for Python 3.8 via the patch for #35936. We won't be backporting that patch as it also migrates modulefinder from the deprecated imp API to support importlib one, and is hence considered overly intrusive for a bug fix release. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 04:06:56 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 08:06:56 +0000 Subject: [issue35376] modulefinder skips nested modules with same name as top-level bad module In-Reply-To: <1543762855.5.0.788709270274.issue35376@psf.upfronthosting.co.za> Message-ID: <1554624416.88.0.0842599017044.issue35376@roundup.psfhosted.org> Nick Coghlan added the comment: Fixed for Python 3.8 via the patch for #35936. We won't be backporting that patch as it also migrates modulefinder from the deprecated imp API to the supported importlib one, and is hence considered overly intrusive for a bug fix release. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 04:07:41 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 08:07:41 +0000 Subject: [issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning In-Reply-To: <1442559979.71.0.954965412351.issue25160@psf.upfronthosting.co.za> Message-ID: <1554624461.18.0.498273719073.issue25160@roundup.psfhosted.org> Nick Coghlan added the comment: Fixed for Python 3.8 via the patch for #35936. ---------- nosy: +ncoghlan resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 04:09:12 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 08:09:12 +0000 Subject: [issue25160] Stop using deprecated imp module; imp should now emit a real DeprecationWarning In-Reply-To: <1442559979.71.0.954965412351.issue25160@psf.upfronthosting.co.za> Message-ID: <1554624552.31.0.995036859204.issue25160@roundup.psfhosted.org> Nick Coghlan added the comment: Oops, this covers more than just modulefinder - reopening until the other remaining uses of the imp module have been removed. ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 05:29:42 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 07 Apr 2019 09:29:42 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1554629382.25.0.314812126828.issue36537@roundup.psfhosted.org> Xavier de Gaye added the comment: @Saim wrote > https://docs.python.org/3/reference/compound_stmts.html#the-try-statement says This is correct, the disassembly of foo.py below demonstrates that point: BEGIN_FINALLY at bytecode index 36 starts the implementation of the 'finally' clause that deletes 'err'. But pdb is a line debugger, not a debugger at the bytecode level, so when 'foo = 1' is replaced by 'import pdb; pdb.set_trace()', the first line where pdb may stop is at line 6 and since foo() last line is line 5, pdb stops at the 'return' event for this function. ======= foo.py ======== def foo(): try: 1/0 except Exception as err: foo = 1 import dis dis.dis(foo) =========================== 2 0 SETUP_FINALLY 12 (to 14) 3 2 LOAD_CONST 1 (1) 4 LOAD_CONST 2 (0) 6 BINARY_TRUE_DIVIDE 8 POP_TOP 10 POP_BLOCK 12 JUMP_FORWARD 38 (to 52) 4 >> 14 DUP_TOP 16 LOAD_GLOBAL 0 (Exception) 18 COMPARE_OP 10 (exception match) 20 POP_JUMP_IF_FALSE 50 22 POP_TOP 24 STORE_FAST 0 (err) 26 POP_TOP 28 SETUP_FINALLY 8 (to 38) 5 30 LOAD_CONST 1 (1) 32 STORE_FAST 1 (foo) 34 POP_BLOCK 36 BEGIN_FINALLY >> 38 LOAD_CONST 0 (None) 40 STORE_FAST 0 (err) 42 DELETE_FAST 0 (err) 44 END_FINALLY 46 POP_EXCEPT 48 JUMP_FORWARD 2 (to 52) >> 50 END_FINALLY >> 52 LOAD_CONST 0 (None) 54 RETURN_VALUE =========================== ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 06:28:01 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 07 Apr 2019 10:28:01 +0000 Subject: [issue36548] Make the repr of re flags more readable Message-ID: <1554632881.49.0.427945168441.issue36548@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently the repr of re flags contains the name of the private class and it is not an evaluable expression: >>> re.I >>> re.I|re.S|re.X The repr of inverted flags is even more verbose: >>> ~(re.I|re.S|re.X) The result of str() starves from the same issues. >>> print(re.I) RegexFlag.IGNORECASE >>> print(re.I|re.S|re.X) RegexFlag.VERBOSE|DOTALL|IGNORECASE >>> print(~re.I) RegexFlag.ASCII|DEBUG|VERBOSE|UNICODE|DOTALL|MULTILINE|LOCALE|TEMPLATE >>> print(~(re.I|re.S|re.X)) RegexFlag.ASCII|DEBUG|UNICODE|MULTILINE|LOCALE|TEMPLATE If the value contains unrecognized flags, it looks even more weird, and this information is not shown for invered flags: >>> re.I|re.S|re.X|(1<<10) >>> ~(re.I|re.S|re.X|(1<<10)) >>> print(re.I|re.S|re.X|(1<<10)) RegexFlag.1024|VERBOSE|DOTALL|IGNORECASE >>> print(~(re.I|re.S|re.X|(1<<10))) RegexFlag.ASCII|DEBUG|UNICODE|MULTILINE|LOCALE|TEMPLATE This repr is also not consistent with the represenation of flags in the repr of the compiled pattern: >>> re.compile('x', re.I|re.S|re.X) re.compile('x', re.IGNORECASE|re.DOTALL|re.VERBOSE) The proposed PR makes the repr be the same as for flags in the repr of the compiled pattern and represents inverted flags as the result of inversion: >>> re.I re.IGNORECASE >>> re.I|re.S|re.X re.IGNORECASE|re.DOTALL|re.VERBOSE >>> ~re.I ~re.IGNORECASE >>> ~(re.I|re.S|re.X) ~(re.IGNORECASE|re.DOTALL|re.VERBOSE) >>> re.I|re.S|re.X|(1<<10) re.IGNORECASE|re.DOTALL|re.VERBOSE|0x400 >>> ~(re.I|re.S|re.X|(1<<10)) ~(re.IGNORECASE|re.DOTALL|re.VERBOSE|0x400) __str__ is set to object.__str__, so that str() will return the same as repr(). ---------- components: Library (Lib), Regular Expressions messages: 339567 nosy: ethan.furman, ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal status: open title: Make the repr of re flags more readable type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 06:31:22 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 07 Apr 2019 10:31:22 +0000 Subject: [issue36548] Make the repr of re flags more readable In-Reply-To: <1554632881.49.0.427945168441.issue36548@roundup.psfhosted.org> Message-ID: <1554633082.7.0.908371221655.issue36548@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +12640 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 06:40:51 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 07 Apr 2019 10:40:51 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase Message-ID: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> New submission from Steven D'Aprano : str.capitalize appears to uppercase the first character of the string, which is okay for ASCII but not for non-English letters. For example, the letter NJ in Croatian appears as Nj at the start of words when the first character is capitalized: ?ema?ka ('Germany'), not ?ema?ka. (In ASCII, that's Njemacka not NJemacka.) https://en.wikipedia.org/wiki/Gaj's_Latin_alphabet#Digraphs But using any of: U+01CA LATIN CAPITAL LETTER NJ U+01CB LATIN CAPITAL LETTER N WITH SMALL LETTER J U+01CC LATIN SMALL LETTER NJ we get the wrong result with capitalize: py> '?ema?ka'.capitalize() '?ema?ka' py> '?ema?ka'.capitalize() '?ema?ka' py> '?ema?ka'.capitalize() '?ema?ka' I believe that the correct behaviour is to titlecase the first code point and lowercase the rest, which is what the Apache library here does: https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#capitalize-java.lang.String- ---------- messages: 339568 nosy: steven.daprano priority: normal severity: normal status: open title: str.capitalize should titlecase the first character not uppercase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 06:57:09 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 07 Apr 2019 10:57:09 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554634629.12.0.825648831107.issue36544@roundup.psfhosted.org> Xavier de Gaye added the comment: Steps to reproduce (requires docker support, about 500 MB and only few minutes): 1. Create the file named 'Dockerfile' whose content is: #################################### FROM ubuntu RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ bash \ build-essential \ git \ sed \ && rm -rf /var/lib/apt/lists/* # Run as user 'pydev'. RUN groupadd pydev && useradd --no-log-init -m -g pydev pydev USER pydev:pydev ENV HOME=/home/pydev WORKDIR $HOME #################################### 2. Create the ubuntu:bpo-36544 image $ docker build --tag=ubuntu:bpo-36544 . 3. Run the image and enters bash as user pydev $ docker run -it ubuntu:bpo-36544 As user pydev, build python and import hashlib: pydev at 5a8ffc33955d:~$ git clone -b master --single-branch --depth 1 https://github.com/python/cpython.git pydev at 70e0722a76f2:~$ cd cpython/ && ./configure && make pydev at 70e0722a76f2:~/cpython$ ./python -c "import hashlib" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 06:57:19 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 07 Apr 2019 10:57:19 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1554634639.0.0.0312020121261.issue36549@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think this is a reasonable change. Also the docs for str.title() should be fixed. ---------- components: +Interpreter Core, Unicode keywords: +easy (C) nosy: +ezio.melotti, serhiy.storchaka, vstinner stage: -> needs patch type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 07:21:49 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 07 Apr 2019 11:21:49 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554636109.58.0.211924612403.issue36544@roundup.psfhosted.org> Xavier de Gaye added the comment: Check that PR 12708 fixes the bug: Run the ubuntu:bpo-36544 image and enters bash as user pydev $ docker run -it ubuntu:bpo-36544 As user pydev, clone python and fetch PR 12708, build python and import hashlib: pydev at e4cfd6f74c2b:~$ git clone -b master --single-branch --depth 1 https://github.com/python/cpython.git pydev at e4cfd6f74c2b:~$ cd cpython/ && ./configure && make pydev at e4cfd6f74c2b:~/cpython$ git fetch --depth 1 origin pull/12708/head:pr_12708 && git checkout pr_12708 pydev at e4cfd6f74c2b:~/cpython$ make pydev at e4cfd6f74c2b:~/cpython$ ./python -c "import hashlib" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 07:49:32 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 11:49:32 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1554637772.21.0.43095820994.issue36384@roundup.psfhosted.org> Nick Coghlan added the comment: The recommended handling in the article that Serhiy mentions is to strip the leading zeroes, which the ipaddress module will still do - it's only being made more tolerant on input. That means it will become usable as a prefilter step (pass string with potentially leading zeroes to ipaddress, get string with no leading zeroes out). So that means the one part we missed is the docs update (together with a versionchanged note in the module docs themselves) ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 07:52:51 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 11:52:51 +0000 Subject: [issue36053] pkgutil.walk_packages jumps out from given path if there is package with the same name in sys.path In-Reply-To: <1550680627.64.0.854320242724.issue36053@roundup.psfhosted.org> Message-ID: <1554637971.35.0.638465269823.issue36053@roundup.psfhosted.org> Nick Coghlan added the comment: Piotr: does it always jump out, or does it only jump out if the relevant module has already been imported? (The tests for walk_packages are relatively weak and never generate conflicting names, so it's entirely plausible that there are caching side effects that make it do strange things) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 07:58:09 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 11:58:09 +0000 Subject: [issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion In-Reply-To: <1536176195.07.0.56676864532.issue34589@psf.upfronthosting.co.za> Message-ID: <1554638289.4.0.136795357667.issue34589@roundup.psfhosted.org> Nick Coghlan added the comment: I'm inclined to leave 3.7 alone unless/until we get an actual bug report for the current behaviour - if an embedder finds that it just straight up doesn't work for them, then they can either resort to tinkering with the private APIs (since they won't change until Python 3.8, and at that point we expect to have a public API available), or else stick with Python 3.6 until later this year when Python 3.8 is available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 08:00:16 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 07 Apr 2019 12:00:16 +0000 Subject: [issue14017] Make it easy to create a new TextIOWrapper based on an existing In-Reply-To: <1329263373.63.0.201487376726.issue14017@psf.upfronthosting.co.za> Message-ID: <1554638416.37.0.938319778582.issue14017@roundup.psfhosted.org> Nick Coghlan added the comment: Aye, let's close this for now - swapping streams out has enough other problems with stale references to the original stream that using reconfigure() to update the existing stream in place is usually going to be the better option. ---------- resolution: -> postponed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 10:32:44 2019 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 07 Apr 2019 14:32:44 +0000 Subject: [issue2180] tokenize: mishandles line joining In-Reply-To: <1203904758.19.0.84784431119.issue2180@psf.upfronthosting.co.za> Message-ID: <1554647564.65.0.223867389993.issue2180@roundup.psfhosted.org> Anthony Sottile added the comment: Here's an example in the wild which still reproduces with python3.8a3: https://github.com/SecureAuthCorp/impacket/blob/194b22ed2fc85c4f241375fb7ebe4e0d89626c8c/impacket/examples/remcomsvc.py#L1669 This was reported as a bug on flake8: https://gitlab.com/pycqa/flake8/issues/532 Here's the reproduction with python3.8: $ python3.8 --version --version Python 3.8.0a3 (default, Mar 27 2019, 03:46:44) [GCC 7.3.0] $ python3.8 impacket/examples/remcomsvc.py $ python3.8 -mtokenize impacket/examples/remcomsvc.py impacket/examples/remcomsvc.py:1670:0: error: EOF in multi-line statement ---------- nosy: +Anthony Sottile versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 11:06:57 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 07 Apr 2019 15:06:57 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1554649617.07.0.959997133493.issue36537@roundup.psfhosted.org> Xavier de Gaye added the comment: The *** Tracing *** section [1] of Objects/lnotab_notes.txt in the cpython repository provides detailed explanations for when the line trace function is called. [1] https://github.com/python/cpython/blob/9d7b2c0909b78800d1376fd696f73824ea680463/Objects/lnotab_notes.txt#L63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 11:23:48 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 07 Apr 2019 15:23:48 +0000 Subject: [issue35726] QueueHandler formatting affects other handlers In-Reply-To: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org> Message-ID: <1554650628.53.0.0147033537264.issue35726@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: +12641 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 11:27:29 2019 From: report at bugs.python.org (py.user) Date: Sun, 07 Apr 2019 15:27:29 +0000 Subject: [issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default In-Reply-To: <1473217852.97.0.553971829799.issue27992@psf.upfronthosting.co.za> Message-ID: <1554650849.41.0.228460960918.issue27992@roundup.psfhosted.org> Change by py.user : ---------- pull_requests: +12642 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 11:57:12 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Sun, 07 Apr 2019 15:57:12 +0000 Subject: [issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR In-Reply-To: <1553964458.43.0.741059488448.issue36488@roundup.psfhosted.org> Message-ID: <1554652632.26.0.470224468537.issue36488@roundup.psfhosted.org> Josh Rosenberg added the comment: Right. So this is a hard problem for anyone to solve, and therefore os.sendfile should be the one solving it, not the caller of sendfile, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 12:20:06 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 07 Apr 2019 16:20:06 +0000 Subject: [issue27181] Add geometric mean to `statistics` module In-Reply-To: <1464901494.08.0.0111988914026.issue27181@psf.upfronthosting.co.za> Message-ID: <1554654006.25.0.398894556749.issue27181@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 6463ba3061bd311413d2951dc83c565907e10459 by Raymond Hettinger in branch 'master': bpo-27181: Add statistics.geometric_mean() (GH-12638) https://github.com/python/cpython/commit/6463ba3061bd311413d2951dc83c565907e10459 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 12:21:07 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 07 Apr 2019 16:21:07 +0000 Subject: [issue27181] Add geometric mean to `statistics` module In-Reply-To: <1464901494.08.0.0111988914026.issue27181@psf.upfronthosting.co.za> Message-ID: <1554654067.86.0.338230924457.issue27181@roundup.psfhosted.org> Raymond Hettinger added the comment: Feel free to reopen this if something further needed to be changed or discussed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 13:35:23 2019 From: report at bugs.python.org (Jesse Farnham) Date: Sun, 07 Apr 2019 17:35:23 +0000 Subject: [issue36259] exception text is being sourced from the wrong file In-Reply-To: <1552269076.95.0.121796097495.issue36259@roundup.psfhosted.org> Message-ID: <1554658523.04.0.912390615112.issue36259@roundup.psfhosted.org> Change by Jesse Farnham : ---------- nosy: +jesse.farnham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 13:44:46 2019 From: report at bugs.python.org (Jesse Farnham) Date: Sun, 07 Apr 2019 17:44:46 +0000 Subject: [issue36259] exception text is being sourced from the wrong file In-Reply-To: <1552269076.95.0.121796097495.issue36259@roundup.psfhosted.org> Message-ID: <1554659086.68.0.0729992909602.issue36259@roundup.psfhosted.org> Jesse Farnham added the comment: I did some digging into this, and the problem seems to be that _Py_FindSourceFile() in traceback.c searches through every directory in sys.path (of which the first entry is the working directory) to find a file with the passed filename. So if there's a file in the working directory with name matching the filename passed in from the traceback object, _Py_FindSourceFile will find that one, resulting in the wrong listing being printed. Does the traceback object contain any other information that would avoid the need to search sys.path to find the right file? If it can know the file name, maybe there's a way to find the file path as well? Apologies if this is not useful -- this is my first attempt to contribute to Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 15:04:59 2019 From: report at bugs.python.org (Jesse Farnham) Date: Sun, 07 Apr 2019 19:04:59 +0000 Subject: [issue36259] exception text is being sourced from the wrong file In-Reply-To: <1552269076.95.0.121796097495.issue36259@roundup.psfhosted.org> Message-ID: <1554663899.51.0.829634415325.issue36259@roundup.psfhosted.org> Jesse Farnham added the comment: Upon further digging, the filename to search for ultimately comes from the PyCodeObject where the error occurred. So a possible solution could be to populate the PyCodeObject with the absolute path to the file when it?s first created in compilation. Then no searching is needed and the problem doesn?t happen. This seems like a potentially very invasive change, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 15:15:47 2019 From: report at bugs.python.org (daniel hahler) Date: Sun, 07 Apr 2019 19:15:47 +0000 Subject: [issue36550] Avoid creating AttributeError exceptions in the debugger Message-ID: <1554664547.38.0.626848411176.issue36550@roundup.psfhosted.org> New submission from daniel hahler : pdb should try (hard) to avoid creating unnecessary exceptions, e.g. ``AttributeError`` when looking up commands, since this will show up in exception chains then (as "'Pdb' object has no attribute 'do_foo'"). See https://github.com/python/cpython/pull/4666 for an older PR in this regard. My use case is to display the traceback for exceptions caused within/via Pdb.default(), to see more context when running code from pdb's prompt directly, where currently it would only display the exception itself. ---------- components: Library (Lib) messages: 339583 nosy: blueyed priority: normal severity: normal status: open title: Avoid creating AttributeError exceptions in the debugger versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 15:16:02 2019 From: report at bugs.python.org (daniel hahler) Date: Sun, 07 Apr 2019 19:16:02 +0000 Subject: [issue36550] Avoid creating AttributeError exceptions in the debugger In-Reply-To: <1554664547.38.0.626848411176.issue36550@roundup.psfhosted.org> Message-ID: <1554664562.82.0.291603414089.issue36550@roundup.psfhosted.org> Change by daniel hahler : ---------- keywords: +patch pull_requests: +12643 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 19:37:17 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 07 Apr 2019 23:37:17 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1554680237.01.0.0781025285543.issue36546@roundup.psfhosted.org> Steven D'Aprano added the comment: I think adding quantiles (sometimes called fractiles) is a good feature to add. I especially have some use-cases for quartiles. I especially like that it delegates to the inv_cdf() method when available, and I'm happy with the API you suggested. Forgive me if you're already aware of this, but the calculation of quantiles is unfortunately complicated by the fact that there are so many different ways to calculate them. (I see you have mentioned a potential future API for interp_method.) See, for example: http://jse.amstat.org/v14n3/langford.html for a discussion. My own incomplete survey of statistics software has found about 20 distinct methods for calculating quantiles in use. I'm very happy to see this function added, but I'm not happy to commit to a specific calculation method without discussion. If you agree that we can change the implementation later (and hence the specific cut points returned) then I see no reason why we can't get this in before feature freeze, and then do a review to find the "best" default implementation later. I already have three candidates: 1. Langford suggests his "CDF method 4", which is equivalent to Hyndman and Fan's Definition 2; it is also the default method used by SAS. 2. Hyndman and Fan themselves recommend their Definition 8: https://robjhyndman.com/publications/quantiles/ 3. R's default is H&F's Definition 7. (I suggest this only to ease comparisons with results from R, not because it has any statistical advantage.) Do we agree that there is to be no backwards-compatibility guarantee made on the implementation and the specific cut-points returned? (Or at least not yet.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 20:51:35 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 00:51:35 +0000 Subject: [issue36503] remove references to aix3 and aix4 in \*.py In-Reply-To: <1554196876.37.0.11821989431.issue36503@roundup.psfhosted.org> Message-ID: <1554684695.63.0.4428087945.issue36503@roundup.psfhosted.org> Inada Naoki added the comment: New changeset b7eec94c0e86f8ac318b135ca9146fff32b7203a by Inada Naoki (Michael Felt) in branch 'master': bpo-36503: remove references to 'aix3' and 'aix4' (GH-12658) https://github.com/python/cpython/commit/b7eec94c0e86f8ac318b135ca9146fff32b7203a ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 20:52:09 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 00:52:09 +0000 Subject: [issue36503] remove references to aix3 and aix4 in \*.py In-Reply-To: <1554196876.37.0.11821989431.issue36503@roundup.psfhosted.org> Message-ID: <1554684729.57.0.121381941053.issue36503@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 21:28:22 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 01:28:22 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow Message-ID: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> New submission from anthony shaw : List comprehensions currently create a series of opcodes inside a code object, the first of which is BUILD_LIST with an oparg of 0, effectively creating a zero-length list with a preallocated size of 0. If you're doing a simple list comprehension on an iterator, e.g. def foo(): a = iterable return [x for x in a] Disassembly of at 0x109db2c40, file "", line 3>: 3 0 BUILD_LIST 0 2 LOAD_FAST 0 (.0) >> 4 FOR_ITER 8 (to 14) 6 STORE_FAST 1 (x) 8 LOAD_FAST 1 (x) 10 LIST_APPEND 2 12 JUMP_ABSOLUTE 4 >> 14 RETURN_VALUE The list comprehension will do a list_resize on the 4, 8, 16, 25, 35, 46, 58, 72, 88th iterations, etc. This PR preallocates the list created in a list comprehension to the length of the iterator using PyObject_LengthHint(). It uses a new BUILD_LIST_PREALLOC opcode which builds a list with the allocated size of PyObject_LengthHint(co_varnames[oparg]). [x for x in iterable] compiles to: Disassembly of at 0x109db2c40, file "", line 3>: 3 0 BUILD_LIST_PREALLOC 0 2 LOAD_FAST 0 (.0) >> 4 FOR_ITER 8 (to 14) 6 STORE_FAST 1 (x) 8 LOAD_FAST 1 (x) 10 LIST_APPEND 2 12 JUMP_ABSOLUTE 4 >> 14 RETURN_VALUE If the comprehension has ifs, then it will use the existing BUILD_LIST opcode Testing using a range length of 10000 ./python.exe -m timeit "x=list(range(10000)); [y for y in x]" Gives 392us on the current 3.8 branch and 372us with this change (about 8-10% faster) the longer the iterable, the bigger the impact. This change also catches the issue that a very large iterator, like a range object : [a for a in range(2**256)] Would cause the 3.8< interpreter to consume all memory and crash because there is no check against PY_SSIZE_MAX currently. With this change (assuming there is no if inside the comprehension) is now caught and thrown as an OverflowError: >>> [a for a in range(2**256)] Traceback (most recent call last): File "", line 1, in File "", line 1, in OverflowError: Python int too large to convert to C ssize_t ---------- components: Interpreter Core messages: 339586 nosy: anthony shaw, ncoghlan priority: normal severity: normal status: open title: Optimize list comprehensions with preallocate size and protect against overflow versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 21:28:57 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 01:28:57 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554686937.36.0.143653378997.issue36551@roundup.psfhosted.org> Change by anthony shaw : ---------- keywords: +patch pull_requests: +12644 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 21:29:37 2019 From: report at bugs.python.org (LihuaZhao) Date: Mon, 08 Apr 2019 01:29:37 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1554686977.17.0.808196561224.issue31904@roundup.psfhosted.org> Change by LihuaZhao : ---------- pull_requests: +12645 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 21:46:48 2019 From: report at bugs.python.org (Aaron Hall) Date: Mon, 08 Apr 2019 01:46:48 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554688008.84.0.425607178166.issue36551@roundup.psfhosted.org> Change by Aaron Hall : ---------- nosy: +Aaron Hall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 22:32:47 2019 From: report at bugs.python.org (Victor Kung) Date: Mon, 08 Apr 2019 02:32:47 +0000 Subject: [issue36260] Cpython/Lib vulnerability found and request a patch submission In-Reply-To: <1552288618.75.0.236192047967.issue36260@roundup.psfhosted.org> Message-ID: <1554690767.78.0.790395202249.issue36260@roundup.psfhosted.org> Victor Kung added the comment: I see. @Christian Heimes Thank you for the response. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 7 22:56:03 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 08 Apr 2019 02:56:03 +0000 Subject: [issue9883] minidom: AttributeError: DocumentFragment instance has no attribute 'writexml' In-Reply-To: <1284694245.92.0.410723728376.issue9883@psf.upfronthosting.co.za> Message-ID: <1554692163.83.0.60693183544.issue9883@roundup.psfhosted.org> miss-islington added the comment: New changeset a9a065addd175ed37a959118c90377ba60f90036 by Miss Islington (bot) in branch '3.7': bpo-9883: Update list of unimplemented interfaces in minidom. (GH-12677) https://github.com/python/cpython/commit/a9a065addd175ed37a959118c90377ba60f90036 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 00:38:16 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 04:38:16 +0000 Subject: [issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX Message-ID: <1554698296.6.0.519379747153.issue36552@roundup.psfhosted.org> New submission from anthony shaw : When calculating length of range() objects that have an r->length > PY_SIZE_MAX, the underlying PyLong_AsSsize_t() function will raise an OverflowError: >>> a = list(range(2**256)) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert to C ssize_t >>> a = range(2**256) >>> len(a) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert to C ssize_t This is expected behaviour, but to the average user, who won't know what ssize_t is, or what this has to do with Python int, the user message is confusing and OverflowError is the symptom but not the cause. The cause is that the length sent to range was in a value too large to calculate. This patch changes OverflowError to ValueError to hint to the user that the value sent to the range object constructor is too large. >>> a = list(range(2**256)) Traceback (most recent call last): File "", line 1, in ValueError: Range object too large to calculate length (Overflow Error) >>> a = range(2**256) >>> len(a) Traceback (most recent call last): File "", line 1, in ValueError: Range object too large to calculate length (Overflow Error) ---------- components: Library (Lib) messages: 339589 nosy: anthony shaw priority: normal severity: normal status: open title: Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 00:39:47 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 04:39:47 +0000 Subject: [issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX In-Reply-To: <1554698296.6.0.519379747153.issue36552@roundup.psfhosted.org> Message-ID: <1554698387.35.0.572773857552.issue36552@roundup.psfhosted.org> Change by anthony shaw : ---------- keywords: +patch pull_requests: +12646 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 01:44:43 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 05:44:43 +0000 Subject: [issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written In-Reply-To: <1460315503.46.0.361192457442.issue26730@psf.upfronthosting.co.za> Message-ID: <1554702283.54.0.91175045118.issue26730@roundup.psfhosted.org> Inada Naoki added the comment: I think this bug is critical, because it may break user's data silently. If we can not fix this bug soon, how about adding note in document and raise warning? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 01:48:28 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 05:48:28 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554702508.5.0.869785937316.issue36551@roundup.psfhosted.org> Change by anthony shaw : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 02:11:29 2019 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Mon, 08 Apr 2019 06:11:29 +0000 Subject: [issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts In-Reply-To: <1474132808.23.0.788365161086.issue28190@psf.upfronthosting.co.za> Message-ID: <1554703889.39.0.359691231531.issue28190@roundup.psfhosted.org> Chih-Hsuan Yen added the comment: I created https://github.com/python/cpython/pull/12587 as a preparation pull request to fix the __sgi issue mentioned in msg282782. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 02:15:37 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 08 Apr 2019 06:15:37 +0000 Subject: [issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written In-Reply-To: <1460315503.46.0.361192457442.issue26730@psf.upfronthosting.co.za> Message-ID: <1554704137.44.0.360723947562.issue26730@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:25:41 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 08 Apr 2019 07:25:41 +0000 Subject: [issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX In-Reply-To: <1554698296.6.0.519379747153.issue36552@roundup.psfhosted.org> Message-ID: <1554708341.61.0.643415325977.issue36552@roundup.psfhosted.org> Serhiy Storchaka added the comment: For large but smaller than the C limit ranges the list constructor raises a MemoryError. It should raise the same error for larger ranges. Raising an OverflowError in range.__len__ is legitimate. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:28:18 2019 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 08 Apr 2019 07:28:18 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1554708498.73.0.751516758655.issue36546@roundup.psfhosted.org> Mark Dickinson added the comment: Related previous discussion on python-ideas: https://mail.python.org/pipermail/python-ideas/2018-March/049327.html ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:30:32 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 08 Apr 2019 07:30:32 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554708632.8.0.56171892089.issue36551@roundup.psfhosted.org> Serhiy Storchaka added the comment: The benefit is too small to add a new opcode. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:34:19 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 07:34:19 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554708859.23.0.0156709705359.issue36551@roundup.psfhosted.org> anthony shaw added the comment: The opcode would not solely apply to this specific use case. I could seek another way of implementing the same behaviour without an additional opcode? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:42:33 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 08 Apr 2019 07:42:33 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1554709353.07.0.925020172524.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for taking a detailed look. I'll explore the links you provided shortly. The API is designed to be extendable so that we don't get trapped by the choice of computation method. If needed, any or all of the following extensions are possible without breaking backward compatibility: quantiles(data, n=4, already_sorted=True) # Skip resorting quantiles(data, cut_points=[0.02, 0.25, 0.50, 0.75, 0.98]) # box-and-whiskers quantiles(data, interp_method='nearest') # also: "low", "high", "midpoint" quantiles(data, inclusive=True) # For description of a complete population The default approach used in the PR matches what is used by MS Excel's PERCENTILE.EXC function?. That has several virtues. It is easy to explain. It allows two unequal sized datasets to be compared (perhaps with a QQ plot) to explore whether they are drawn from the same distribution. For sampled data, the quantiles tend to remain stable as more samples are added. For samples from a known distribution (i.e normal variates), it tends to give the same results as ihv_cdf(): >>> iq = NormalDist(100, 15) >>> cohort = iq.samples(10_000) >>> for ref, est in zip(quantiles(iq, n=10), quantiles(cohort, n=10)): ... print(f'{ref:5.1f}\t{est:5.1f}') ... 80.8 81.0 87.4 87.8 92.1 92.3 96.2 96.3 100.0 100.1 103.8 104.0 107.9 108.0 112.6 112.9 119.2 119.3 My thought was to start with something like this and only add options if they get requested (the most likely request is an inclusive=True option to emulate MS Excel's PERCENTILE.INC). If we need to leave the exact method unguaranteed, that's fine. But I think it would be better to guarantee the match to PERCENTILE.EXC and then handle other requests through API extensions rather than revisions. ? https://exceljet.net/excel-functions/excel-percentile.exc-function ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:52:28 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 07:52:28 +0000 Subject: [issue35488] pathlib Path.match does not behave as described In-Reply-To: <1544769623.98.0.788709270274.issue35488@psf.upfronthosting.co.za> Message-ID: <1554709948.63.0.271334037974.issue35488@roundup.psfhosted.org> Change by anthony shaw : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 03:52:33 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 07:52:33 +0000 Subject: [issue31155] Encode set, frozenset, bytearray, and iterators as json arrays In-Reply-To: <1502270596.69.0.819927554445.issue31155@psf.upfronthosting.co.za> Message-ID: <1554709953.14.0.634246544449.issue31155@roundup.psfhosted.org> Inada Naoki added the comment: I concur with Raymond. If you really need this feature, please discuss on python-dev ML. ---------- nosy: +inada.naoki resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 04:08:11 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 08:08:11 +0000 Subject: [issue32534] Speed-up list.insert: use memmove() In-Reply-To: <1515678734.85.0.467229070634.issue32534@psf.upfronthosting.co.za> Message-ID: <1554710891.59.0.83536639745.issue32534@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 04:20:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 08:20:38 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1554711638.9.0.0628749060532.issue33228@roundup.psfhosted.org> Inada Naoki added the comment: I'm +0 too. Since there are no +1 from core dev for a long time, I close this issue for now. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 04:21:55 2019 From: report at bugs.python.org (Sylvain Marie) Date: Mon, 08 Apr 2019 08:21:55 +0000 Subject: [issue36553] inspect.is_decorator_call(frame) Message-ID: <1554711715.55.0.758701327001.issue36553@roundup.psfhosted.org> New submission from Sylvain Marie : Python decorators are frequently proposed by libraries as an easy way to add functionality to user-written functions: see `attrs`, `pytest`, `click`, `marshmallow`, etc. A common pattern in most such libraries, is that they do not want to provide users with two different symbols for the same function. So they end up implementing decorators that can be used both as decorators (no arguments no parenthesis) AND decorator factories (arguments in parenthesis). This is convenient and intuitive for users. Unfortunately this is not something trivial to implement because the python language does not make any difference between a no-parenthesis decorator call and a with-parenthesis decorator factory call. So these libraries have to rely on "tricks", the most common one being to check existence of a non-default first parameter that is a callable. Examples: https://github.com/python-attrs/attrs/blob/c2a9dd8e113a0dc72f86490e330f25bc0111971a/src/attr/_make.py#L940 https://github.com/pytest-dev/pytest/blob/13a9d876f74f17907ad04b13132cbd4aa4ad5842/src/_pytest/fixtures.py#L1041 https://github.com/marshmallow-code/marshmallow/blob/ec51dff98999f2189a255fb8bbc22e549e3cc673/src/marshmallow/decorators.py#L161 Implementing these tricks is a bit ugly, but more importantly it is a waste of development time because when one changes his decorators signatures, the trick has to possibly be changed (order of arguments, default values, etc). Therefore it is quite a brake to agile development in the first phase of a project, where the api is not very stable. I regrouped all known and possible tricks in a library https://github.com/smarie/python-decopatch/ to provide a handy way to solve this problem. But it is still "a bunch of tricks". This library, or the manual implementations such as the examples above, could be much faster/efficient if there were at least, a way to determine if a frame is a call to `@`. So this is a request to at least have a `inspect.is_decorator_call(frame)` feature in the stdlib. That function would return `True` if the frame is a decorator call using `@`. Note that a more convenient way to solve this problem is also proposed in https://smarie.github.io/python-decopatch/pep_proposal/#2-preserving-backwards-compatibility : it would be to offer a `@decorator_factory` helper in the stdlib. But first feedback from python-ideas mailing list showed that this was maybe too disruptive :) ---------- components: Library (Lib) messages: 339599 nosy: smarie priority: normal severity: normal status: open title: inspect.is_decorator_call(frame) type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 04:28:49 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 08:28:49 +0000 Subject: [issue33461] json.loads(encoding=) does not emit deprecation warning. In-Reply-To: <1526005873.13.0.682650639539.issue33461@psf.upfronthosting.co.za> Message-ID: <1554712129.43.0.298829617172.issue33461@roundup.psfhosted.org> Inada Naoki added the comment: Since we didn't raise DeprecationWarning, I think at least one version with DeprecationWarning is preferable. ---------- nosy: +inada.naoki versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 04:55:55 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 08:55:55 +0000 Subject: [issue34488] improve performance of BytesIO.writelines() by avoiding creation of unused PyLongs In-Reply-To: <1535133350.73.0.56676864532.issue34488@psf.upfronthosting.co.za> Message-ID: <1554713755.49.0.483492875276.issue34488@roundup.psfhosted.org> Inada Naoki added the comment: Hm, what happened if subclass of BytesIO overrides `write` but not `writelines`? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 05:14:06 2019 From: report at bugs.python.org (Piotr Karkut) Date: Mon, 08 Apr 2019 09:14:06 +0000 Subject: [issue36053] pkgutil.walk_packages jumps out from given path if there is package with the same name in sys.path In-Reply-To: <1550680627.64.0.854320242724.issue36053@roundup.psfhosted.org> Message-ID: <1554714846.79.0.0804606689666.issue36053@roundup.psfhosted.org> Piotr Karkut added the comment: Nick: From what I've checked, it jumps in case the module is already imported. The problem is that the original implementation is quite naive, and it's trying to import the module before looking for it in `sys.modules` - So if the module with a conflicting name is in PYTHONPATH and has higher priority, it'd be imported instead of the correct one. And then, as the module is imported, it'd be available in `sys.modules`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 05:59:09 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 09:59:09 +0000 Subject: [issue36553] inspect.is_decorator_call(frame) In-Reply-To: <1554711715.55.0.758701327001.issue36553@roundup.psfhosted.org> Message-ID: <1554717549.17.0.382821482453.issue36553@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +yselivanov versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:21:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 10:21:32 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1554718892.35.0.293505102731.issue18372@roundup.psfhosted.org> STINNER Victor added the comment: It has been decided to not fix the issue in Python 2.7: https://github.com/python/cpython/pull/8505#issuecomment-480771689 ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:23:23 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 10:23:23 +0000 Subject: [issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops In-Reply-To: <1553894696.91.0.352723977034.issue36478@roundup.psfhosted.org> Message-ID: <1554719003.63.0.627422807878.issue36478@roundup.psfhosted.org> STINNER Victor added the comment: > ../Modules/_pickle.c:677:5: error: 'for' loop initial declarations are only allowed in C99 mode Why do you get an error? Which compiler do you use to build deadsnakes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:23:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 10:23:40 +0000 Subject: [issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops In-Reply-To: <1553894696.91.0.352723977034.issue36478@roundup.psfhosted.org> Message-ID: <1554719020.77.0.690612729804.issue36478@roundup.psfhosted.org> STINNER Victor added the comment: > Which compiler do you use to build deadsnakes? Sorry, which compiler *flags*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:24:31 2019 From: report at bugs.python.org (Dieter Maurer) Date: Mon, 08 Apr 2019 10:24:31 +0000 Subject: [issue36554] unittest.TestCase: "subTest" cannot be used together with "debug" Message-ID: <1554719071.94.0.114334441524.issue36554@roundup.psfhosted.org> New submission from Dieter Maurer : "subTest" accesses "self._outcome" which is "None" when the test is performed via "debug". ---------- components: Library (Lib) messages: 339607 nosy: dmaurer priority: normal severity: normal status: open title: unittest.TestCase: "subTest" cannot be used together with "debug" type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:31:30 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 10:31:30 +0000 Subject: [issue36554] unittest.TestCase: "subTest" cannot be used together with "debug" In-Reply-To: <1554719071.94.0.114334441524.issue36554@roundup.psfhosted.org> Message-ID: <1554719490.02.0.0511229657445.issue36554@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Can you please provide an example script to reproduce this? There is similar None check fixed with issue34900 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:36:43 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 08 Apr 2019 10:36:43 +0000 Subject: [issue35983] tp_dealloc trashcan shouldn't be called for subclasses In-Reply-To: <1550055751.42.0.717332216151.issue35983@roundup.psfhosted.org> Message-ID: <1554719803.67.0.710740134269.issue35983@roundup.psfhosted.org> Jeroen Demeyer added the comment: In Python 3, the resurrection issue probably appears too. But it's not so much a problem since __del__ (mapped to tp_finalize) is only called once anyway. So there are no bad consequences if the object is resurrected incorrectly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:48:59 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 10:48:59 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554720539.76.0.483651324139.issue36551@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:50:12 2019 From: report at bugs.python.org (Crusader Ky) Date: Mon, 08 Apr 2019 10:50:12 +0000 Subject: [issue36555] PEP484 @overload vs. str/bytes Message-ID: <1554720612.88.0.913385974113.issue36555@roundup.psfhosted.org> New submission from Crusader Ky : An exceedingly common pattern in many Python libraries is for a function to accept either a string or a list of strings, and change the function output accordingly. This however does not play nice with @typing.overload, as a str variable is also an Iterable[str] that yields individual characters; a bytes variable is also an Iterable[bytes]. The example below confuses tools like mypy: @overload def f(x: str) -> int ... @overload def f(x: Iterable[str]) -> List[int] ... def f(x): if isinstance(x, str): return len(x) return [len(i) for i in x] mypy output: error: Overloaded function signatures 1 and 2 overlap with incompatible return types The proposed solution is to modify PEP484 to specify that, in case of ambiguity, whatever overloaded typing is defined first wins. This would be coherent with the behaviour of @functools.singledispatch. ---------- components: Library (Lib) messages: 339610 nosy: Crusader Ky priority: normal severity: normal status: open title: PEP484 @overload vs. str/bytes type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 06:57:49 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 08 Apr 2019 10:57:49 +0000 Subject: [issue36556] Trashcan causing duplicated __del__ calls Message-ID: <1554721069.78.0.635003677155.issue36556@roundup.psfhosted.org> New submission from Jeroen Demeyer : NOTE: because of PEP 442, this issue is specific to Python 2. This bug was discovered while adding testcases for bpo-35983 to the Python 2.7 backport. There is a nasty interaction between the trashcan and __del__: if you're very close to the trashcan limit and you're calling __del__, then objects that should have been deallocated in __del__ (in particular, an object involving self) might instead end up in the trashcan. This way, temporary references to self are not cleaned up and self might be resurrected when it shouldn't be. This in turns causes __del__ to be called multiple times. Testcase: class ObjectCounter(object): count = 0 def __init__(self): type(self).count += 1 def __del__(self): L = [self] type(self).count -= 1 L = None for i in range(60): L = [L, ObjectCounter()] del L print(ObjectCounter.count) This is expected to print 0 but in facts it prints -1. There are various ways of fixing this, with varying effectiveness. An obvious solution is bypassing the trashcan completely in __del__. This will deallocate objects correctly but it will cause a stack overflow (on the C level, so crashing Python) if __del__ is called recursively with deep recursion (this is what the trashcan is supposed to prevent). A compromise solution would be lowering the trashcan limit for heap types from 50 to 40: this gives __del__ at least 10 stack frames to work with. Assuming that __del__ code is relatively simple and won't create objects that are too deeply nested, this should work correctly. ---------- components: Interpreter Core messages: 339611 nosy: eric.snow, jdemeyer, matrixise, pitrou, scoder, serhiy.storchaka priority: normal severity: normal status: open title: Trashcan causing duplicated __del__ calls versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:02:52 2019 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 08 Apr 2019 11:02:52 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554721372.69.0.65170307617.issue36551@roundup.psfhosted.org> Ronald Oussoren added the comment: This might cause a MemoryError when the __length_hint__ of the source returns a too large value, even when the actual size of the comprehension is smaller, e.g.: [x**2 for x in range(LARGE_VALUE) if is_prime(x)] See also issue28940 ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:10:16 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 11:10:16 +0000 Subject: [issue36555] PEP484 @overload vs. str/bytes In-Reply-To: <1554720612.88.0.913385974113.issue36555@roundup.psfhosted.org> Message-ID: <1554721816.74.0.435919667924.issue36555@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:20:11 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 11:20:11 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554722411.42.0.652426741539.issue36551@roundup.psfhosted.org> Inada Naoki added the comment: I agree with Serhiy. Benefit seems too small to add new opcode. > I could seek another way of implementing the same behaviour without an additional opcode? How about converting `[x for x in it]` to `[*it]` in AST? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:21:02 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 11:21:02 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554722462.61.0.995866169082.issue36551@roundup.psfhosted.org> Inada Naoki added the comment: $ python3 -m timeit -s 'r=range(1000)' -- '[x for x in r]' 5000 loops, best of 5: 40 usec per loop $ python3 -m timeit -s 'r=range(1000)' -- '[*r]' 20000 loops, best of 5: 17.3 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:22:41 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Mon, 08 Apr 2019 11:22:41 +0000 Subject: [issue36555] PEP484 @overload vs. str/bytes In-Reply-To: <1554720612.88.0.913385974113.issue36555@roundup.psfhosted.org> Message-ID: <1554722561.37.0.587345611616.issue36555@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Mypy already takes first overload for ambiguous arguments. This example is however genuinely unsafe from the static typing point of view. Please read the docs https://mypy.readthedocs.io/en/latest/more_types.html#type-checking-the-variants ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:34:08 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 08 Apr 2019 11:34:08 +0000 Subject: [issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem() In-Reply-To: <1544525657.6.0.788709270274.issue35459@psf.upfronthosting.co.za> Message-ID: <1554723248.58.0.770040185684.issue35459@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 7a0630c530121725136526a88c49589b54da6492 by Serhiy Storchaka in branch 'master': Add a What's New entry for bpo-35459. (GH-12706) https://github.com/python/cpython/commit/7a0630c530121725136526a88c49589b54da6492 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:34:39 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 11:34:39 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554723279.24.0.450551464349.issue36551@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This patch makes it slow for small iterators: Perf program: import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x for x in range(10)]", setup="") Current master: ? ./python.exe ../check.py ..................... list_comp: Mean +- std dev: 3.97 us +- 0.15 us PR 12718: ? ./python.exe ../check.py ..................... list_comp: Mean +- std dev: 4.57 us +- 0.17 us The overhead is very likely due to calling __length_hint__ ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:35:08 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 11:35:08 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554723308.57.0.650015281311.issue36551@roundup.psfhosted.org> anthony shaw added the comment: > How about converting `[x for x in it]` to `[*it]` in AST? I should have been more explicit, this patch improves the performance of all list comprehensions that don?t have an if clause. Not just [x for x in y] but: d = {} # some sort of dictionary [f?{k} ? {v}? for k, v in d.items()] a = iterable [val**2 for val in a] Would all use BUILD_LIST_PREALLOC and use a LengthHint. I can do another speed test for those other scenarios. Most of the stdlib packages have these sorts of list comps, including those in the default site.py. ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:36:40 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 11:36:40 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554723400.66.0.573195802911.issue36551@roundup.psfhosted.org> Inada Naoki added the comment: > I should have been more explicit, this patch improves the performance of all list comprehensions that don?t have an if clause. But in these cases, overhead of reallocation will be smaller than simple case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:36:57 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 11:36:57 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554723417.93.0.539341851135.issue36551@roundup.psfhosted.org> anthony shaw added the comment: > This might cause a MemoryError when the __length_hint__ of the source returns a too large value, even when the actual size of the comprehension is smaller, e.g.: The current implementation of list comprehensions raise neither a memoryerror or overflow error. They will consume all available memory and crash the interpreter. This patch raises an OverflowError before execution instead of just looping until memory heap exhaustion ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:39:43 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 11:39:43 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554723583.69.0.457400739618.issue36551@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: More benchmarks for slow iterators: import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x**2 for x in k]", setup="k=iter(list(range(10)))") Current master: ? ./python.exe ../check.py ..................... list_comp: Mean +- std dev: 924 ns +- 35 ns PR 12718: ? ./python.exe ../check.py ..................... list_comp: Mean +- std dev: 1.17 us +- 0.06 us ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:45:13 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 11:45:13 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554723417.93.0.539341851135.issue36551@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: > > This might cause a MemoryError when the __length_hint__ of the source returns a too large value, even when the actual size of the comprehension is smaller, e.g.: > > The current implementation of list comprehensions raise neither a memoryerror or overflow error. They will consume all available memory and crash the interpreter. > > This patch raises an OverflowError before execution instead of just looping until memory heap exhaustion > Note PEP 424. """ __length_hint__ must return an integer (else a TypeError is raised) or NotImplemented, and is not required to be accurate. It may return a value that is either larger or smaller than the actual size of the container. """ it.__length_hint__ can return 2**1000 even if len(list(it))==0. In such case, current behavior works. And your patch will raise OverflowError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:47:48 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 11:47:48 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554724068.4.0.0519810762817.issue36551@roundup.psfhosted.org> anthony shaw added the comment: > This patch makes it slow for small iterators That is a one-off cost for the __length_hint__ of the range object specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. I can run a more useful set of benchmarks against this. So the +0.6us would be the same for ranges 8-16. Then less for 16-25, then again for 25-35 as the removal of the reallocation process has a more significant factor for larger ranges. ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:49:07 2019 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 08 Apr 2019 11:49:07 +0000 Subject: [issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation In-Reply-To: <1322181994.22.0.955887054946.issue13475@psf.upfronthosting.co.za> Message-ID: <1554724147.08.0.863991606915.issue13475@roundup.psfhosted.org> Nick Coghlan added the comment: Retitled the issue using the `--mainpath` spelling, as I wanted to link to it from the PEP 582 discussion, and that's my current favourite from the various ideas I've had since first filing the issue. (I decided I didn't like `--basepath` because we already have `sys.base_prefix` that refers to something entirely different) ---------- title: Add '-p'/'--path0' command line option to override sys.path[0] initialisation -> Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation type: -> enhancement versions: +Python 3.9 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:50:05 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 11:50:05 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554724205.97.0.250027376036.issue36551@roundup.psfhosted.org> anthony shaw added the comment: > In such case, current behavior works. And your patch will raise OverflowError. Try [x for x in range(2**1000)] in a REPL. It doesn?t raise anything, it tries to create a list that will eventually exceed PY_SIZE_MAX, but it only crashes once it reaches that iteration. This raises an OverflowError instead, the same way: len(range(2**1000)) raises an OverflowError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 07:54:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 11:54:52 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554724205.97.0.250027376036.issue36551@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: > Try > > [x for x in range(2**1000)] > > in a REPL. It doesn?t raise anything, it tries to create a list that will eventually exceed PY_SIZE_MAX, but it only crashes once it reaches that iteration. It is expected behavior. > This raises an OverflowError instead, the same way: > len(range(2**1000)) > raises an OverflowError If your patch uses __length_hint__, it is bug. iterator will return 2**1000 for __length_hint__, but produce no item on iteration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:08:40 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 12:08:40 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554725320.3.0.446900352131.issue36551@roundup.psfhosted.org> anthony shaw added the comment: > If your patch uses __length_hint__, it is bug. iterator will return 2**1000 for __length_hint__, but produce no item on iteration. It raises an OverflowError because of the goto https://github.com/python/cpython/pull/12718/files#diff-7f17c8d8448b7b6f90549035d2147a9fR2493 this could just as easily set size to 0. I put `goto error` given the opportunity to handle an expected fault gracefully. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:16:14 2019 From: report at bugs.python.org (anthony shaw) Date: Mon, 08 Apr 2019 12:16:14 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554725774.25.0.962947689983.issue36551@roundup.psfhosted.org> anthony shaw added the comment: > If your patch uses __length_hint__, it is bug. I?m not sure I understand this comment, PEP424 says ?This is useful for presizing containers when building from an iterable.? This patch uses __length_hint__ to presize the list container for a list comprehension. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:20:23 2019 From: report at bugs.python.org (mattcher_h) Date: Mon, 08 Apr 2019 12:20:23 +0000 Subject: [issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall Message-ID: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> New submission from mattcher_h : Hi, I?m trying to generate an automated install and uninstall from Python. For this I normally use cmdlines, but I got some issues. If I try to uninstall by my automated version I got the problem that it doesn?t finish. When I do this at the PC himself it works fine with PathToPython.exe /uninstall but i have to "click" close at the end of the setup by myself. So I think my problem with the automated version is that it doesn?t "click" close, because the uninstall itself seems to work fine. Are there some more parameters I could give? Another Issue is the PythonLauncher. Is there an cmdline by himself to uninstall? ciao ---------- components: Installation messages: 339629 nosy: mattcher_h priority: normal severity: normal status: open title: Python (Launcher)3.7.3 CMDLine install/uninstall versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:29:28 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 08 Apr 2019 12:29:28 +0000 Subject: [issue36556] Trashcan causing duplicated __del__ calls In-Reply-To: <1554721069.78.0.635003677155.issue36556@roundup.psfhosted.org> Message-ID: <1554726568.34.0.52195173121.issue36556@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +12648 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:33:36 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 12:33:36 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554726816.22.0.76629818617.issue36551@roundup.psfhosted.org> Inada Naoki added the comment: "useful" doesn't mean "use it as-is". It is just a hint. It will be wrong. See here for list example: https://github.com/python/cpython/blob/7a0630c530121725136526a88c49589b54da6492/Objects/listobject.c#L929-L940 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:39:53 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 12:39:53 +0000 Subject: [issue34373] test_time errors on AIX In-Reply-To: <1533917751.88.0.56676864532.issue34373@psf.upfronthosting.co.za> Message-ID: <1554727193.64.0.669900679545.issue34373@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12649 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:42:21 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 12:42:21 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554727341.25.0.479027497224.issue36551@roundup.psfhosted.org> Inada Naoki added the comment: I'm sorry. list_extend raises OverflowError too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:44:57 2019 From: report at bugs.python.org (SilentGhost) Date: Mon, 08 Apr 2019 12:44:57 +0000 Subject: [issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall In-Reply-To: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> Message-ID: <1554727497.69.0.155999128718.issue36557@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 08:54:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 12:54:17 +0000 Subject: [issue36558] Change time.mktime() return type from float to int? Message-ID: <1554728057.82.0.282756231506.issue36558@roundup.psfhosted.org> New submission from STINNER Victor : time.mktime() returns a floating point number: >>> type(time.mktime(time.localtime())) The documentation says: "It returns a floating point number, for compatibility with :func:`.time`." time.time() returns a float because it has sub-second resolution, but mktime() returns an integer number of seconds. Would it make sense to change mktime() return type from float to int? I would like to change mktime() return type to make the function more consistent: inputs are integers, it sounds wrong to me to return float. The result should be integer as well. How much code would it break? I guess that the main impact are unit tests relying on repr(time.mktime(t)) exact value. But it's easy to fix the tests: use int(time.mktime(t)) or "%.0f" % time.mktime(t) to never get ".0", or use float(time.mktime(t))) to explicitly cast for a float (that which be a bad but quick fix). Note: I wrote and implemented the PEP 564 to avoid any precision loss. mktime() will not start loosing precision before year 285,422,891 (which is quite far in the future ;-)). ---------- components: Library (Lib) messages: 339632 nosy: belopolsky, p-ganssle, vstinner priority: normal severity: normal status: open title: Change time.mktime() return type from float to int? versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:00:44 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 13:00:44 +0000 Subject: [issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read In-Reply-To: <1541870632.41.0.788709270274.issue35210@psf.upfronthosting.co.za> Message-ID: <1554728444.86.0.747731781703.issue35210@roundup.psfhosted.org> Inada Naoki added the comment: Maybe, we need C version of memoryview.release() to invalidate pointer in memoryview object. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:02:20 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 13:02:20 +0000 Subject: [issue15903] Make rawiobase_read() read directly to bytes object In-Reply-To: <1347279783.86.0.217898740398.issue15903@psf.upfronthosting.co.za> Message-ID: <1554728540.99.0.617813726913.issue15903@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:02:28 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 13:02:28 +0000 Subject: [issue15994] memoryview to freed memory can cause segfault In-Reply-To: <1348173441.91.0.841080415833.issue15994@psf.upfronthosting.co.za> Message-ID: <1554728548.78.0.826894906678.issue15994@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:04:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 13:04:13 +0000 Subject: [issue36558] Change time.mktime() return type from float to int? In-Reply-To: <1554728057.82.0.282756231506.issue36558@roundup.psfhosted.org> Message-ID: <1554728653.38.0.750756062844.issue36558@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12650 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:05:46 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 13:05:46 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554728745.99.0.374592904332.issue36551@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > That is a one-off cost for the __length_hint__ of the range object specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. That seems incorrect. This is not unique of range objects as it affects also objects with known lengths (like a list): import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x*2 for x in k]", setup="k=list(range(10))") Current master: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 3.82 us +- 0.13 us PR 12718: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 4.38 us +- 0.16 us Check also my other benchmark with a list iterator ( iter(list(range(10))) ) or this one with a generator comp: import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x*2 for x in it]", setup="k=list(range(10));it=(x for x in k)") Current master: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 967 ns +- 27 ns PR 12718: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 1.22 us +- 0.04 us ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:06:30 2019 From: report at bugs.python.org (Mark Lawrence) Date: Mon, 08 Apr 2019 13:06:30 +0000 Subject: [issue15903] Make rawiobase_read() read directly to bytes object In-Reply-To: <1347279783.86.0.217898740398.issue15903@psf.upfronthosting.co.za> Message-ID: <1554728790.88.0.976466480429.issue15903@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:08:01 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 13:08:01 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554728881.5.0.846074127223.issue36551@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg339634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:08:54 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 13:08:54 +0000 Subject: [issue35416] Fix potential resource warnings in distutils In-Reply-To: <1544000059.73.0.788709270274.issue35416@psf.upfronthosting.co.za> Message-ID: <1554728934.18.0.730531995974.issue35416@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 58721a903074d28151d008d8990c98fc31d1e798 by Inada Naoki (Micka?l Schoentgen) in branch 'master': bpo-35416: fix potential resource warnings in distutils (GH-10918) https://github.com/python/cpython/commit/58721a903074d28151d008d8990c98fc31d1e798 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:09:33 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 13:09:33 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554728973.18.0.881619811769.issue36551@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > That is a one-off cost for the __length_hint__ of the range object specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. That seems incorrect. This is not unique of range objects as it affects also objects with known lengths (like a list): import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x*2 for x in k]", setup="k=list(range(10))") Current master: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 3.82 us +- 0.13 us PR 12718: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 4.38 us +- 0.16 us Check also my other benchmark with a list iterator ( iter(list(range(10))) ) or this one with a generator comp: import perf runner = perf.Runner() runner.timeit("list_comp", stmt="[x*2 for x in it]", setup="k=list(range(10));it=(x for x in k)") Current master: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 945 ns +- 27 ns PR 12718: ? ./python.exe ../check.py -n 10 ..................... list_comp: Mean +- std dev: 1.33 us +- 0.05 us ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:11:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 13:11:01 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) Message-ID: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> New submission from STINNER Victor : Currently, when the random module is imported, the hashlib module is always imported which loads the OpenSSL library, whereas hashlib is only needed when a Random() instance is created with a string seed. For example, "rnd = random.Random()" and "rnd = random.Random(12345)" don't need hashlib. Example on Linux: $ python3 Python 3.7.2 (default, Mar 21 2019, 10:09:12) >>> import os, sys >>> 'hashlib' in sys.modules False >>> res=os.system(f"grep ssl /proc/{os.getpid()}/maps") >>> import random >>> 'hashlib' in sys.modules True >>> res=os.system(f"grep ssl /proc/{os.getpid()}/maps") 7f463ec38000-7f463ec55000 r--p 00000000 00:2a 5791335 /usr/lib64/libssl.so.1.1.1b 7f463ec55000-7f463eca5000 r-xp 0001d000 00:2a 5791335 /usr/lib64/libssl.so.1.1.1b ... Attached PR only imports hashlib on demand. Note: I noticed this issue while working on adding OpenSSL 1.1.1 support to Python 3.4 :-) ---------- components: Library (Lib) messages: 339637 nosy: vstinner priority: normal severity: normal status: open title: "import random" should import hashlib on demand (nor load OpenSSL) versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:13:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 13:13:37 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554729217.49.0.854531885976.issue36559@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12651 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:16:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 13:16:37 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554729397.08.0.816533049188.issue36559@roundup.psfhosted.org> STINNER Victor added the comment: In the past, some developers complained when an import has been removed in a stdlib module. I vaguely recall code using "import os" to get the "errno" module from "os.errno". That's "What's New in Python 3.7" contains: "Several undocumented internal imports were removed. One example is that os.errno is no longer available; use import errno directly instead. Note that such undocumented internal imports may be removed any time without notice, even in micro version releases." For this reason, I don't think that stable versions (2.7 and 3.7) should be modified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:20:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 08 Apr 2019 13:20:52 +0000 Subject: [issue35416] Fix potential resource warnings in distutils In-Reply-To: <1544000059.73.0.788709270274.issue35416@psf.upfronthosting.co.za> Message-ID: <1554729652.13.0.953398659906.issue35416@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:48:04 2019 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 08 Apr 2019 13:48:04 +0000 Subject: [issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops In-Reply-To: <1553894696.91.0.352723977034.issue36478@roundup.psfhosted.org> Message-ID: <1554731284.53.0.0339208040037.issue36478@roundup.psfhosted.org> Anthony Sottile added the comment: It's a rather oldish gcc in this case. (4.8.4 + whatever ubuntu patches). Here's a full (successful) build log (including the combinations of flags) after patching: https://launchpadlibrarian.net/416985438/buildlog_ubuntu-trusty-amd64.python3.5_3.5.7-1+trusty1_BUILDING.txt.gz iirc this version of gcc defaults to "gnu89" as the standard c target ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:50:09 2019 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 08 Apr 2019 13:50:09 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554731409.24.0.21762158139.issue36551@roundup.psfhosted.org> Nick Coghlan added the comment: I was going to note that the algorithm Anthony has pursued here is the same one we already use for the list constructor and list.extend(), but Inada-san already pointed that out :) While length_hint is allowed to be somewhat inaccurate, we do expect it to be at least *vaguely* accurate (otherwise it isn't very useful, and if it can be inaccurate enough to trigger OverflowError or MemoryError in cases that would otherwise work reasonably well, it would be better for a type not to implement it at all). While it would be nice to be able to avoid adding a new opcode, the problem is that the existing candidate opcodes (BUILD_LIST, BUILD_LIST_UNPACK) are both inflexible in what they do: - BUILD_LIST requires that the final list length be known at compile time - BUILD_LIST_UNPACK infers the final length from an object reference, but calls _PyList_Extend directly, so it combines the preallocation and the iterator consumption into a single step, and hence can't be used outside of iterable unpacking into a list At the same time, attempting to generalise either of them isn't desirable, since it would slow them down for their existing use cases, and be slower than a new opcode for this use case. The proposed BUILD_LIST_PREALLOC opcode splits the difference: it lets the compiler provide the interpreter with a *hint* as to how big the resulting list is expected to be. That said, you'd want to run the result through the benchmark suite rather than relying solely on microbenchmarks, as even though unfiltered "[some_operation_on_x for x in y]" comprehensions without nested loops or filter clauses are pretty common (more common than the relatively new "[*itr]" syntax), it's far less clear what the typical distribution in input lengths actually is, and how many memory allocations need to be avoided in order to offset the cost of the initial _PyObject_LengthHint call (as Pablo's small scale results show). (Note that in the _PyList_Extend code, there are preceding special cases for builtin lists and tuples that take those down a much faster path that avoids the _PyObject_LengthHint call entirely) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 09:57:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 13:57:56 +0000 Subject: [issue36414] Multiple test failures in GCC and Clang optional builds on Travis CI In-Reply-To: <1553412920.81.0.155092332299.issue36414@roundup.psfhosted.org> Message-ID: <1554731876.9.0.0873380570619.issue36414@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: https://github.com/python/cpython/pull/12708 that seems to fix similar issue (issue36544) for Ubuntu that helps in making Mac OS build green again. Successful build : https://travis-ci.org/python/cpython/jobs/516821454 ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:19:53 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 08 Apr 2019 14:19:53 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1554733193.85.0.576068031529.issue18372@roundup.psfhosted.org> Serhiy Storchaka added the comment: Tracking objects that do not need this will just add work to the garbage collector. Not all instances of trackable types should be tracked, for example the empty tuple and some dicts are not tracked. >>> gc.is_tracked(()) False >>> gc.is_tracked((1, 2)) True >>> gc.is_tracked({1: None}) False >>> gc.is_tracked({1: []}) True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:22:16 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 14:22:16 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block Message-ID: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> New submission from STINNER Victor : Sometimes, each run of test_functools leaks exactly 1 memory block, even when the whole test is "re-run in verbose mode". Sometimes, it doesn't leak. https://buildbot.python.org/all/#/builders/80/builds/550 test_functools leaked [1, 1, 1] memory blocks, sum=3 Re-running test 'test_functools' in verbose mode test_functools leaked [1, 1, 1] memory blocks, sum=3 Maybe the problem comes from Example on Linux: $ ./python -m test -F -r -j1 -R 3:3 test_functools Using random seed 3891892 Run tests in parallel using 1 child processes 0:00:01 load avg: 2.38 [ 1] test_functools passed beginning 6 repetitions 123456 ...... (...) 0:00:06 load avg: 2.27 [ 6] test_functools passed beginning 6 repetitions 123456 ...... 0:00:07 load avg: 2.27 [ 7/1] test_functools failed beginning 6 repetitions 123456 ...... test_functools leaked [1, 2, 1] memory blocks, sum=4 0:00:08 load avg: 2.27 [ 8/1] test_functools passed beginning 6 repetitions 123456 ...... == Tests result: FAILURE == 7 tests OK. 1 test failed: test_functools Total duration: 8 sec 333 ms Tests result: FAILURE ---------- components: Tests messages: 339643 nosy: vstinner priority: normal severity: normal status: open title: test_functools leaks randomly 1 memory block versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:34:15 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 08 Apr 2019 14:34:15 +0000 Subject: [issue33632] undefined behaviour: signed integer overflow in threadmodule.c In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za> Message-ID: <1554734055.36.0.399273709424.issue33632@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12652 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:37:00 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 08 Apr 2019 14:37:00 +0000 Subject: [issue33632] undefined behaviour: signed integer overflow in threadmodule.c In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za> Message-ID: <1554734220.12.0.585534328843.issue33632@roundup.psfhosted.org> Zackery Spytz added the comment: I've created a PR based on Martin Panter's patch. ---------- components: +Extension Modules -Library (Lib) nosy: +ZackerySpytz versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:45:18 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 08 Apr 2019 14:45:18 +0000 Subject: [issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall In-Reply-To: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> Message-ID: <1554734718.74.0.499268928125.issue36557@roundup.psfhosted.org> Steve Dower added the comment: Pass /passive to have it automatically close at the end, or /quiet to avoid popping up a window at all. Can you clarify what you mean by launcher? There are a couple different things you could be talking about and I don't want to give you the wrong answer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:56:18 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 08 Apr 2019 14:56:18 +0000 Subject: [issue35983] tp_dealloc trashcan shouldn't be called for subclasses In-Reply-To: <1550055751.42.0.717332216151.issue35983@roundup.psfhosted.org> Message-ID: <1554735378.94.0.161417676477.issue35983@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- pull_requests: +12653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 10:59:10 2019 From: report at bugs.python.org (JP Zhang) Date: Mon, 08 Apr 2019 14:59:10 +0000 Subject: [issue36561] Python argparse doesn't work in the presence of my custom module Message-ID: <1554735550.49.0.179926102868.issue36561@roundup.psfhosted.org> New submission from JP Zhang : Github repo for reproducing: https://github.com/zjplab/gc-mc-pytorch/tree/bug, test.py. In the presence of my custom data_loader, it will error as unrecognized argument. But without importing it(comment it out) everything is just fine. ---------- components: Library (Lib) messages: 339646 nosy: JP Zhang priority: normal severity: normal status: open title: Python argparse doesn't work in the presence of my custom module versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:07:16 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 15:07:16 +0000 Subject: [issue36561] Python argparse doesn't work in the presence of my custom module In-Reply-To: <1554735550.49.0.179926102868.issue36561@roundup.psfhosted.org> Message-ID: <1554736036.6.0.171177187965.issue36561@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Can you please post the traceback you are getting and how you are running the script from command line? The custom module has third party dependencies like numpy so it will be helpful if you can attach a reproducer without dependencies to see if it's a problem with CPython or something with custom loader. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:13:39 2019 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 08 Apr 2019 15:13:39 +0000 Subject: [issue36558] Change time.mktime() return type from float to int? In-Reply-To: <1554728057.82.0.282756231506.issue36558@roundup.psfhosted.org> Message-ID: <1554736419.26.0.405815641094.issue36558@roundup.psfhosted.org> Paul Ganssle added the comment: I would say that the natural output of mktime is indeed an integer, but I can't say off the top of my head what "compatibility" refers to here, so per the principle of Chesterton's fence, without more research or historical context I'd say the default should be *not* to make this change. At the moment, I'm -0 on this, because "we should have designed the API this way in the first place" doesn't seem like a good enough reason to change the return type. I doubt it would be *terribly* onerous to the users to change this, so if there's some compelling reason for making it an integer I'm willing to be persuaded, but as it stands I don't think this is causing a huge amount of confusion or problems. One other possible reason to mildly prefer no change is that if we were to change `struct_time` to accept a float for `tm_sec` (which I imagine might have more widespread consequences, admittedly), it wouldn't require a change to `mktime` to support sub-second offsets. Again, a compelling use case for an `int` return value could pretty easily overwhelm this objection. > mktime() will not start losing precision before year 285,422,891 (which is quite far in the future ;-)). I think we're witnessing the birth of the Y285M422K891 bug! winking face emoji ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:16:23 2019 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 08 Apr 2019 15:16:23 +0000 Subject: [issue33632] undefined behaviour: signed integer overflow in threadmodule.c In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za> Message-ID: <1554736583.39.0.136305573679.issue33632@roundup.psfhosted.org> Change by Paul Ganssle : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:16:45 2019 From: report at bugs.python.org (JP Zhang) Date: Mon, 08 Apr 2019 15:16:45 +0000 Subject: [issue36561] Python argparse doesn't work in the presence of my custom module In-Reply-To: <1554735550.49.0.179926102868.issue36561@roundup.psfhosted.org> Message-ID: <1554736605.64.0.446944191501.issue36561@roundup.psfhosted.org> JP Zhang added the comment: >>>python test.py --num_epochs 200 usage: test.py [-h] [--data_type DATA_TYPE] test.py: error: unrecognized arguments: --num_epochs 200 I have a created a colab share link. You can check: https://colab.research.google.com/drive/1TUvt4CCv2d43GD1ccmuRNBJlkbUPXN8Z ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:32:23 2019 From: report at bugs.python.org (cagney) Date: Mon, 08 Apr 2019 15:32:23 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554737543.4.0.925186419622.issue36533@roundup.psfhosted.org> cagney added the comment: I think the only pragmatic solution here is to add an optional parameter to logging.basicConfig() that specifies that the logger should use a single global lock; and then start documenting that thread locks and fork() don't work well together. And note that this solution is pragmatic, not correct (@dhr, when we discussed this off line, pointed out that since python's using threads then a "correct" solution would be to use some sort of inter-process lock). For instance, if I were to implement emit() as something contrived like: with lock: s = record.to-string() for i in 1 .. s'length: b[i] = s[i] for i in 1 .. b'length: stdout.write(b[i]).flush() b = [] then when fork() breaks 'lock' the guarantee that the code is atomic is also broken: - when the child enters the code 'b' is undefined - the guarantee that log records don't interleave is lost while a global lock would help mitigate the first case it really isn't a "correct" fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:33:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 15:33:24 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554737604.36.0.912814698438.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: Current bisection progress: I'm able to reproduce a failure with attached test_functools.py (211 lines) using: ./python -m test -F -j5 -R 3:3 test_functools It takes between 4 and 200 runs to reproduce the failure, I don't understand what triggers the bug. I failed to identify if the bug is more likely when the system is idle or when the system is busy. It looks purely random. ---------- Added file: https://bugs.python.org/file48246/test_functools.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:35:08 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 08 Apr 2019 15:35:08 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554737708.11.0.488432431028.issue36559@roundup.psfhosted.org> Raymond Hettinger added the comment: Why do we care about this particular import? It doesn't see slow in any way. In general, we don't do deferred imports unless there is a compelling reason (i.e. it is very slow or it is sometimes unavailable). Otherwise, it is a false optimization. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:37:32 2019 From: report at bugs.python.org (Joao Paulo) Date: Mon, 08 Apr 2019 15:37:32 +0000 Subject: [issue36562] Can't call a method from a module built in Python C API Message-ID: <1554737852.45.0.259157063198.issue36562@roundup.psfhosted.org> New submission from Joao Paulo : I'm trying to build a python module in C++ using the Python C API and the code is attached. The problem is when I run my_module.runTester() in PyRun_SimpleString. I get the following error message: SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer supported! I'm not using METH_OLDARGS. As you can see, I'm using METH_VARARGS | METH_KEYWORDS. What I could be missing here? I'm using Windows 7 x64. ---------- files: module.cpp messages: 339653 nosy: jjppof priority: normal severity: normal status: open title: Can't call a method from a module built in Python C API type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file48247/module.cpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:39:26 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 15:39:26 +0000 Subject: [issue36561] Python argparse doesn't work in the presence of my custom module In-Reply-To: <1554735550.49.0.179926102868.issue36561@roundup.psfhosted.org> Message-ID: <1554737966.95.0.918332559427.issue36561@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: test.py shown in msg339649 accepts only --data_type DATA_TYPE. Running test.py without import and the non-existent flag would show all the options present like the below I am using from the repo you have shared. You might ./python.exe ../backups/bpo36561.py --non-existent 100 usage: bpo36561.py [-h] [--mode MODE] [--data_type DATA_TYPE] [--model-path MODEL_PATH] [--data-path DATA_PATH] [--data-shuffle DATA_SHUFFLE] [--batch-size BATCH_SIZE] [--num_epochs NUM_EPOCHS] [--val-step VAL_STEP] [--test-epoch TEST_EPOCH] [--start-epoch START_EPOCH] [--neg-cnt NEG_CNT] [--lr LR] [--beta1 BETA1] [--beta2 BETA2] [--dropout DROPOUT] [--n_critic N_CRITIC] [--emb-dim EMB_DIM] [--hidden HIDDEN] [--nb NB] [--train_path TRAIN_PATH] [--val_path VAL_PATH] [--test_path TEST_PATH] bpo36561.py: error: unrecognized arguments: --non-existent 100 Looking further the problem might be that importing data_loader imports preprocess module and it has the below code. So this argparse code is executed and not the one from tests.py. Python executes all the top level code while importing. Maybe you can have this inside if __name__ == "__main__" so that this is not used while importing, parser = argparse.ArgumentParser() # data parser.add_argument('--data_type', type=str, default="ml_100k") args = parser.parse_args() download_dataset(args.data_type) preprocess(args.data_type) Can help so that this is not executed. if __name__ == "__main__": parser = argparse.ArgumentParser() # data parser.add_argument('--data_type', type=str, default="ml_100k") args = parser.parse_args() download_dataset(args.data_type) preprocess(args.data_type) This is reproducible like this where you expect foo to be printed but due to import bar's argument parser is used : ? gc-mc-pytorch git:(master) ? cat /tmp/foo.py import bar import argparse parser = argparse.ArgumentParser() parser.add_argument('--foo', required=True) parser.parse_args() ? gc-mc-pytorch git:(master) ? cat /tmp/bar.py import argparse parser = argparse.ArgumentParser() parser.add_argument('--bar', required=True) parser.parse_args() ? gc-mc-pytorch git:(master) ? python3 /tmp/foo.py usage: foo.py [-h] --bar BAR foo.py: error: the following arguments are required: --bar Either way it's not a bug in Python and it's a side effect of top level code being executed during importing the module. I am closing this as not a bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 11:45:25 2019 From: report at bugs.python.org (Peter Otten) Date: Mon, 08 Apr 2019 15:45:25 +0000 Subject: [issue36561] Python argparse doesn't work in the presence of my custom module In-Reply-To: <1554735550.49.0.179926102868.issue36561@roundup.psfhosted.org> Message-ID: <1554738325.28.0.435504367014.issue36561@roundup.psfhosted.org> Peter Otten <__peter__ at web.de> added the comment: That's a bug in your code. You create another ArgumentParser in the toplevel code of preprocess.py. When this module is imported directly or indirectly your script will us this parser to parse the command line first. Minimal example: $ cat preprocess.py import argparse parser = argparse.ArgumentParser() parser.add_argument("--foo") print(parser.parse_args()) $ cat test.py import argparse import preprocess parser = argparse.ArgumentParser() parser.add_argument("--bar") print(parser.parse_args()) $ python3 test.py --bar 42 usage: test.py [-h] [--foo FOO] test.py: error: unrecognized arguments: --bar 42 $ Fix: Protect toplevel code in preprocess.py with if __name__ == "__main__": parser = ... ... ---------- nosy: +peter.otten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:22:15 2019 From: report at bugs.python.org (Ruluk) Date: Mon, 08 Apr 2019 16:22:15 +0000 Subject: [issue35422] misleading error message from ssl.get_server_certificate() when bad port In-Reply-To: <1544045072.3.0.788709270274.issue35422@psf.upfronthosting.co.za> Message-ID: <1554740535.9.0.472482501028.issue35422@roundup.psfhosted.org> Ruluk added the comment: I would still validate the error somewhere, maybe before reaching the OpenSSL library, because that same error is also shown for other cases. E.g: http_connection = HTTPSConnection("localhost") http_connection.request("POST", my_url, my_body, my_headers) The use of an HTTPS connection for localhost effectively produces the same "SSL: WRONG VERSION NUMBER" error. ---------- nosy: +ruluk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:28:26 2019 From: report at bugs.python.org (Dieter Maurer) Date: Mon, 08 Apr 2019 16:28:26 +0000 Subject: [issue36554] unittest.TestCase: "subTest" cannot be used together with "debug" In-Reply-To: <1554719071.94.0.114334441524.issue36554@roundup.psfhosted.org> Message-ID: <1554740906.38.0.965237920737.issue36554@roundup.psfhosted.org> Change by Dieter Maurer : Added file: https://bugs.python.org/file48248/utest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:31:36 2019 From: report at bugs.python.org (daniel hahler) Date: Mon, 08 Apr 2019 16:31:36 +0000 Subject: [issue36563] pdbrc home twice Message-ID: <1554741096.03.0.623055077477.issue36563@roundup.psfhosted.org> Change by daniel hahler : ---------- nosy: blueyed priority: normal severity: normal status: open title: pdbrc home twice _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:33:31 2019 From: report at bugs.python.org (daniel hahler) Date: Mon, 08 Apr 2019 16:33:31 +0000 Subject: [issue36563] pdbrc is read twice if current directory is the home directory Message-ID: <1554741211.54.0.376476867999.issue36563@roundup.psfhosted.org> New submission from daniel hahler : If $HOME is $PWD, .pdbrc is read twice. This confused me when seeing intentional errors from there twice during tests. It should be only read once. ---------- components: +Library (Lib) title: pdbrc home twice -> pdbrc is read twice if current directory is the home directory versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:35:02 2019 From: report at bugs.python.org (daniel hahler) Date: Mon, 08 Apr 2019 16:35:02 +0000 Subject: [issue36563] pdbrc is read twice if current directory is the home directory In-Reply-To: <1554741211.54.0.376476867999.issue36563@roundup.psfhosted.org> Message-ID: <1554741302.61.0.74699182908.issue36563@roundup.psfhosted.org> Change by daniel hahler : ---------- keywords: +patch pull_requests: +12654 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:35:32 2019 From: report at bugs.python.org (Dieter Maurer) Date: Mon, 08 Apr 2019 16:35:32 +0000 Subject: [issue36554] unittest.TestCase: "subTest" cannot be used together with "debug" In-Reply-To: <1554719071.94.0.114334441524.issue36554@roundup.psfhosted.org> Message-ID: <1554741332.44.0.698702148802.issue36554@roundup.psfhosted.org> Dieter Maurer added the comment: This is a duplicate of issue34900 ---------- stage: -> resolved status: open -> closed Added file: https://bugs.python.org/file48249/utest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:39:34 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 16:39:34 +0000 Subject: [issue36554] unittest.TestCase: "subTest" cannot be used together with "debug" In-Reply-To: <1554719071.94.0.114334441524.issue36554@roundup.psfhosted.org> Message-ID: <1554741574.52.0.936353935212.issue36554@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks, just confirmed the commit fix with the given file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:39:55 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 16:39:55 +0000 Subject: [issue36554] unittest.TestCase: "subTest" cannot be used together with "debug" In-Reply-To: <1554719071.94.0.114334441524.issue36554@roundup.psfhosted.org> Message-ID: <1554741595.69.0.939384538711.issue36554@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- resolution: -> duplicate superseder: -> unittest subTests() fails when called from debug() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:45:34 2019 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 08 Apr 2019 16:45:34 +0000 Subject: [issue36564] Infinite loop with short maximum line lengths in EmailPolicy Message-ID: <1554741934.49.0.490765940263.issue36564@roundup.psfhosted.org> New submission from Paul Ganssle : When reviewing PR 12020 fixing an infinite loop in the e-mail module, I noticed that a *different* infinite loop is documented with a "# XXX" comment on line 2724: https://github.com/python/cpython/blob/58721a903074d28151d008d8990c98fc31d1e798/Lib/email/_header_value_parser.py#L2724 This is triggered when the policy's `max_line_length` is set to be shorter than minimum line length required by the "RFC 2047 chrome". It can be reproduced with: from email.policy import default policy = default.clone(max_line_length=7) # max_line_length = 78 policy.fold("Subject", "12345678") I could not find an entry on the tracker for this bug, but it is documented in the source code itself, so maybe I just didn't try hard enough. Related but distinct bugs: #33529, #33524 I will submit a patch to fix this. ---------- messages: 339660 nosy: barry, p-ganssle, r.david.murray priority: normal severity: normal status: open title: Infinite loop with short maximum line lengths in EmailPolicy versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:55:49 2019 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 08 Apr 2019 16:55:49 +0000 Subject: [issue36564] Infinite loop with short maximum line lengths in EmailPolicy In-Reply-To: <1554741934.49.0.490765940263.issue36564@roundup.psfhosted.org> Message-ID: <1554742549.05.0.225342491662.issue36564@roundup.psfhosted.org> Change by Paul Ganssle : ---------- keywords: +patch pull_requests: +12655 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 12:56:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 16:56:30 +0000 Subject: [issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing Message-ID: <1554742590.4.0.251583762845.issue36565@roundup.psfhosted.org> New submission from STINNER Victor : Disable the compilation of the built-in _abc module. For example, on Python 3.7 apply the following patch: diff --git a/Modules/Setup.dist b/Modules/Setup.dist index 8cc6bf0540..4015527b32 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist @@ -114,7 +114,7 @@ _weakref _weakref.c # weak references _functools -DPy_BUILD_CORE _functoolsmodule.c # Tools for working with functions and callable objects _operator _operator.c # operator.add() and similar goodies _collections _collectionsmodule.c # Container types -_abc _abc.c # Abstract base classes +#_abc _abc.c # Abstract base classes itertools itertoolsmodule.c # Functions creating iterators for efficient looping atexit atexitmodule.c # Register functions to be run at interpreter-shutdown _signal -DPy_BUILD_CORE signalmodule.c @@ -363,7 +363,8 @@ xxsubtype xxsubtype.c # Uncommenting the following line tells makesetup that all following modules # are not built (see above for more detail). # -#*disabled* +*disabled* # #_sqlite3 _tkinter _curses pyexpat #_codecs_jp _codecs_kr _codecs_tw unicodedata +_abc Recompile Python, check: $ ./python -c 'import _abc' ModuleNotFoundError: No module named '_abc' Run: $ ./python -u -m test -R 3:3 test_functools -m test_mro_conflicts Error without _abc: test test_functools crashed -- Traceback (most recent call last): File "/home/vstinner/prog/python/3.7/Lib/test/libregrtest/runtest.py", line 180, in runtest_inner refleak = dash_R(the_module, test, test_runner, ns.huntrleaks) File "/home/vstinner/prog/python/3.7/Lib/test/libregrtest/refleak.py", line 71, in dash_R abcs) File "/home/vstinner/prog/python/3.7/Lib/test/libregrtest/refleak.py", line 148, in dash_R_cleanup obj.register(ref()) File "/home/vstinner/prog/python/3.7/Lib/_py_abc.py", line 60, in register raise TypeError("Can only register classes") TypeError: Can only register classes With built-in _abc module, regrtest is fine. The problem comes from pure-Python reimplementation of abc._get_dump() in Lib/test/libregrtest/refleak.py: def _get_dump(cls): # For legacy Python version return (cls._abc_registry, cls._abc_cache, cls._abc_negative_cache, cls._abc_negative_cache_version) The first item tuple must be a set of weak references. Currently, it's a weak set of strong references. Attached PR fix the issue. ---------- components: Library (Lib) messages: 339661 nosy: vstinner priority: normal severity: normal status: open title: Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 13:03:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 17:03:21 +0000 Subject: [issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing In-Reply-To: <1554742590.4.0.251583762845.issue36565@roundup.psfhosted.org> Message-ID: <1554743001.44.0.672608722041.issue36565@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12656 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 13:10:48 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 17:10:48 +0000 Subject: [issue36564] Infinite loop with short maximum line lengths in EmailPolicy In-Reply-To: <1554741934.49.0.490765940263.issue36564@roundup.psfhosted.org> Message-ID: <1554743448.33.0.392099753746.issue36564@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 13:11:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 17:11:59 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554743519.82.0.0975088809024.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: Some progress. I'm now able to reproduce the issue with attached test_functools2.py (103 lines, a single test method): $ cp (...)test_functools2.py Lib/test/ $ ./configure -C --with-pydebug CFLAGS=-O0 $ make $ ./python -m test -F -j5 -R 3:3 test_functools2 (...) 0:00:02 load avg: 0.95 [ 19/1] test_functools failed beginning 6 repetitions 123456 ...... test_functools leaked [1, 1, 1] memory blocks, sum=3 (...) Tests result: FAILURE I disabled the C accelerator _functools. I'm now trying to disable the C accelerator of abc, but I had a small issue: bpo-36565. ---------- Added file: https://bugs.python.org/file48250/test_functools2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 13:14:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 17:14:54 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554743694.73.0.971622244391.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: The issue comes maybe from the complex code in Lib/test/libregrtest/refleak.py to handle the ABC cache: abcs = {} for abc in [getattr(collections.abc, a) for a in collections.abc.__all__]: if not isabstract(abc): continue for obj in abc.__subclasses__() + [abc]: abcs[obj] = _get_dump(obj)[0] ... # clear type cache sys._clear_type_cache() # Clear ABC registries, restoring previously saved ABC registries. abs_classes = [getattr(collections.abc, a) for a in collections.abc.__all__] abs_classes = filter(isabstract, abs_classes) for abc in abs_classes: for obj in abc.__subclasses__() + [abc]: for ref in abcs.get(obj, set()): if ref() is not None: obj.register(ref()) obj._abc_caches_clear() clear_caches() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 13:23:43 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 08 Apr 2019 17:23:43 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554744223.11.0.801098134383.issue36560@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 13:52:36 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 08 Apr 2019 17:52:36 +0000 Subject: [issue35907] Unnecessary URL scheme exists to allow file:// reading file in urllib In-Reply-To: <1549441191.29.0.148559977828.issue35907@roundup.psfhosted.org> Message-ID: <1554745956.63.0.178274480941.issue35907@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This issue seems to have been assigned CVE-2019-9948 (https://nvd.nist.gov/vuln/detail/CVE-2019-9948) as noted in https://github.com/python/cpython/pull/11842#issuecomment-480930608 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 15:07:12 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 19:07:12 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554750432.09.0.318875094475.issue36551@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: 12718-5f06333a4e49.json.gz ========================== Performance version: 0.7.0 Report on macOS-10.14.4-x86_64-i386-64bit Number of logical CPUs: 8 Start date: 2019-04-08 19:40:57.104845 End date: 2019-04-08 20:02:37.392894 +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | Benchmark | 2019-01-18_22-05-master-2cf1ddaff4c8.json.gz | PR12718 | Change | Significance | +=========================+==============================================+============================+==============+========================+ | 2to3 | 522 ms | 512 ms | 1.02x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | chaos | 184 ms | 195 ms | 1.06x slower | Significant (t=-7.09) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | crypto_pyaes | 169 ms | 177 ms | 1.05x slower | Significant (t=-8.85) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | deltablue | 11.9 ms | 12.8 ms | 1.07x slower | Significant (t=-11.53) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | django_template | 186 ms | 194 ms | 1.04x slower | Significant (t=-7.94) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | dulwich_log | 137 ms | 151 ms | 1.11x slower | Significant (t=-11.70) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | fannkuch | 642 ms | 676 ms | 1.05x slower | Significant (t=-7.55) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | float | 165 ms | 180 ms | 1.09x slower | Significant (t=-13.23) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | go | 394 ms | 418 ms | 1.06x slower | Significant (t=-9.24) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | hexiom | 15.6 ms | 15.8 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | html5lib | 136 ms | 137 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | json_dumps | 19.6 ms | 20.7 ms | 1.06x slower | Significant (t=-7.41) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | json_loads | 39.8 us | 42.7 us | 1.07x slower | Significant (t=-9.45) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | logging_format | 16.0 us | 16.7 us | 1.05x slower | Significant (t=-5.70) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | logging_silent | 318 ns | 315 ns | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | logging_simple | 14.3 us | 14.7 us | 1.03x slower | Significant (t=-3.92) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | mako | 26.8 ms | 28.2 ms | 1.05x slower | Significant (t=-9.89) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | meteor_contest | 141 ms | 142 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | nbody | 184 ms | 205 ms | 1.12x slower | Significant (t=-11.83) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | nqueens | 147 ms | 156 ms | 1.06x slower | Significant (t=-9.34) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pathlib | 64.1 ms | 69.3 ms | 1.08x slower | Significant (t=-9.63) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle | 14.6 us | 15.9 us | 1.09x slower | Significant (t=-9.44) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle_dict | 30.8 us | 33.0 us | 1.07x slower | Significant (t=-9.85) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle_list | 5.03 us | 5.38 us | 1.07x slower | Significant (t=-10.71) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle_pure_python | 728 us | 824 us | 1.13x slower | Significant (t=-8.22) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pidigits | 225 ms | 243 ms | 1.08x slower | Significant (t=-11.41) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | python_startup | 17.8 ms | 18.9 ms | 1.06x slower | Significant (t=-11.58) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | python_startup_no_site | 13.4 ms | 13.4 ms | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | raytrace | 817 ms | 868 ms | 1.06x slower | Significant (t=-8.63) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_compile | 274 ms | 282 ms | 1.03x slower | Significant (t=-3.86) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_dna | 222 ms | 240 ms | 1.08x slower | Significant (t=-10.92) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_effbot | 4.09 ms | 4.26 ms | 1.04x slower | Significant (t=-7.87) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_v8 | 31.1 ms | 32.8 ms | 1.05x slower | Significant (t=-10.98) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | richards | 120 ms | 128 ms | 1.07x slower | Significant (t=-9.24) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_fft | 522 ms | 584 ms | 1.12x slower | Significant (t=-35.12) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_lu | 272 ms | 289 ms | 1.06x slower | Significant (t=-9.51) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_monte_carlo | 159 ms | 171 ms | 1.08x slower | Significant (t=-17.46) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_sor | 308 ms | 323 ms | 1.05x slower | Significant (t=-10.00) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_sparse_mat_mult | 6.13 ms | 6.83 ms | 1.11x slower | Significant (t=-20.19) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | spectral_norm | 221 ms | 235 ms | 1.06x slower | Significant (t=-11.72) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sqlalchemy_declarative | 213 ms | 223 ms | 1.04x slower | Significant (t=-6.08) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sqlalchemy_imperative | 40.7 ms | 42.5 ms | 1.04x slower | Significant (t=-3.57) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sqlite_synth | 4.28 us | 4.79 us | 1.12x slower | Significant (t=-7.28) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_expand | 595 ms | 598 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_integrate | 26.3 ms | 26.5 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_str | 275 ms | 276 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_sum | 147 ms | 152 ms | 1.03x slower | Significant (t=-4.46) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | telco | 8.96 ms | 9.94 ms | 1.11x slower | Significant (t=-11.54) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpack_sequence | 62.4 ns | 68.8 ns | 1.10x slower | Significant (t=-5.13) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpickle | 22.1 us | 26.1 us | 1.18x slower | Significant (t=-14.43) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpickle_list | 5.37 us | 6.01 us | 1.12x slower | Significant (t=-15.64) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpickle_pure_python | 557 us | 572 us | 1.03x slower | Significant (t=-5.72) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_generate | 156 ms | 166 ms | 1.06x slower | Significant (t=-7.37) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_iterparse | 158 ms | 159 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_parse | 222 ms | 221 ms | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_process | 124 ms | 137 ms | 1.10x slower | Significant (t=-8.87) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 15:36:48 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 08 Apr 2019 19:36:48 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554752208.56.0.485345720278.issue36559@roundup.psfhosted.org> Brett Cannon added the comment: Could you explain a bit more, Victor, about why you want to avoid importing hashlib and OpenSSL so much? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 15:39:39 2019 From: report at bugs.python.org (sds) Date: Mon, 08 Apr 2019 19:39:39 +0000 Subject: [issue13947] gdbm reorganize() leaves hanging file descriptor In-Reply-To: <1328501616.08.0.882414908885.issue13947@psf.upfronthosting.co.za> Message-ID: <1554752379.83.0.453594467217.issue13947@roundup.psfhosted.org> sds added the comment: Upstream claims that this is fixed by http://git.gnu.org.ua/cgit/gdbm.git/commit/?id=a0d6c1a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 15:39:39 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 08 Apr 2019 19:39:39 +0000 Subject: [issue24565] the f_lineno getter is broken In-Reply-To: <1436042198.13.0.515231192679.issue24565@psf.upfronthosting.co.za> Message-ID: <1554752379.69.0.56352813257.issue24565@roundup.psfhosted.org> Xavier de Gaye added the comment: Fixed a bug in the implementation of PR 12419 while running the coverage.py test suite: f_lineno must be valid upon 'call' trace events. The confusion stems from the reason why until now we have prevented line jumps from 'call' trace events, see below. Summary: * Full coverage.py tests OK (including the C tracer). * Fixes issues #7238, #16482, #17277 and #17697. * We could now remove the restriction that prevents jumps from a call trace event. The restriction was based on the fact that f->f_trace is NULL until after the first return from call_trampoline() and setting f_lineno from within this first call to call_trampoline() would have had the f_lineno getter still return the value returned by PyCode_Addr2Line(), very confusing for the user ! * A trace function may be set in an extension modules by PyEval_SetTrace() and the extension module may not use f->f_trace and still make jumps using f_lineno. * Fixes _PyTraceback_Add() at https://github.com/python/cpython/blob/58721a903074d28151d008d8990c98fc31d1e798/Python/traceback.c#L272 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 15:49:45 2019 From: report at bugs.python.org (Tim Hatch) Date: Mon, 08 Apr 2019 19:49:45 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1554752985.86.0.521314857761.issue36541@roundup.psfhosted.org> Tim Hatch added the comment: jreese reminded me of pep570, which will make more grammar changes. I'm open to the idea of replacing the grammar with the live one, plus porting the 2isms forward like print, eval, except with comma. My sincere hope is that everyone that depends on this structure will have tests (mine and lib2to3 do); the only big user I'm aware of is probably libfuturize. Definitely worth a changelog entry if this is the way forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 16:00:48 2019 From: report at bugs.python.org (Joao Paulo) Date: Mon, 08 Apr 2019 20:00:48 +0000 Subject: [issue36562] Can't call a method from a module built in Python C API In-Reply-To: <1554737852.45.0.259157063198.issue36562@roundup.psfhosted.org> Message-ID: <1554753648.02.0.931028579462.issue36562@roundup.psfhosted.org> Joao Paulo added the comment: The following modifications solved the problem: static PyMethodDef pyModuleMethods[] = { { "runTester", (PyCFunction)runTesterFunc, METH_VARARGS | METH_KEYWORDS, "Foo Boo." }, { NULL, NULL, 0, NULL } }; static struct PyModuleDef MyModule = { PyModuleDef_HEAD_INIT, "my_module", "Foo Boo.", -1, pyModuleMethods, NULL }; ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 16:05:07 2019 From: report at bugs.python.org (Steven Vascellaro) Date: Mon, 08 Apr 2019 20:05:07 +0000 Subject: [issue36566] Support password masking in getpass.getpass() Message-ID: <1554753907.34.0.232598875583.issue36566@roundup.psfhosted.org> New submission from Steven Vascellaro : Support password masking in getpass.getpass() Currently, getpass.getpass() hides all user input when entering a password. This can throw off non-Unix users who are used to passwords being masked with asterisks *. This has led some users to write their own libraries for this functionality. Proposal: - Add an optional argument to `getpass.getpass()` for a character to mask user input Usage Example: > import getpass > password = getpass.getpass(mask='*') Password: ********** > password = getpass.getpass() Password: ---------- components: Library (Lib) messages: 339671 nosy: stevoisiak priority: normal severity: normal status: open title: Support password masking in getpass.getpass() type: enhancement versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 16:25:41 2019 From: report at bugs.python.org (Alex LordThorsen) Date: Mon, 08 Apr 2019 20:25:41 +0000 Subject: [issue22377] %Z in strptime doesn't match EST and others In-Reply-To: <1410301455.57.0.912701656833.issue22377@psf.upfronthosting.co.za> Message-ID: <1554755140.99.0.0791233326247.issue22377@roundup.psfhosted.org> Alex LordThorsen added the comment: This behavior is currently unchanged and the docs still state that `EST` is an acceptable value. ``` >>> datetime.strptime("2019-01-28 18:54:45 EST", "%Y-%m-%d %H:%M:%S %Z") Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.7/_strptime.py", line 577, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/local/lib/python3.7/_strptime.py", line 359, in _strptime (data_string, format)) ValueError: time data '2019-01-28 18:54:45 EST' does not match format '%Y-%m-%d %H:%M:%S %Z' ``` ---------- nosy: +Alex.LordThorsen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 16:32:55 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 20:32:55 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554755575.35.0.834196672689.issue36559@roundup.psfhosted.org> STINNER Victor added the comment: Raymond: > In general, we don't do deferred imports unless there is a compelling reason (i.e. it is very slow or it is sometimes unavailable). While I was working on adding OpenSSL 1.1.1 to Python 3.4, my _hashopenssl module was broken. In that case, "import random" fails with ImportError because of hashlib failures. I was surprised, since random doesn't need hashlib at startup. I would like to be able to use "import random" even if hashlib is broken. For me, random is a key component, whereas I see hashlib more as optional. (Even if in practice, it should always be available). Raymond: > Otherwise, it is a false optimization. Brett: > Could you explain a bit more, Victor, about why you want to avoid importing hashlib and OpenSSL so much? Well, OpenSSL is not a random tiny library. For example, loading it increases Python RSS of around 2.7 MiB. Example with script x.py: --- import os os.system(f"grep ^VmRSS /proc/{os.getpid()}/status") import random os.system(f"grep ^VmRSS /proc/{os.getpid()}/status") --- Output without the change on Fedora 29: VmRSS: 7396 kB VmRSS: 11796 kB # +4.4 MiB With the change: VmRSS: 7272 kB VmRSS: 8988 kB # +1.7 MiB Another example is that OpenSSL loads the libz.so dynamic library by dependency. I would prefer to minimize Python footprint if possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 16:48:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 20:48:32 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554756512.21.0.720070037166.issue36559@roundup.psfhosted.org> STINNER Victor added the comment: Raymond: > Why do we care about this particular import? It doesn't see slow in any way. I ran a benchmark: $ ./python -m perf command -o ref.json -v -- ./python -c 'import random' $ # apply patch $ ./python -m perf command -o patch.json -v -- ./python -c 'import random' $ ./python -m perf compare_to ref.json patch.json Mean +- std dev: [ref] 13.8 ms +- 0.2 ms -> [patch] 11.8 ms +- 0.2 ms: 1.18x faster (-15%) My PR 12728 makes Python startup 2 ms faster which I consider as quite significant on 13.8 ms. I know that some users are fighting to get a faster Python startup. Mercurial is just one example ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 17:05:01 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 21:05:01 +0000 Subject: [issue36566] Support password masking in getpass.getpass() In-Reply-To: <1554753907.34.0.232598875583.issue36566@roundup.psfhosted.org> Message-ID: <1554757501.37.0.433897220501.issue36566@roundup.psfhosted.org> Cheryl Sabella added the comment: Thank you for the suggestion. I believe this is a duplicate of issue 32884. ---------- nosy: +cheryl.sabella resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Adding the ability for getpass to print asterisks when passowrd is typed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 17:40:47 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 21:40:47 +0000 Subject: [issue36567] DOC: manpage directive doesn't create hyperlink Message-ID: <1554759647.95.0.266283511597.issue36567@roundup.psfhosted.org> New submission from Cheryl Sabella : The `manpage` directive in the docs is not creating a hyperlink to the Unix manual page. As of Sphinx 1.7, the `manpage` directive needs to have a `manpages_url` defined in the conf.py file. [1] http://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage ---------- assignee: docs at python components: Documentation messages: 339676 nosy: cheryl.sabella, docs at python, eric.araujo, ezio.melotti, mdk, willingc priority: normal severity: normal stage: needs patch status: open title: DOC: manpage directive doesn't create hyperlink type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 17:48:35 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 21:48:35 +0000 Subject: [issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories In-Reply-To: <1525964254.05.0.682650639539.issue33456@psf.upfronthosting.co.za> Message-ID: <1554760115.09.0.680879337062.issue33456@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +cheryl.sabella, docs at python, vinay.sajip versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:34:07 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 08 Apr 2019 22:34:07 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554762847.46.0.517633730223.issue35934@roundup.psfhosted.org> Giampaolo Rodola' added the comment: New changeset eb7e29f2a9d075accc1ab3faf3612ac44f5e2183 by Giampaolo Rodola in branch 'master': bpo-35934: Add socket.create_server() utility function (GH-11784) https://github.com/python/cpython/commit/eb7e29f2a9d075accc1ab3faf3612ac44f5e2183 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:35:18 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 08 Apr 2019 22:35:18 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554762918.92.0.0318943696663.issue17561@roundup.psfhosted.org> Change by Giampaolo Rodola' : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:39:30 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Mon, 08 Apr 2019 22:39:30 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554763170.23.0.259333934925.issue17561@roundup.psfhosted.org> Giampaolo Rodola' added the comment: Patch committed as of: https://github.com/python/cpython/commit/eb7e29f2a9d075accc1ab3faf3612ac44f5e2183 For posterity, since the API evolved since the original proposal (as per PR review/suggestions), this is the final incarnation: # IPv4 only >>> socket.create_server(addr) # IPv6 only >>> socket.create_server(addr, family=socket.AF_INET6) # IPv4 + IPv6 >>> socket.create_server(addr, family=socket.AF_INET6, dualstack_ipv6=True) # IPv4/6 if possible and don't care about IPv4 mapped addresses, else IPv4 >>> if socket.has_dualstack_ipv6(): ... s = socket.create_server(addr, family=socket.AF_INET6, dualstack_ipv6=True) ... else: ... s = socket.create_server(addr) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:45:54 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 22:45:54 +0000 Subject: [issue19992] subprocess documentation not explicit about fileno() In-Reply-To: <1387158760.79.0.499761911724.issue19992@psf.upfronthosting.co.za> Message-ID: <1554763554.3.0.241228997455.issue19992@roundup.psfhosted.org> Cheryl Sabella added the comment: Assigning to @Mariatta for the sprints. ---------- assignee: docs at python -> Mariatta nosy: +Mariatta, cheryl.sabella type: -> enhancement versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:47:44 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 22:47:44 +0000 Subject: [issue33601] [EASY DOC] Py_UTF8Mode is not documented In-Reply-To: <1526996981.47.0.682650639539.issue33601@psf.upfronthosting.co.za> Message-ID: <1554763664.47.0.0367503483071.issue33601@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- assignee: docs at python -> Mariatta keywords: -patch nosy: +Mariatta stage: patch review -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:50:22 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 22:50:22 +0000 Subject: [issue28043] Sane defaults for SSLContext options and ciphers In-Reply-To: <1473419921.81.0.961538270346.issue28043@psf.upfronthosting.co.za> Message-ID: <1554763822.73.0.73583321388.issue28043@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:53:28 2019 From: report at bugs.python.org (Alexander Mohr) Date: Mon, 08 Apr 2019 22:53:28 +0000 Subject: [issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops In-Reply-To: <1553894696.91.0.352723977034.issue36478@roundup.psfhosted.org> Message-ID: <1554764008.67.0.1273496885.issue36478@roundup.psfhosted.org> Alexander Mohr added the comment: I hit this as well in debian:jessie, and if I enabled -std=c99 I hit this issue: https://github.com/dvarrazzo/py-setproctitle/issues/62 ---------- nosy: +thehesiod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 18:56:54 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 22:56:54 +0000 Subject: [issue24743] Make _PyTraceback_Add public In-Reply-To: <1438084954.97.0.508949242804.issue24743@psf.upfronthosting.co.za> Message-ID: <1554764214.92.0.79907213478.issue24743@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- stage: -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:04:11 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 23:04:11 +0000 Subject: [issue26389] Expand traceback module API to accept just an exception as an argument In-Reply-To: <1455836350.85.0.0162824201978.issue26389@psf.upfronthosting.co.za> Message-ID: <1554764651.29.0.740160869698.issue26389@roundup.psfhosted.org> Cheryl Sabella added the comment: The last comment on the original PR for this issue was to wait until an API was decided upon before proceeding with creating a new PR. Bumping this issue to generate new discussion and hopefully reach concession on an API. ---------- nosy: +cheryl.sabella versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:06:58 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 23:06:58 +0000 Subject: [issue25922] canceling a repair install breaks the ability to uninstall, repair, or re-install In-Reply-To: <1450766945.03.0.168285757659.issue25922@psf.upfronthosting.co.za> Message-ID: <1554764818.67.0.0585915765504.issue25922@roundup.psfhosted.org> Cheryl Sabella added the comment: Going to close this as the original OP didn't provide the additional information that was requested. Feel free to reopen if additional info is provided. ---------- nosy: +cheryl.sabella resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:15:18 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 08 Apr 2019 23:15:18 +0000 Subject: [issue28351] statistics.geometric_mean can enter infinite loop for Decimal inputs In-Reply-To: <1475523187.92.0.24883134157.issue28351@psf.upfronthosting.co.za> Message-ID: <1554765318.07.0.303651710238.issue28351@roundup.psfhosted.org> Cheryl Sabella added the comment: The new version of geometric_mean does not enter an infinite loop for this example, so I am going to close this issue as out of date. ---------- nosy: +cheryl.sabella, rhettinger resolution: -> out of date stage: -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:27:54 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 23:27:54 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554766074.15.0.948766552903.issue36551@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg339665 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:31:25 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 08 Apr 2019 23:31:25 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554766285.19.0.355109960658.issue36551@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Here are the updated results for the benchmark suite. The previous results (unlinked from the issue to reduce noise) were against an old version of the master branch. 2019-04-08_13-08-master-58721a903074.json.gz ============================================ Performance version: 0.7.0 Report on Linux-5.0.5-1-ARCH-x86_64-with-glibc2.28 Number of logical CPUs: 12 Start date: 2019-04-09 00:32:40.656576 End date: 2019-04-09 00:54:03.721798 12718-5f06333a4e49.json.gz ========================== Performance version: 0.7.0 Report on Linux-5.0.5-1-ARCH-x86_64-with-glibc2.28 Number of logical CPUs: 12 Start date: 2019-04-09 00:07:53.433511 End date: 2019-04-09 00:29:32.603022 -- CURRENT MASTER -- -- PR12718 -- +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | Benchmark | 2019-04-08_13-08-master-58721a903074.json.gz | 12718-5f06333a4e49.json.gz | Change | Significance | +=========================+==============================================+============================+==============+========================+ | 2to3 | 455 ms | 465 ms | 1.02x slower | Significant (t=-2.27) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | chaos | 171 ms | 180 ms | 1.05x slower | Significant (t=-5.92) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | crypto_pyaes | 169 ms | 177 ms | 1.05x slower | Significant (t=-6.06) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | deltablue | 11.5 ms | 11.9 ms | 1.03x slower | Significant (t=-3.28) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | django_template | 175 ms | 191 ms | 1.09x slower | Significant (t=-13.00) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | dulwich_log | 127 ms | 131 ms | 1.03x slower | Significant (t=-8.97) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | fannkuch | 646 ms | 665 ms | 1.03x slower | Significant (t=-12.37) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | float | 165 ms | 165 ms | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | go | 386 ms | 381 ms | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | hexiom | 15.4 ms | 15.5 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | html5lib | 130 ms | 132 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | json_dumps | 18.4 ms | 18.3 ms | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | json_loads | 38.6 us | 38.6 us | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | logging_format | 15.0 us | 15.6 us | 1.04x slower | Significant (t=-10.98) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | logging_silent | 284 ns | 287 ns | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | logging_simple | 13.5 us | 13.9 us | 1.03x slower | Significant (t=-8.03) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | mako | 24.6 ms | 24.5 ms | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | meteor_contest | 157 ms | 155 ms | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | nbody | 196 ms | 198 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | nqueens | 144 ms | 147 ms | 1.02x slower | Significant (t=-9.68) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pathlib | 27.6 ms | 28.4 ms | 1.03x slower | Significant (t=-5.24) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle | 14.1 us | 14.2 us | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle_dict | 33.7 us | 35.2 us | 1.04x slower | Significant (t=-13.28) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle_list | 5.22 us | 5.38 us | 1.03x slower | Significant (t=-6.65) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pickle_pure_python | 681 us | 719 us | 1.05x slower | Significant (t=-5.64) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | pidigits | 217 ms | 219 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | python_startup | 12.2 ms | 12.5 ms | 1.02x slower | Significant (t=-9.34) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | python_startup_no_site | 8.90 ms | 8.92 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | raytrace | 789 ms | 793 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_compile | 267 ms | 270 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_dna | 221 ms | 221 ms | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_effbot | 3.94 ms | 3.98 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | regex_v8 | 30.4 ms | 30.4 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | richards | 108 ms | 108 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_fft | 525 ms | 525 ms | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_lu | 270 ms | 271 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_monte_carlo | 160 ms | 160 ms | 1.00x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_sor | 295 ms | 305 ms | 1.03x slower | Significant (t=-9.82) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | scimark_sparse_mat_mult | 6.63 ms | 6.57 ms | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | spectral_norm | 217 ms | 219 ms | 1.01x slower | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sqlalchemy_declarative | 239 ms | 244 ms | 1.02x slower | Significant (t=-4.34) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sqlalchemy_imperative | 50.7 ms | 52.0 ms | 1.03x slower | Significant (t=-3.84) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sqlite_synth | 4.20 us | 4.14 us | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_expand | 612 ms | 637 ms | 1.04x slower | Significant (t=-8.36) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_integrate | 27.5 ms | 28.9 ms | 1.05x slower | Significant (t=-4.16) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_str | 284 ms | 299 ms | 1.05x slower | Significant (t=-6.97) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | sympy_sum | 151 ms | 156 ms | 1.03x slower | Significant (t=-4.37) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | telco | 9.70 ms | 9.64 ms | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | tornado_http | 276 ms | 287 ms | 1.04x slower | Significant (t=-5.75) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpack_sequence | 64.4 ns | 67.3 ns | 1.05x slower | Significant (t=-6.16) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpickle | 22.8 us | 22.7 us | 1.01x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpickle_list | 5.72 us | 5.97 us | 1.04x slower | Significant (t=-6.05) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | unpickle_pure_python | 510 us | 527 us | 1.03x slower | Significant (t=-3.89) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_generate | 150 ms | 154 ms | 1.02x slower | Significant (t=-3.72) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_iterparse | 145 ms | 148 ms | 1.02x slower | Significant (t=-3.60) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_parse | 208 ms | 207 ms | 1.00x faster | Not significant | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ | xml_etree_process | 121 ms | 125 ms | 1.04x slower | Significant (t=-5.43) | +-------------------------+----------------------------------------------+----------------------------+--------------+------------------------+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:36:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 23:36:50 +0000 Subject: [issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing In-Reply-To: <1554742590.4.0.251583762845.issue36565@roundup.psfhosted.org> Message-ID: <1554766610.07.0.942009121776.issue36565@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 79b5d29041bd85ea3baa050b3fa2481344ea35c9 by Victor Stinner in branch 'master': bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733) https://github.com/python/cpython/commit/79b5d29041bd85ea3baa050b3fa2481344ea35c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:36:55 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 08 Apr 2019 23:36:55 +0000 Subject: [issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing In-Reply-To: <1554742590.4.0.251583762845.issue36565@roundup.psfhosted.org> Message-ID: <1554766615.47.0.86330338255.issue36565@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:54:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 23:54:24 +0000 Subject: [issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing In-Reply-To: <1554742590.4.0.251583762845.issue36565@roundup.psfhosted.org> Message-ID: <1554767664.56.0.300627405787.issue36565@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2368d86ed1249505b10561e005fc57f4884619c1 by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733) (GH-12734) https://github.com/python/cpython/commit/2368d86ed1249505b10561e005fc57f4884619c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 19:58:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 08 Apr 2019 23:58:35 +0000 Subject: [issue36565] Reference hunting (python3 -m test -R 3:3) doesn't work if the _abc module is missing In-Reply-To: <1554742590.4.0.251583762845.issue36565@roundup.psfhosted.org> Message-ID: <1554767915.02.0.943959817055.issue36565@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 20:19:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 00:19:24 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554769164.97.0.931570999905.issue17561@roundup.psfhosted.org> STINNER Victor added the comment: The change broke multiple buildbots. Example: https://buildbot.python.org/all/#builders/16/builds/2625 Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/_test_multiprocessing.py", line 4377, in test_wait_socket self.assertEqual(b''.join(v), expected) AssertionError: b'1\n2\n3\n4\n5\n6\n7\n8\n9\n' != b'0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n' More logs: https://github.com/python/cpython/pull/11784#issuecomment-481036369 ---------- nosy: +vstinner resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 20:44:39 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 09 Apr 2019 00:44:39 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554770679.46.0.281749906622.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: The logging library has never guaranteed that it wouldn't interleave or duplicate buffered io output when fork() in involved. We should not start trying to claim that it does. Too complicated and fragile. It can't. Users who want that should implement their own single logging handler that is well behaved in whatever regards they need. there are a ton of options for them. A basicConfig setting to switch the mode of operation to a single lock instead of per-handler locks could only happen in 3.8 (new feature). I'll ponder if it is even feasible to add that after the re-init change goes in. Even with such a feature, library user authored Handler subclasses would always be free to violate that. We can't protect people from themselves. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 21:19:13 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 09 Apr 2019 01:19:13 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554772753.38.0.686035359768.issue36559@roundup.psfhosted.org> Raymond Hettinger added the comment: In general, deferred imports are code smell that should avoided unless really necessary. They create an on-going maintenance burden (there's a reason most modules don't do this and put their imports at the top). FWIW, a broken hashlib is a localized bug, not an optimization problem. It doesn't affect any user with a build that passes the test suite. Running "python -v" shows that "random" is not part of the normal startup, so deferring the import saves zero for normal startup. It only affects modules that specifically import random. IIRC, Mercurial uses hashing extensively, so deferring the import doesn't help them at all. This is minor change, so I suppose we could let it go through; however, it seems somewhat arbitrary and the reasons offered seem dubious. For the most part, it isn't a good practice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 21:20:56 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 09 Apr 2019 01:20:56 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554772856.51.0.695583159514.issue36559@roundup.psfhosted.org> Raymond Hettinger added the comment: One other thought. This code has been present for over a decade. There is no evidence that anyone has ever wanted random to defer one of its imports. This seems like an invented problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 21:38:02 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 01:38:02 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554773882.41.0.786445021145.issue17561@roundup.psfhosted.org> Change by Giampaolo Rodola' : ---------- pull_requests: +12658 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 22:17:39 2019 From: report at bugs.python.org (Carl Cerecke) Date: Tue, 09 Apr 2019 02:17:39 +0000 Subject: [issue36568] Typo in socket.CAN_RAW_FD_FRAMES library documentation Message-ID: <1554776259.35.0.774393301329.issue36568@roundup.psfhosted.org> New submission from Carl Cerecke : https://docs.python.org/3/library/socket.html#socket.CAN_RAW_FD_FRAMES The wording "...however, you one must accept..." doesn't make sense. I think the "you one" should be "your application", but I'm not sure. ---------- assignee: docs at python components: Documentation messages: 339691 nosy: Carl Cerecke, docs at python priority: normal severity: normal status: open title: Typo in socket.CAN_RAW_FD_FRAMES library documentation versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 22:23:52 2019 From: report at bugs.python.org (Carl Cerecke) Date: Tue, 09 Apr 2019 02:23:52 +0000 Subject: [issue36568] Typo in socket.CAN_RAW_FD_FRAMES library documentation In-Reply-To: <1554776259.35.0.774393301329.issue36568@roundup.psfhosted.org> Message-ID: <1554776632.19.0.311705571833.issue36568@roundup.psfhosted.org> Carl Cerecke added the comment: See section 4.1.5 at https://www.kernel.org/doc/Documentation/networking/can.txt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 22:42:17 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 02:42:17 +0000 Subject: [issue1756] -m broken in trunk In-Reply-To: <1199732282.41.0.0565875093143.issue1756@psf.upfronthosting.co.za> Message-ID: <1554777736.98.0.474730685507.issue1756@roundup.psfhosted.org> Giampaolo Rodola' added the comment: New changeset 8702b67dad62a9084f6c1823dce10653743667c8 by Giampaolo Rodola in branch 'master': BPO-17561: set create_server backlog default to None (GH-12735) https://github.com/python/cpython/commit/8702b67dad62a9084f6c1823dce10653743667c8 ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 22:42:17 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 02:42:17 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554777737.12.0.00278280432546.issue17561@roundup.psfhosted.org> Giampaolo Rodola' added the comment: New changeset 8702b67dad62a9084f6c1823dce10653743667c8 by Giampaolo Rodola in branch 'master': BPO-17561: set create_server backlog default to None (GH-12735) https://github.com/python/cpython/commit/8702b67dad62a9084f6c1823dce10653743667c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 22:46:55 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 02:46:55 +0000 Subject: [issue1756] -m broken in trunk In-Reply-To: <1199732282.41.0.0565875093143.issue1756@psf.upfronthosting.co.za> Message-ID: <1554778015.98.0.0131293867803.issue1756@roundup.psfhosted.org> Giampaolo Rodola' added the comment: Sorry, I accidentally referenced this BPO issue in my commit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 8 23:09:34 2019 From: report at bugs.python.org (Eryk Sun) Date: Tue, 09 Apr 2019 03:09:34 +0000 Subject: [issue31512] Add non-elevated symlink support for dev mode Windows 10 In-Reply-To: <1505762190.77.0.84923243723.issue31512@psf.upfronthosting.co.za> Message-ID: <1554779374.25.0.51960860992.issue31512@roundup.psfhosted.org> Eryk Sun added the comment: :ping: It seems this was ready to be merged a while ago. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 00:35:30 2019 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 09 Apr 2019 04:35:30 +0000 Subject: [issue35848] readinto is not a method on io.TextIOBase In-Reply-To: <1548753520.89.0.970608711782.issue35848@roundup.psfhosted.org> Message-ID: <1554784530.18.0.516580075606.issue35848@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 7b97ab35b28b761ab1253df427ee674b1a90f465 by Benjamin Peterson (Steve Palmer) in branch 'master': closes bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH-11893) https://github.com/python/cpython/commit/7b97ab35b28b761ab1253df427ee674b1a90f465 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 00:35:39 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 04:35:39 +0000 Subject: [issue35848] readinto is not a method on io.TextIOBase In-Reply-To: <1548753520.89.0.970608711782.issue35848@roundup.psfhosted.org> Message-ID: <1554784539.37.0.019718751039.issue35848@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12659 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 00:57:42 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 04:57:42 +0000 Subject: [issue35848] readinto is not a method on io.TextIOBase In-Reply-To: <1548753520.89.0.970608711782.issue35848@roundup.psfhosted.org> Message-ID: <1554785862.19.0.705375677449.issue35848@roundup.psfhosted.org> miss-islington added the comment: New changeset 0a16bb15afec28f355bc28203b6b10610293f026 by Miss Islington (bot) in branch '3.7': closes bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH-11893) https://github.com/python/cpython/commit/0a16bb15afec28f355bc28203b6b10610293f026 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:35:20 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 09 Apr 2019 05:35:20 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554788120.85.0.549423344031.issue36551@roundup.psfhosted.org> anthony shaw added the comment: Have just optimized some of the code and pushed another change as 69dce1c552. ran both master and 69dce1c552 using pyperformance with PGO: ? ~ python3.8 -m perf compare_to master.json 69dce1c552.json --table +-------------------------+---------+-----------------------------+ | Benchmark | master | 69dce1c552 | +=========================+=========+=============================+ | 2to3 | 432 ms | 426 ms: 1.02x faster (-2%) | +-------------------------+---------+-----------------------------+ | chaos | 157 ms | 155 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | crypto_pyaes | 154 ms | 153 ms: 1.00x faster (-0%) | +-------------------------+---------+-----------------------------+ | dulwich_log | 123 ms | 124 ms: 1.00x slower (+0%) | +-------------------------+---------+-----------------------------+ | fannkuch | 603 ms | 600 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | float | 153 ms | 154 ms: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | go | 323 ms | 326 ms: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | hexiom | 13.6 ms | 13.5 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | json_dumps | 18.1 ms | 17.9 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | logging_format | 13.2 us | 13.8 us: 1.05x slower (+5%) | +-------------------------+---------+-----------------------------+ | logging_silent | 266 ns | 280 ns: 1.05x slower (+5%) | +-------------------------+---------+-----------------------------+ | logging_simple | 12.4 us | 13.1 us: 1.06x slower (+6%) | +-------------------------+---------+-----------------------------+ | meteor_contest | 145 ms | 132 ms: 1.10x faster (-9%) | +-------------------------+---------+-----------------------------+ | nbody | 179 ms | 172 ms: 1.04x faster (-4%) | +-------------------------+---------+-----------------------------+ | nqueens | 138 ms | 134 ms: 1.03x faster (-3%) | +-------------------------+---------+-----------------------------+ | pathlib | 56.4 ms | 55.6 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | pickle | 15.0 us | 15.4 us: 1.03x slower (+3%) | +-------------------------+---------+-----------------------------+ | pickle_pure_python | 620 us | 617 us: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | raytrace | 696 ms | 691 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | regex_compile | 242 ms | 243 ms: 1.00x slower (+0%) | +-------------------------+---------+-----------------------------+ | scimark_monte_carlo | 140 ms | 143 ms: 1.02x slower (+2%) | +-------------------------+---------+-----------------------------+ | scimark_sparse_mat_mult | 5.90 ms | 5.94 ms: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | spectral_norm | 194 ms | 196 ms: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | sympy_str | 246 ms | 245 ms: 1.00x faster (-0%) | +-------------------------+---------+-----------------------------+ | telco | 8.42 ms | 8.31 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | unpack_sequence | 59.2 ns | 59.7 ns: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | unpickle | 21.2 us | 21.4 us: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | unpickle_list | 5.73 us | 5.81 us: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | unpickle_pure_python | 471 us | 467 us: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ | xml_etree_iterparse | 142 ms | 143 ms: 1.01x slower (+1%) | +-------------------------+---------+-----------------------------+ | xml_etree_generate | 139 ms | 137 ms: 1.02x faster (-2%) | +-------------------------+---------+-----------------------------+ | xml_etree_process | 109 ms | 108 ms: 1.01x faster (-1%) | +-------------------------+---------+-----------------------------+ Not significant (21): deltablue; django_template; html5lib; json_loads; mako; pickle_dict; pickle_list; pidigits; python_startup; python_startup_no_site; regex_dna; regex_effbot; regex_v8; richards; scimark_fft; scimark_lu; scimark_sor; sympy_expand; sympy_integrate; sympy_sum; xml_etree_parse I'd like to look at the way range object LengthHint works, it looks like the path for those is not ideal and could use some optimization. Also, BUILD_LIST_PREALLOC uses the Iterator, not the actual object, so you can't use the much faster _HasLen and PyObject_Length(). I'm going to look at how __length_hint__ could be optimized for iterators that would make the smaller range cases more efficient. meteor_contest uses a lot of list comprehensions, so should show the impact for the patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:40:35 2019 From: report at bugs.python.org (Peter de Blanc) Date: Tue, 09 Apr 2019 05:40:35 +0000 Subject: [issue36569] @staticmethod seems to work with setUpClass, but docs say it shouldn't Message-ID: <1554788435.05.0.183130492369.issue36569@roundup.psfhosted.org> New submission from Peter de Blanc : According to unittest docs: https://docs.python.org/3.7/library/unittest.html#module-unittest `setUpClass is called with the class as the only argument and must be decorated as a classmethod()` and: `tearDownClass is called with the class as the only argument and must be decorated as a classmethod()` However, I was able to create a passing test case where `setUpClass` and `tearDownClass` are decorated with `@staticmethod` instead of `@classmethod`: I tested this with Python versions 3.6.4 and 3.7.1. Please update the documentation to indicate that `@staticmethod` is allowed here, or else indicate why it's bad. ---------- components: Library (Lib) files: test_bar.py messages: 339700 nosy: Peter de Blanc, ezio.melotti, michael.foord, rbcollins priority: normal severity: normal status: open title: @staticmethod seems to work with setUpClass, but docs say it shouldn't type: behavior versions: Python 3.6, Python 3.7 Added file: https://bugs.python.org/file48251/test_bar.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:43:14 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 05:43:14 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554788594.51.0.47358989206.issue30134@roundup.psfhosted.org> Inada Naoki added the comment: New changeset d012d64b6a513e760abb6745f7f7ce5e6a31f274 by Inada Naoki (cocoatomo) in branch '2.7': bpo-30134: add an explanation of BytesWarning (GH-1249) https://github.com/python/cpython/commit/d012d64b6a513e760abb6745f7f7ce5e6a31f274 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:43:23 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 05:43:23 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554788603.81.0.840175586059.issue30134@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:48:15 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 09 Apr 2019 05:48:15 +0000 Subject: [issue24743] Make _PyTraceback_Add public In-Reply-To: <1438084954.97.0.508949242804.issue24743@psf.upfronthosting.co.za> Message-ID: <1554788895.03.0.578437855112.issue24743@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +serhiy.storchaka versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:50:57 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 05:50:57 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554789057.11.0.055027367208.issue36551@roundup.psfhosted.org> Serhiy Storchaka added the comment: > I was going to note that the algorithm Anthony has pursued here is the same one we already use for the list constructor and list.extend(), but Inada-san already pointed that out :) And that optimization looks questionable to me. I tried to reduce an overhead for small lists, but this requires much more complex code and gives mixed results. I am -1 for this optimization because it affects only one particular case (neither other kinds of comprehensions, nor generator expressions, nor list comprehensions with conditions) and even in this case it is small. It is possible to add a lot of other optimizations for other cases which will sped up them to 50% or 100%, but we do not do this, because every such optimization has a cost. It increases the amount of code which should be maintained and covered by tests, it adds small overhead in common cases to speed up an uncommon case, and increasing the code base can negatively affect surrounding code (just because the CPU cache and registers are used inappropriate and the compiler optimizes less important paths). In addition, while this change speed up list comprehensions for long list, it slows down them for short lists. Short lists are more common. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:55:40 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 05:55:40 +0000 Subject: [issue24743] Make _PyTraceback_Add public In-Reply-To: <1438084954.97.0.508949242804.issue24743@psf.upfronthosting.co.za> Message-ID: <1554789340.57.0.317762467231.issue24743@roundup.psfhosted.org> Serhiy Storchaka added the comment: It looks like a hack and is used only three time in the CPython code. What is your use case? How do you use it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 01:59:24 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 05:59:24 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554789564.89.0.907957153297.issue30134@roundup.psfhosted.org> Serhiy Storchaka added the comment: This PR was not ready to merge. Please address my and Martin's comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 02:00:16 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 06:00:16 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554789616.86.0.793451638709.issue30134@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 02:14:13 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 06:14:13 +0000 Subject: [issue36569] @staticmethod seems to work with setUpClass, but docs say it shouldn't In-Reply-To: <1554788435.05.0.183130492369.issue36569@roundup.psfhosted.org> Message-ID: <1554790453.08.0.683141703146.issue36569@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The use case of setUpClass and tearDownClass is to run once during class setup and teardown where a class variable might be mutated. It's not a strict requirement [0] but rather maybe a common use case. There is at least one test case where setUpClass is used with @staticmethod at [1] [0] https://github.com/python/cpython/blob/5909ad1217aad200c69ffa794fcab285bacb609e/Lib/unittest/suite.py#L159 [1] https://github.com/python/cpython/blob/5909ad1217aad200c69ffa794fcab285bacb609e/Lib/test/test_dbm_gnu.py#L12 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 02:31:03 2019 From: report at bugs.python.org (mattcher_h) Date: Tue, 09 Apr 2019 06:31:03 +0000 Subject: [issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall In-Reply-To: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> Message-ID: <1554791463.07.0.401550584006.issue36557@roundup.psfhosted.org> mattcher_h added the comment: Hi Steve, Thank you for your response. Does the /quiet and /passiv works together with the /uninstall? When I read the Documentation it seems that the /uninstall included the /quiet. Could you tell me what exactly is the meaning of the /passiv? So am I right that the cmdline: "PathToPython.exe /uninstall /quiet" should work? I?m talking about "Python Launcher for Windows" https://www.python.org/dev/peps/pep-0397/ It appears in the System Control after installing Python3.7.3 ciao ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 02:31:56 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 06:31:56 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554791516.52.0.553273058374.issue30134@roundup.psfhosted.org> Inada Naoki added the comment: I addressed Martin's comment (buffer -> bytesarray). But I missed your point, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 02:33:32 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 06:33:32 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554791612.58.0.911982025369.issue30134@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +12660 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:00:55 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 07:00:55 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554793255.12.0.743235086703.issue30134@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 87ed1beb3e15c619f25b9a9308d1ec35659feffd by Inada Naoki in branch '2.7': bpo-30134: add BytesWarning in warnings.rst (GH-12738) https://github.com/python/cpython/commit/87ed1beb3e15c619f25b9a9308d1ec35659feffd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:04:14 2019 From: report at bugs.python.org (anthony shaw) Date: Tue, 09 Apr 2019 07:04:14 +0000 Subject: [issue36551] Optimize list comprehensions with preallocate size and protect against overflow In-Reply-To: <1554686901.99.0.0374079193358.issue36551@roundup.psfhosted.org> Message-ID: <1554793454.86.0.460464278237.issue36551@roundup.psfhosted.org> anthony shaw added the comment: >I am -1 for this optimization because it affects only one particular case (neither other kinds of comprehensions, nor generator expressions, nor list comprehensions with conditions) and even in this case it is small. It is possible to add a lot of other optimizations for other cases which will sped up them to 50% or 100%, but we do not do this, because every such optimization has a cost. It increases the amount of code which should be maintained and covered by tests, it adds small overhead in common cases to speed up an uncommon case, and increasing the code base can negatively affect surrounding code (just because the CPU cache and registers are used inappropriate and the compiler optimizes less important paths). Understood, I had hoped this change would have a broader impact. The additional opcode is not ideal either. > In addition, while this change speed up list comprehensions for long list, it slows down them for short lists. Short lists are more common. I've been profiling this today, basically, this implementation receives the `list_iter`, `range_iter`, etc. There is no standard object model for an iterator's length, _PyObject_HasLen would return false because it neither implements tp_as_sequence nor, tp_as_mapping (rightly so). What this has uncovered (so hopefully there's some value from this whole experience!) is that __length_hint__ for iterators is _really_ inefficient. Take a list_iterator for example: PyObject_LengthHint will call, _PyObject_HasLen, which returns false, which then goes to call _PyObject_LookupSpecial, then _PyObject_CallNoArg, which calls listiter_len, which calls PyList_GET_SIZE which returns a Py_ssize_t, which is then converted to a PyLong via PyLong_FromSsize_t, which is then returned back to PyObject_LengthHint, which then PyLong_AsSsize_t is run to convert the PyLong back into a Py_ssize_t The Py_ssize_t is then finally returned to the caller! My conclusion was that the list comprehension should be initialized to the length of the target, before GET_ITER is run. This would remove the overhead for range objects, because you could simply call _PyObject_HasLen, which would return true for dict, list, tuple and set, but false for range objects (which is what you want). The issue is that GET_ITER is called outside the code object for the comprehension, so you'd have to pass an additional argument to the comprehension generator. This is way outside of my expertise, but the only way I can see to find a sizeable benefit, with minimal code and no edge cases which are slower. Thanks for your time ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:08:44 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 07:08:44 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554793724.6.0.604343437472.issue30134@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12661 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:17:27 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 07:17:27 +0000 Subject: [issue33461] json.loads(encoding=) does not emit deprecation warning. In-Reply-To: <1526005873.13.0.682650639539.issue33461@psf.upfronthosting.co.za> Message-ID: <1554794247.63.0.155172294547.issue33461@roundup.psfhosted.org> Inada Naoki added the comment: New changeset a8abe097c1165db25b429ca02a65c4f8acbc062b by Inada Naoki (Matthias Bussonnier) in branch 'master': bpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762) https://github.com/python/cpython/commit/a8abe097c1165db25b429ca02a65c4f8acbc062b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:17:58 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 07:17:58 +0000 Subject: [issue33461] json.loads(encoding=) does not emit deprecation warning. In-Reply-To: <1526005873.13.0.682650639539.issue33461@psf.upfronthosting.co.za> Message-ID: <1554794278.4.0.401126179258.issue33461@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:27:40 2019 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 09 Apr 2019 07:27:40 +0000 Subject: [issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories In-Reply-To: <1525964254.05.0.682650639539.issue33456@psf.upfronthosting.co.za> Message-ID: <1554794860.68.0.845734125664.issue33456@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset c324c748871804f31f56b3bd02a8650b3bf1bae7 by Vinay Sajip (Lukas Waymann) in branch 'master': bpo-33456: site module documentation - fix wrong default for key in pyvenv.cfg (GH-6755) https://github.com/python/cpython/commit/c324c748871804f31f56b3bd02a8650b3bf1bae7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:30:51 2019 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 09 Apr 2019 07:30:51 +0000 Subject: [issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories In-Reply-To: <1525964254.05.0.682650639539.issue33456@psf.upfronthosting.co.za> Message-ID: <1554795051.19.0.293917423059.issue33456@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 03:57:09 2019 From: report at bugs.python.org (=?utf-8?b?RMSBdmlz?=) Date: Tue, 09 Apr 2019 07:57:09 +0000 Subject: [issue36570] ftplib timeouts for misconfigured server Message-ID: <1554796629.79.0.175383506692.issue36570@roundup.psfhosted.org> New submission from D?vis : It's not uncommon to encounter FTP servers which are misconfigured and return unroutable host IP (eg. internal IP) when using passive mode See: https://superuser.com/a/1195591 Most FTP clients such as FileZilla and WinSCP use a workaround when they encounter such servers and connect to user's specified host instead. > Command: PASV > Answer: 227 Entering Passive Mode (10,250,250,25,219,237). > Status: Server sent passive reply with unroutable address. Using server address instead. Currently Python's ftplib simply timeouts for these and doesn't work. ---------- messages: 339712 nosy: davispuh, giampaolo.rodola priority: normal severity: normal status: open title: ftplib timeouts for misconfigured server type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 04:05:18 2019 From: report at bugs.python.org (=?utf-8?b?RMSBdmlz?=) Date: Tue, 09 Apr 2019 08:05:18 +0000 Subject: [issue36570] ftplib timeouts for misconfigured server In-Reply-To: <1554796629.79.0.175383506692.issue36570@roundup.psfhosted.org> Message-ID: <1554797118.59.0.0431306147861.issue36570@roundup.psfhosted.org> Change by D?vis : ---------- keywords: +patch pull_requests: +12662 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 04:16:18 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 08:16:18 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554797778.26.0.197244002352.issue30134@roundup.psfhosted.org> Serhiy Storchaka added the comment: In 2.7 BytesWarning is emitted only on comparison between bytearray and unicode. All descriptions and comments should be corrected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 04:29:14 2019 From: report at bugs.python.org (Marcin Niemira) Date: Tue, 09 Apr 2019 08:29:14 +0000 Subject: [issue36571] Lib/smtplib.py have some pep8 issues Message-ID: <1554798554.15.0.922719157535.issue36571@roundup.psfhosted.org> New submission from Marcin Niemira : pycodestyle (pep8) reports some issues on linting for Lib/smtplib.py I believe we can fix most of them and apply some improvements due to pep-572. PR on GH. Are contributions like this valuable? ---------- components: Library (Lib) messages: 339714 nosy: Marcin Niemira priority: normal severity: normal status: open title: Lib/smtplib.py have some pep8 issues versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 04:33:57 2019 From: report at bugs.python.org (Marcin Niemira) Date: Tue, 09 Apr 2019 08:33:57 +0000 Subject: [issue36571] Lib/smtplib.py have some pep8 issues In-Reply-To: <1554798554.15.0.922719157535.issue36571@roundup.psfhosted.org> Message-ID: <1554798837.94.0.188562986522.issue36571@roundup.psfhosted.org> Change by Marcin Niemira : ---------- keywords: +patch pull_requests: +12664 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 04:43:18 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 08:43:18 +0000 Subject: [issue36570] ftplib timeouts for misconfigured server In-Reply-To: <1554796629.79.0.175383506692.issue36570@roundup.psfhosted.org> Message-ID: <1554799398.37.0.683588466408.issue36570@roundup.psfhosted.org> Giampaolo Rodola' added the comment: Please no. The mistake should be fixed in the misconfigured FTP server, not in ftplib, which should not make this event pass unnoticed or take arbitrary decisions. Filezilla is different than ftplib in that it's an end-user app. ftplib is not (e.g. it can be used for testing FTP server implementations, like pyftpdlib). A possible alternative is making socket.create_connection() show the address in case of error, like we do in socket.create_server: https://github.com/python/cpython/blob/8702b67dad62a9084f6c1823dce10653743667c8/Lib/socket.py#L803-L805 That would at least provide a hint on what's the real issue. If you want to provide a patch for that you have my blessing. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 04:51:09 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 08:51:09 +0000 Subject: [issue36571] Lib/smtplib.py have some pep8 issues In-Reply-To: <1554798554.15.0.922719157535.issue36571@roundup.psfhosted.org> Message-ID: <1554799869.95.0.0690728872584.issue36571@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Generally changes only related to PEP 8 are not merged since they pollute git history while using blame and a lot of other modules also don't adhere to PEP 8. New code written can have PEP 8 enforced or the related parts of the code can be refactored while making a change but style alone changes/refactors are not merged. Also the current PR uses PEP 572 assignment expressions. It's okay to use it in new code but doesn't add value in converting old code to use it. I have added email module maintainers to take a call on the same. ---------- components: +email nosy: +barry, r.david.murray, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 05:16:36 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 09:16:36 +0000 Subject: [issue36571] Lib/smtplib.py have some pep8 issues In-Reply-To: <1554798554.15.0.922719157535.issue36571@roundup.psfhosted.org> Message-ID: <1554801396.53.0.914423255663.issue36571@roundup.psfhosted.org> Christian Heimes added the comment: Yes, I totally agree with xtreak. We try to avoid unnecessary code changes. Any change comes with a risk and cost to pay. PEP 8 is just a guideline for new code. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 05:24:08 2019 From: report at bugs.python.org (mattcher_h) Date: Tue, 09 Apr 2019 09:24:08 +0000 Subject: [issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall In-Reply-To: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> Message-ID: <1554801848.4.0.645276479313.issue36557@roundup.psfhosted.org> mattcher_h added the comment: ok the "PathToPython.exe /uninstall /quiet" seems to work. Thanks for this hint. I found the Python Launcher in the registry path for x86, this was not what I expected after install Python3.7.3 x64. In the registry they show an uninstall command what works when I use it direct on the PC. MsiExec.exe /X{A28C27E4-A725-482A-9C65-61EDC0E4D583} But it won?t work as an automated install command over network. Probably not the fault of Python Launcher. Maybe there is an other opportunity to uninstall PythonLauncher? ciao ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 05:32:09 2019 From: report at bugs.python.org (Marcin Niemira) Date: Tue, 09 Apr 2019 09:32:09 +0000 Subject: [issue36571] Lib/smtplib.py have some pep8 issues In-Reply-To: <1554798554.15.0.922719157535.issue36571@roundup.psfhosted.org> Message-ID: <1554802329.2.0.332852478338.issue36571@roundup.psfhosted.org> Marcin Niemira added the comment: Thanks for the explanation. I'll close issue and PR. Cheers :) ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 05:45:08 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 09:45:08 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554803108.71.0.335673194436.issue36559@roundup.psfhosted.org> Christian Heimes added the comment: You could also use the internal _sha512 module. It's always present, small, lean and provides a SHA512 implementation with sufficient performance. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 05:47:31 2019 From: report at bugs.python.org (Slim) Date: Tue, 09 Apr 2019 09:47:31 +0000 Subject: [issue36572] python-snappy install issue during Crossbar install with Python 3.7.3 (Windows x86 executable installer) Message-ID: <1554803251.97.0.1929107908.issue36572@roundup.psfhosted.org> New submission from Slim : In a Windows 2016 VM, when trying to install Crossbar in offline mode, we observed the following error: error Running setup.py install for python-snappy ... error ... snappy/snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2 Here the steps to reproduce this issue: 0) In a Windows 10 machine (where we create our MSI): -> we download the corresponding python-3.7.3.exe (Windows x86 executable installer) -> we download pyWin32 & crossbar & pip in a specific folder: pip download -d "C:\Crossbar373" PyWin32==224 pip download -d "C:\Crossbar373" crossbar==19.3.5 pip download -d "C:\Crossbar373" pip==19.0.3 -> python-3.7.3.exe /quiet /layout "C:\Temp\Python373Layout" -> Our MSI use this folder as an input to install Python 3.7.3 in the target Windows 2016 VM in offline mode 1) In the target Windows 2016 VM (where we launch our MSI): -> Our MSI install Visual Studio 2019 from https://visualstudio.microsoft.com/downloads/ (default values) -> It also removes the MAX_PATH Limitation -> It copies all the files needed to install crossbar in the "C:\Crossbar373" folder -> Then it executes the following custom actions in this machine: a) python-3.7.3.exe /quiet InstallAllUsers=1 TargetDir="C:\Python373x86ExecInstaller" PrependPath=1 Include_pip=0 Include_launcher=0 Include_test=0 b) python -m pip install --upgrade pip==19.0.3 c) pip.exe install --no-warn-script-location --disable-pip-version-check --no-index --find-links "C:\Crossbar373" PyWin32==224 d) pip.exe install --no-warn-script-location --disable-pip-version-check --no-index --find-links "C:\Crossbar373" incremental e) pip.exe install --no-warn-script-location --disable-pip-version-check --no-index --find-links "C:\Crossbar373" crossbar f) Finally, this issue occurs. The only workaround found to fix this issue is to: 1) download python_snappy-0.5.4-cp37-cp37m-win32.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/ 2) and install it with our MSI in the target VM before step e): pip install C:\Crossbar372\python_snappy-0.5.4-cp37-cp37m-win32.whl This issue seems also to occur with Python 3.7.2 version. Questions: 1) Is there any invalid step in our process? 2) Is this workaround validated by you? As this wheel file does not seem to be official. 3) Is this issue related to https://github.com/crossbario/crossbar/issues/1521 one? and thus will be fixed in forthcoming versions? ---------- messages: 339721 nosy: telatoa priority: normal severity: normal status: open title: python-snappy install issue during Crossbar install with Python 3.7.3 (Windows x86 executable installer) type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 05:49:43 2019 From: report at bugs.python.org (Jozef Cernak) Date: Tue, 09 Apr 2019 09:49:43 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' Message-ID: <1554803383.11.0.72187159386.issue36573@roundup.psfhosted.org> New submission from Jozef Cernak : Hi, in the short program, that works well for password of 4 character, when I change password length I got this error (parameter MAXD) Traceback (most recent call last): File "p33.py", line 54, in zf.extractall( pwd=password.encode('cp850','replace')) File "/usr/lib/python3.5/zipfile.py", line 1347, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1335, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1399, in _extract_member shutil.copyfileobj(source, target) File "/usr/lib/python3.5/shutil.py", line 73, in copyfileobj buf = fsrc.read(length) File "/usr/lib/python3.5/zipfile.py", line 844, in read data = self._read1(n) File "/usr/lib/python3.5/zipfile.py", line 934, in _read1 self._update_crc(data) File "/usr/lib/python3.5/zipfile.py", line 862, in _update_crc raise BadZipFile("Bad CRC-32 for file %r" % self.name) zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' program: import string, zipfile, zlib from zipfile import ZipFile zf= ZipFile('11_02_2019.pdf.zip') MAXD=6 upper_case=string.ascii_uppercase uc=list(upper_case) n=len(uc) print (n) pos=[] for k in range(0,MAXD): pos.append(0) print (pos) for let in range(0,n): print (let, uc[let]) let=0 koniec=0; k3=0 p=0 while koniec != MAXD : k=0 password='' for k2 in range(0,MAXD): password=password+uc[pos[k2]] print (password) try: with zipfile.ZipFile('11_02_2019.pdf.zip') as zf: zf.extractall( pwd=password.encode('cp850','replace')) print ("Password found:" + password) exit(0) except RuntimeError: pass except zlib.error: pass #print "ppppppppppppppppppppppppp",p, paswd pos[0]=pos[0]+1 for k2 in range(0,MAXD-1): if pos[k2]>=n: pos[k2]=0 pos[k2+1]=pos[k2+1]+1 koniec=0 for k2 in range(0,MAXD): if pos[k2] >= n-1: koniec=koniec+1 Similar behaviuor I observed in older version of python (2.7) and correspondig library. The zip archive is procted by simple password 'ABCD', the file is not big less tha 1MB. Best regards Jozef ---------- components: Library (Lib) messages: 339722 nosy: Jozef Cernak priority: normal severity: normal status: open title: zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:04:32 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 10:04:32 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554804272.95.0.142386426748.issue36559@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +12665 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:11:01 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 09 Apr 2019 10:11:01 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554803383.11.0.72187159386.issue36573@roundup.psfhosted.org> Message-ID: <1554804661.91.0.804362410634.issue36573@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +alanmcintyre, serhiy.storchaka, twouters type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:34:52 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 10:34:52 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554806092.4.0.618732194.issue17561@roundup.psfhosted.org> Giampaolo Rodola' added the comment: Fixed. There's a remaining failing BB: https://buildbot.python.org/all/#/builders/176/builds/185/steps/4/logs/stdio ...but the failure appears unrelated and it has been red for a while. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:36:22 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 10:36:22 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1554806182.41.0.944377438742.issue18372@roundup.psfhosted.org> STINNER Victor added the comment: > Tracking objects that do not need this will just add work to the garbage collector. Not all instances of trackable types should be tracked, for example the empty tuple and some dicts are not tracked. Well, in that case, we should do the opposite of PR 8505, what I proposed there: https://github.com/python/cpython/pull/8505#issuecomment-480763122 "Either GC support must be removed (remove Py_TPFLAGS_HAVE_GC, remove tp_clear and tp_traverse, etc.), or the implementation should be fixed (call PyObject_GC_Track)." => fully remove the GC support I don't see the point of implementing tp_traverse if it's not called. I'm not sure if tp_clear is related to the GC or not. Maybe keep it :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:37:31 2019 From: report at bugs.python.org (=?utf-8?b?RMSBdmlz?=) Date: Tue, 09 Apr 2019 10:37:31 +0000 Subject: [issue36570] ftplib timeouts for misconfigured server In-Reply-To: <1554796629.79.0.175383506692.issue36570@roundup.psfhosted.org> Message-ID: <1554806251.17.0.105570179913.issue36570@roundup.psfhosted.org> D?vis added the comment: The problem is that most of time you have no control over that FTP server but you still want to download files from that FTP server using Python. Currently that's just not possible. Maybe there could be some flag to enable workarounds for these cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:45:01 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 10:45:01 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1554806701.23.0.0241453401665.issue18372@roundup.psfhosted.org> Serhiy Storchaka added the comment: GC support can not be removed, because these objects are created also as long living objects using the standard way. And in this case they are tracked (in PyType_GenericAlloc()) and tp_traverse is called. They are not tracked only when created by an internal API _Pickler_New() and _Unpickler_New(). The current code is correct and I do not see reasons to change it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:47:03 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 10:47:03 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554803383.11.0.72187159386.issue36573@roundup.psfhosted.org> Message-ID: <1554806823.98.0.273756436607.issue36573@roundup.psfhosted.org> Serhiy Storchaka added the comment: Do you get an error when try to extract the file using the valid password? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 06:55:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 10:55:15 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554807315.2.0.930164000335.issue36560@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12666 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 07:01:46 2019 From: report at bugs.python.org (Jozef Cernak) Date: Tue, 09 Apr 2019 11:01:46 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554806823.98.0.273756436607.issue36573@roundup.psfhosted.org> Message-ID: Jozef Cernak added the comment: Dear Serhiy, in the case of correct password, the program works well: OACD PACD QACD RACD SACD TACD UACD VACD WACD XACD YACD ZACD ABCD Password found:ABCD for five characters: RRJBA Traceback (most recent call last): File "p33.py", line 54, in zf.extractall( pwd=password.encode('cp850','replace')) File "/usr/lib/python3.5/zipfile.py", line 1347, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1335, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1399, in _extract_member shutil.copyfileobj(source, target) File "/usr/lib/python3.5/shutil.py", line 73, in copyfileobj buf = fsrc.read(length) File "/usr/lib/python3.5/zipfile.py", line 844, in read data = self._read1(n) File "/usr/lib/python3.5/zipfile.py", line 934, in _read1 self._update_crc(data) File "/usr/lib/python3.5/zipfile.py", line 862, in _update_crc raise BadZipFile("Bad CRC-32 for file %r" % self.name) zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' specially for RRJBA AAAAA Traceback (most recent call last): File "p33.py", line 54, in zf.extractall( pwd=password.encode('cp850','replace')) File "/usr/lib/python3.5/zipfile.py", line 1347, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1335, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1399, in _extract_member shutil.copyfileobj(source, target) File "/usr/lib/python3.5/shutil.py", line 73, in copyfileobj buf = fsrc.read(length) File "/usr/lib/python3.5/zipfile.py", line 844, in read data = self._read1(n) File "/usr/lib/python3.5/zipfile.py", line 934, in _read1 self._update_crc(data) File "/usr/lib/python3.5/zipfile.py", line 862, in _update_crc raise BadZipFile("Bad CRC-32 for file %r" % self.name) zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' for six characters: KMQAAA LMQAAA MMQAAA NMQAAA OMQAAA PMQAAA QMQAAA RMQAAA SMQAAA TMQAAA UMQAAA VMQAAA WMQAAA XMQAAA YMQAAA ZMQAAA ANQAAA Traceback (most recent call last): File "p33.py", line 54, in zf.extractall( pwd=password.encode('cp850','replace')) File "/usr/lib/python3.5/zipfile.py", line 1347, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1335, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1399, in _extract_member shutil.copyfileobj(source, target) File "/usr/lib/python3.5/shutil.py", line 73, in copyfileobj buf = fsrc.read(length) File "/usr/lib/python3.5/zipfile.py", line 844, in read data = self._read1(n) File "/usr/lib/python3.5/zipfile.py", line 934, in _read1 self._update_crc(data) File "/usr/lib/python3.5/zipfile.py", line 862, in _update_crc raise BadZipFile("Bad CRC-32 for file %r" % self.name) zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' It seems that after certain attempts command produces different behaviour as in the previous attemts to call zf.extractall( pwd=password.encode('cp850','replace')) Best regards Jozef On Tue, Apr 9, 2019 at 12:47 PM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Do you get an error when try to extract the file using the valid password? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 07:05:44 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 11:05:44 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554803383.11.0.72187159386.issue36573@roundup.psfhosted.org> Message-ID: <1554807944.05.0.485437978142.issue36573@roundup.psfhosted.org> Serhiy Storchaka added the comment: If you try to extract the file using an invalid password, it is an expected behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 07:09:34 2019 From: report at bugs.python.org (Jozef Cernak) Date: Tue, 09 Apr 2019 11:09:34 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554807944.05.0.485437978142.issue36573@roundup.psfhosted.org> Message-ID: Jozef Cernak added the comment: Ok, however behaviur is detected after several attempts i.e. behaviour is not regular but depends on the previous history, how or how many times functions was called. I think such behaviur should indicate that function store previous data, i.e. history. Best regards Jozef On Tue, Apr 9, 2019 at 1:05 PM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > If you try to extract the file using an invalid password, it is an > expected behavior. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 07:20:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 11:20:13 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554808813.87.0.00910888556036.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: This issue isn't a real memory leak: if I use -R 3:10 instead of -R 3:3, the test doesn't fail anymore. But the issue is still annoying since it makes Refleaks buildbot workers fail randomly :-/ This issue remembers me the unstable multiprocessing tests: * bpo-33735: test_multiprocessing_spawn leaked [1, 2, 1] memory blocks on AMD64 Windows8.1 Refleaks 3.7 * bpo-33984: test_multiprocessing_forkserver leaked [1, 2, 1] memory blocks on x86 Gentoo Refleaks 3.x Patch to always display memory allocations differences: diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index d68ea63b5b..997be819fa 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -118,6 +118,8 @@ def dash_R(the_module, test, indirect_test, huntrleaks): print(msg, file=refrep) refrep.flush() failed = True + if not failed: + print(alloc_deltas[nwarmup:]) return failed Truncated output with the patch: vstinner at apu$ ./python -m test -F -r -j1 -R 3:10 test_functools Using random seed 4308771 Run tests in parallel using 1 child processes 0:00:04 load avg: 0.91 [ 1] test_functools passed [0, 1, 2, 0, 0, 0, 0, 0, 0, 0] ... 0:00:13 load avg: 0.92 [ 3] test_functools passed [2, 1, 0, 0, 0, 0, 0, 0, 0, 0] ... 0:00:17 load avg: 0.93 [ 4] test_functools passed [0, 3, 0, 0, 0, 0, 0, 0, 0, 0] ... 0:00:21 load avg: 0.93 [ 5] test_functools passed [0, 1, 0, 0, 2, 0, 0, 0, 0, 0] ... 0:00:26 load avg: 0.93 [ 6] test_functools passed [0, 4, 0, 0, 0, 0, 0, 0, 0, 0] ... 0:00:34 load avg: 0.87 [ 8] test_functools passed [0, 1, 0, 2, 0, 0, 0, 0, 0, 0] ... 0:01:06 load avg: 1.15 [ 15] test_functools passed [0, 1, 0, 2, 0, -1, 1, 0, 0, 0] ... 0:01:10 load avg: 1.46 [ 16] test_functools passed [0, 4, 0, 0, 0, 0, 0, 0, -1, 1] ... The maximum sum() of these list is around 5 on 10 runs: not every run leaks a memory block. It looks more like a internal cache which is "unstable" if you look at the number of allocated memory blocks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 07:22:53 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 11:22:53 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554808973.92.0.921490252626.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 12743 to modify _abc: use weakref.WeakSet rather than using directly a set of weak references. With this PR, calling _get_dump() should clear all broken weak references. I'm not sure if it's really useful for this specific issue, since dash_R_cleanup() calls obj._abc_caches_clear() on all abstract base classes (ABC): all caches must be removed before reading the total number of allocated memory blocks (sys.getallocatedblocks()). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 07:28:49 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 11:28:49 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554809329.0.0.872333856633.issue36560@roundup.psfhosted.org> Serhiy Storchaka added the comment: _abc was written for optimization. Your PR makes it using slower Python code. Could you please test how much this hits the performance of abc? ---------- nosy: +inada.naoki, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:01:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 12:01:30 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554811290.94.0.622504192669.issue36560@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:05:05 2019 From: report at bugs.python.org (Jozef Cernak) Date: Tue, 09 Apr 2019 12:05:05 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554807944.05.0.485437978142.issue36573@roundup.psfhosted.org> Message-ID: Jozef Cernak added the comment: Hi, I changed zipped file password to the new string "RRJBB" that is a combination after RRJBA to see what will happen. At the input combination KWFEA I got the message: KWFEA Traceback (most recent call last): File "p33.py", line 54, in zf.extractall( pwd=password.encode('cp850','replace')) File "/usr/lib/python3.5/zipfile.py", line 1347, in extractall self.extract(zipinfo, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1335, in extract return self._extract_member(member, path, pwd) File "/usr/lib/python3.5/zipfile.py", line 1399, in _extract_member shutil.copyfileobj(source, target) File "/usr/lib/python3.5/shutil.py", line 73, in copyfileobj buf = fsrc.read(length) File "/usr/lib/python3.5/zipfile.py", line 844, in read data = self._read1(n) File "/usr/lib/python3.5/zipfile.py", line 934, in _read1 self._update_crc(data) File "/usr/lib/python3.5/zipfile.py", line 862, in _update_crc raise BadZipFile("Bad CRC-32 for file %r" % self.name) zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019B.pdf' Jozef On Tue, Apr 9, 2019 at 1:05 PM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > If you try to extract the file using an invalid password, it is an > expected behavior. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:05:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 12:05:09 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554811509.61.0.135389264674.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: If I modify libregrtest with the following patch: diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 0bb8a0a2bf..f0225a9768 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -128,7 +128,7 @@ def dash_R(ns, the_module, test_name, test_func): failed = False for deltas, item_name, checker in [ (rc_deltas, 'references', check_rc_deltas), - (alloc_deltas, 'memory blocks', check_rc_deltas), + (alloc_deltas, 'memory blocks', check_fd_deltas), (fd_deltas, 'file descriptors', check_fd_deltas) ]: # ignore warmup runs And I add the following file Lib/test/test_noop.py: import unittest class NoopTests(unittest.TestCase): def test_noop(self): pass regrtest detects a "leak": $ ./python -m test -R 3:3 test_noop Run tests sequentially 0:00:00 load avg: 0.55 [1/1] test_noop beginning 6 repetitions 123456 ...... test_noop leaked [0, 1, 0] memory blocks, sum=1 test_noop failed == Tests result: FAILURE == 1 test failed: test_noop Total duration: 113 ms Tests result: FAILURE The issue comes from this look in Lib/test/libregrtest/refleak.py: for i in range(repcount): indirect_test() alloc_after, rc_after, fd_after = dash_R_cleanup(fs, ps, pic, zdc, abcs) print('.', end='', file=sys.stderr, flush=True) if i >= nwarmup: rc_deltas[i] = get_pooled_int(rc_after - rc_before) alloc_deltas[i] = get_pooled_int(alloc_after - alloc_before) fd_deltas[i] = get_pooled_int(fd_after - fd_before) alloc_before = alloc_after rc_before = rc_after fd_before = fd_after Because of "if i >= nwarmup:", get_pooled_int() isn't call during "warmup", whereas the purpose of the warmup is to warmup *everything*. Maybe get_pooled_int() allocates one frame object and keeps it alive in its "zombi frame". Maybe something else is allocated and kept alive. Anything, removing "if i >= nwarmup:" to always compute deltas fix this specific issue. Attached PR 12744 fix this bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:06:00 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 12:06:00 +0000 Subject: [issue36573] zipfile zipfile.BadZipFile: Bad CRC-32 for file '11_02_2019.pdf' In-Reply-To: <1554803383.11.0.72187159386.issue36573@roundup.psfhosted.org> Message-ID: <1554811560.95.0.881108023501.issue36573@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is how the weak encryption in ZIP files work. In 255 cases from 256 the wrong password can be detected earlier (this make the encryption just weaker). But it 1 case of 256 this check is passed and you will get either an error of mismatched CRC, or the compressor specific error if use compression. There is even very small chance (1 of 2**32 or like) that you will silently get incorrectly decrypted data. It is better to not use the weak encryption in ZIP files. If you need to encrypt data safely, use third-party encryption libraries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:20:47 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 12:20:47 +0000 Subject: [issue34060] regrtest: log "CPU usage" on Windows In-Reply-To: <1530892869.55.0.56676864532.issue34060@psf.upfronthosting.co.za> Message-ID: <1554812447.17.0.297903695542.issue34060@roundup.psfhosted.org> Cheryl Sabella added the comment: New changeset e16467af0bfcc9f399df251495ff2d2ad20a1669 by Cheryl Sabella (Ammar Askar) in branch 'master': bpo-34060: Report system load when running test suite for Windows (GH-8357) https://github.com/python/cpython/commit/e16467af0bfcc9f399df251495ff2d2ad20a1669 ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:23:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 12:23:51 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554812631.03.0.217889294447.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5aaac94eeb44697e92b0951385cd557bc27e0f6a by Victor Stinner in branch 'master': bpo-36560: Fix reference leak hunting in regrtest (GH-12744) https://github.com/python/cpython/commit/5aaac94eeb44697e92b0951385cd557bc27e0f6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:37:38 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 12:37:38 +0000 Subject: [issue34060] regrtest: log "CPU usage" on Windows In-Reply-To: <1530892869.55.0.56676864532.issue34060@psf.upfronthosting.co.za> Message-ID: <1554813458.83.0.569917280196.issue34060@roundup.psfhosted.org> Cheryl Sabella added the comment: I've merged PR8357. I believe PR8287 can be closed now with PR8357 as the superseder? Thank you to everyone for your contributions to this discussion! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:42:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 12:42:33 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554813753.42.0.110276668781.issue36560@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12668 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:49:04 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 09 Apr 2019 12:49:04 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554814144.91.0.196388353487.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: Why is this using type "sig_atomic_t" for a file descriptor instead of "int" (which is the type of file descriptors)? See https://github.com/python/cpython/pull/12670 ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:49:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 12:49:52 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554814192.9.0.873565349822.issue30134@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 4e8e8aabc6e6ae1c989ef288be7bddfdbbc3187d by Inada Naoki in branch '2.7': bpo-30134: fix BytesWarning doc, docstring and message (GH-12739) https://github.com/python/cpython/commit/4e8e8aabc6e6ae1c989ef288be7bddfdbbc3187d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 08:50:05 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 12:50:05 +0000 Subject: [issue30134] BytesWarning is missing from the documents In-Reply-To: <1492832971.85.0.91707037101.issue30134@psf.upfronthosting.co.za> Message-ID: <1554814205.33.0.766151268687.issue30134@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:05:16 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 13:05:16 +0000 Subject: [issue34152] performance of some list slice assignment margin cases can be improved In-Reply-To: <1531938369.41.0.56676864532.issue34152@psf.upfronthosting.co.za> Message-ID: <1554815116.93.0.536932313492.issue34152@roundup.psfhosted.org> Cheryl Sabella added the comment: @rhettinger recommended against this suggestion last July. I'm bumping this for others to comment and to recommend closing the issue and PR if it's not going to move forward. Nosying Pablo since he commented on the PR. ---------- nosy: +cheryl.sabella, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:08:17 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 13:08:17 +0000 Subject: [issue34139] Remove stale unix datagram socket before binding In-Reply-To: <1531835543.49.0.56676864532.issue34139@psf.upfronthosting.co.za> Message-ID: <1554815297.93.0.565679994328.issue34139@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:11:21 2019 From: report at bugs.python.org (mattcher_h) Date: Tue, 09 Apr 2019 13:11:21 +0000 Subject: [issue36557] Python (Launcher)3.7.3 CMDLine install/uninstall In-Reply-To: <1554726023.31.0.350138244198.issue36557@roundup.psfhosted.org> Message-ID: <1554815481.85.0.343051163671.issue36557@roundup.psfhosted.org> mattcher_h added the comment: Ok I?m done. Thank you very much for your quick advice. The documentaion is kind of misleading. "The /uninstall option may be passed to immediately begin removing Python - no prompt will be displayed." Because of the last part I thought the /quiet is included and not necessary for the uninstall. After I found the registry entry from "Python Launcher" I get the uninstall cmd. Maybe you could still tell me something more about the /passiv? That is what works for me. Uninstall Python3.7.3: PathToPython.exe /uninstall /quiet Uninstall Pythonlauncher: MsiExec.exe /X{A28C27E4-A725-482A-9C65-61EDC0E4D583} /qn ciao ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:15:58 2019 From: report at bugs.python.org (Lorenz Mende) Date: Tue, 09 Apr 2019 13:15:58 +0000 Subject: [issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage In-Reply-To: <1513938975.69.0.213398074469.issue32409@psf.upfronthosting.co.za> Message-ID: <1554815758.61.0.0681113086334.issue32409@roundup.psfhosted.org> Change by Lorenz Mende : ---------- pull_requests: +12669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:16:15 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 13:16:15 +0000 Subject: [issue34144] venv activate.bat reset codepage fails on windows 10 In-Reply-To: <1531901922.72.0.56676864532.issue34144@psf.upfronthosting.co.za> Message-ID: <1554815775.91.0.911247549965.issue34144@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:19:15 2019 From: report at bugs.python.org (Krzysztof Mierzejewski) Date: Tue, 09 Apr 2019 13:19:15 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1554815955.61.0.634663659172.issue36470@roundup.psfhosted.org> Change by Krzysztof Mierzejewski : ---------- nosy: +mierzej _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:22:53 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 09 Apr 2019 13:22:53 +0000 Subject: [issue34152] performance of some list slice assignment margin cases can be improved In-Reply-To: <1531938369.41.0.56676864532.issue34152@psf.upfronthosting.co.za> Message-ID: <1554816173.9.0.947819194913.issue34152@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Raymond. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:23:46 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 09 Apr 2019 13:23:46 +0000 Subject: [issue35381] posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types In-Reply-To: <1543818839.39.0.788709270274.issue35381@psf.upfronthosting.co.za> Message-ID: <1554816226.74.0.76974008346.issue35381@roundup.psfhosted.org> Jeroen Demeyer added the comment: Just curious... how is PEP 384 relevant to modules insides CPython itself? I thought that this only mattered for external packages. Do you expect people to use a 3.7-compiled posixmodule.c on Python 3.8? ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:25:40 2019 From: report at bugs.python.org (=?utf-8?q?Joan_Tomas_=28Tommy=29_Pujol_Mu=C3=B1oz?=) Date: Tue, 09 Apr 2019 13:25:40 +0000 Subject: [issue36574] Error with self in python Message-ID: <1554816340.61.0.00352106981466.issue36574@roundup.psfhosted.org> New submission from Joan Tomas (Tommy) Pujol Mu?oz : I try to use self with the __init__ function in a class, but when I enter the other values e.g. def __init__(self, name): self.name = name /// and when I call the class with a name it says that it need another value because it uses self an another value. It happened when I was using Windows 10, but normally I use Linux. ---------- files: pySelf.cmd messages: 339746 nosy: tommypm priority: normal severity: normal status: open title: Error with self in python type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file48252/pySelf.cmd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:35:46 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 13:35:46 +0000 Subject: [issue36575] Use _PyTime_GetPerfCounter() in lsprof Message-ID: <1554816946.4.0.309099513597.issue36575@roundup.psfhosted.org> New submission from Inada Naoki : Current lsprof uses `gettimeofday` on non-Windows. _PyTime_GetPerfCounter() is better time for profiling. ---------- components: Library (Lib) messages: 339747 nosy: inada.naoki priority: normal severity: normal status: open title: Use _PyTime_GetPerfCounter() in lsprof versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:35:59 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 09 Apr 2019 13:35:59 +0000 Subject: [issue36575] Use _PyTime_GetPerfCounter() in lsprof In-Reply-To: <1554816946.4.0.309099513597.issue36575@roundup.psfhosted.org> Message-ID: <1554816959.61.0.121795794995.issue36575@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +12670 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:41:13 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 13:41:13 +0000 Subject: [issue34139] Remove stale unix datagram socket before binding In-Reply-To: <1531835543.49.0.56676864532.issue34139@psf.upfronthosting.co.za> Message-ID: <1554817273.52.0.907188163777.issue34139@roundup.psfhosted.org> miss-islington added the comment: New changeset 56065d4c8ac03042cb7e29ffda9b1ac544a37b4d by Miss Islington (bot) (Quentin Dawans) in branch 'master': bpo-34139: Remove unix datagram socket from FS before binding (GH-8323) https://github.com/python/cpython/commit/56065d4c8ac03042cb7e29ffda9b1ac544a37b4d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:42:07 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 09 Apr 2019 13:42:07 +0000 Subject: [issue34139] Remove stale unix datagram socket before binding In-Reply-To: <1531835543.49.0.56676864532.issue34139@psf.upfronthosting.co.za> Message-ID: <1554817327.98.0.175404054668.issue34139@roundup.psfhosted.org> Andrew Svetlov added the comment: Done ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:51:30 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 13:51:30 +0000 Subject: [issue34110] cPickle may raise AttributeError when loading concurrently in threads In-Reply-To: <1531507208.03.0.56676864532.issue34110@psf.upfronthosting.co.za> Message-ID: <1554817890.02.0.911932160143.issue34110@roundup.psfhosted.org> Cheryl Sabella added the comment: Adding @pitrou to the nosy list as he last modified the section of code changed in the PR. ---------- nosy: +cheryl.sabella, pitrou versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 09:53:06 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 13:53:06 +0000 Subject: [issue29707] os.path.ismount() always returns false for mount --bind on same filesystem In-Reply-To: <1488524974.65.0.103028894103.issue29707@psf.upfronthosting.co.za> Message-ID: <1554817986.92.0.849355294933.issue29707@roundup.psfhosted.org> Cheryl Sabella added the comment: Can this be closed as a documentation only change? Thanks! ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:02:55 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 14:02:55 +0000 Subject: [issue29707] os.path.ismount() always returns false for mount --bind on same filesystem In-Reply-To: <1488524974.65.0.103028894103.issue29707@psf.upfronthosting.co.za> Message-ID: <1554818575.52.0.0517436485608.issue29707@roundup.psfhosted.org> Christian Heimes added the comment: Yes, it can be closed as doc-only fix. ---------- nosy: +christian.heimes resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:08:02 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 14:08:02 +0000 Subject: [issue36575] Use _PyTime_GetPerfCounter() in lsprof In-Reply-To: <1554816946.4.0.309099513597.issue36575@roundup.psfhosted.org> Message-ID: <1554818882.08.0.222928257055.issue36575@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:27:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 14:27:02 +0000 Subject: [issue36276] [CVE-2019-9740] Python urllib CRLF injection vulnerability In-Reply-To: <1552440411.97.0.7095697352.issue36276@roundup.psfhosted.org> Message-ID: <1554820022.38.0.0949856672627.issue36276@roundup.psfhosted.org> STINNER Victor added the comment: The CVE-2019-9740 has been assigned to this issue: * https://nvd.nist.gov/vuln/detail/CVE-2019-9740 * https://bugzilla.redhat.com/show_bug.cgi?id=1692984 ... which has been marked as a duplicate of bpo-30458. ---------- title: Python urllib CRLF injection vulnerability -> [CVE-2019-9740] Python urllib CRLF injection vulnerability _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:28:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 14:28:59 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554820139.49.0.277386710832.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: The CVE-2019-9740 has been assigned to the bpo-36276: * https://nvd.nist.gov/vuln/detail/CVE-2019-9740 * https://bugzilla.redhat.com/show_bug.cgi?id=1692984 ... which has been marked as a duplicate of this issue. ---------- nosy: +vstinner title: CRLF Injection in httplib -> [CVE-2019-9740][security] CRLF Injection in httplib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:29:01 2019 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 09 Apr 2019 14:29:01 +0000 Subject: [issue22377] %Z in strptime doesn't match EST and others In-Reply-To: <1410301455.57.0.912701656833.issue22377@psf.upfronthosting.co.za> Message-ID: <1554820141.98.0.225742598944.issue22377@roundup.psfhosted.org> Paul Ganssle added the comment: @Alex LordThorsen: It will accept EST if EST is one of your "local" time zones, so whatever's in `time.tzname`. In the short term, I think the right thing to do would be to update the documentation to remove the reference to "EST", and add an explanatory note in the section about %Z that explains that it accepts a few hard-coded values + whatever's in `time.tzname`. In the long run, I think the best "out of the box" support we can provide would be supporting %Z when %z is present (per Alexander's suggestion), and possibly something akin to `dateutil`'s "tzinfos", where a mapping between abbreviations and `tzinfo` objects could be passed to `strptime` explicitly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:41:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 14:41:46 +0000 Subject: [issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5 Message-ID: <1554820906.29.0.786226900608.issue36576@roundup.psfhosted.org> New submission from STINNER Victor : On Fedora 29, test_ssl and test_asyncio when Python 3.5 is linked with OpenSSL 1.1.1b (Fedora package openssl-1.1.1b-3.fc29.x86_64): test_ssl: * test_options (test.test_ssl.ContextTests) * test_alpn_protocols (test.test_ssl.ThreadedTests) * test_default_ecdh_curve (test.test_ssl.ThreadedTests) * test_shared_ciphers (test.test_ssl.ThreadedTests) test_asyncio: * test_create_server_ssl_match_failed (test.test_asyncio.test_events.EPollEventLoopTests) * test_create_server_ssl_match_failed (test.test_asyncio.test_events.PollEventLoopTests) * test_create_server_ssl_match_failed (test.test_asyncio.test_events.SelectEventLoopTests) Fixing these tests would require to backport some ssl features, and I don't think that it's worth it. Attached PR 12694 skip these tests on OpenSSL 1.1.1. Note: these tests pass with OpenSSL 1.1.0. FYI for Fedora, we also care of having the Python 3.4 test suite passing with OpenSSL 1.1.1 and so we will maintain a similar change downstream. ====================================================================== FAIL: test_options (test.test_ssl.ContextTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_ssl.py", line 866, in test_options self.assertEqual(default, ctx.options) AssertionError: 2181169236 != 2182217812 ====================================================================== FAIL: test_alpn_protocols (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_ssl.py", line 3205, in test_alpn_protocols self.assertIsInstance(stats, ssl.SSLError) AssertionError: {'client_alpn_protocol': None, 'server_alpn_protocols': [None], 'version': 'TLSv1.2', 'client_npn_protocol': None, 'server_npn_protocols': [None], 'server_shared_ciphers': [[('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256), ('TLS_CHACHA20_POLY1305_SHA256', 'TLSv1.3', 256), ('TLS_AES_128_GCM_SHA256', 'TLSv1.3', 128), ('TLS_AES_128_CCM_SHA256', 'TLSv1.3', 128), ('ECDHE-ECDSA-AES256-GCM-SHA384', 'TLSv1.2', 256), ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256), ('ECDHE-ECDSA-AES128-GCM-SHA256', 'TLSv1.2', 128), ('ECDHE-RSA-AES128-GCM-SHA256', 'TLSv1.2', 128), ('ECDHE-ECDSA-CHACHA20-POLY1305', 'TLSv1.2', 256), ('ECDHE-RSA-CHACHA20-POLY1305', 'TLSv1.2', 256), ('DHE-DSS-AES256-GCM-SHA384', 'TLSv1.2', 256), ('DHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256), ('DHE-DSS-AES128-GCM-SHA256', 'TLSv1.2', 128), ('DHE-RSA-AES128-GCM-SHA256', 'TLSv1.2', 128), ('DHE-RSA-CHACHA20-POLY1305', 'TLSv1.2', 256), ('ECDHE-ECDSA-AES256-CCM8', 'TLSv1.2', 256), ('ECDHE-ECDSA-AES256-CCM', 'TLSv1.2', 256), ('ECDHE-ECDSA-AES256-SHA384', 'TLSv1.2', 256), ('ECDHE-RSA-AES256-SHA384', 'TLSv1.2', 256), ('ECDHE-ECDSA-AES256-SHA', 'TLSv1.0', 256), ('ECDHE-RSA-AES256-SHA', 'TLSv1.0', 256), ('DHE-RSA-AES256-CCM8', 'TLSv1.2', 256), ('DHE-RSA-AES256-CCM', 'TLSv1.2', 256), ('DHE-RSA-AES256-SHA256', 'TLSv1.2', 256), ('DHE-DSS-AES256-SHA256', 'TLSv1.2', 256), ('DHE-RSA-AES256-SHA', 'SSLv3', 256), ('DHE-DSS-AES256-SHA', 'SSLv3', 256), ('ECDHE-ECDSA-AES128-CCM8', 'TLSv1.2', 128), ('ECDHE-ECDSA-AES128-CCM', 'TLSv1.2', 128), ('ECDHE-ECDSA-AES128-SHA256', 'TLSv1.2', 128), ('ECDHE-RSA-AES128-SHA256', 'TLSv1.2', 128), ('ECDHE-ECDSA-AES128-SHA', 'TLSv1.0', 128), ('ECDHE-RSA-AES128-SHA', 'TLSv1.0', 128), ('DHE-RSA-AES128-CCM8', 'TLSv1.2', 128), ('DHE-RSA-AES128-CCM', 'TLSv1.2', 128), ('DHE-RSA-AES128-SHA256', 'TLSv1.2', 128), ('DHE-DSS-AES128-SHA256', 'TLSv1.2', 128), ('DHE-RSA-AES128-SHA', 'SSLv3', 128), ('DHE-DSS-AES128-SHA', 'SSLv3', 128), ('ECDHE-ECDSA-ARIA256-GCM-SHA384', 'TLSv1.2', 256), ('ECDHE-ARIA256-GCM-SHA384', 'TLSv1.2', 256), ('ECDHE-ECDSA-ARIA128-GCM-SHA256', 'TLSv1.2', 128), ('ECDHE-ARIA128-GCM-SHA256', 'TLSv1.2', 128), ('ECDHE-ECDSA-CAMELLIA256-SHA384', 'TLSv1.2', 256), ('ECDHE-RSA-CAMELLIA256-SHA384', 'TLSv1.2', 256), ('ECDHE-ECDSA-CAMELLIA128-SHA256', 'TLSv1.2', 128), ('ECDHE-RSA-CAMELLIA128-SHA256', 'TLSv1.2', 128), ('DHE-DSS-ARIA256-GCM-SHA384', 'TLSv1.2', 256), ('DHE-RSA-ARIA256-GCM-SHA384', 'TLSv1.2', 256), ('DHE-DSS-ARIA128-GCM-SHA256', 'TLSv1.2', 128), ('DHE-RSA-ARIA128-GCM-SHA256', 'TLSv1.2', 128), ('DHE-RSA-CAMELLIA256-SHA256', 'TLSv1.2', 256), ('DHE-DSS-CAMELLIA256-SHA256', 'TLSv1.2', 256), ('DHE-RSA-CAMELLIA128-SHA256', 'TLSv1.2', 128), ('DHE-DSS-CAMELLIA128-SHA256', 'TLSv1.2', 128), ('DHE-RSA-CAMELLIA256-SHA', 'SSLv3', 256), ('DHE-DSS-CAMELLIA256-SHA', 'SSLv3', 256), ('DHE-RSA-CAMELLIA128-SHA', 'SSLv3', 128), ('DHE-DSS-CAMELLIA128-SHA', 'SSLv3', 128), ('AES256-GCM-SHA384', 'TLSv1.2', 256), ('AES128-GCM-SHA256', 'TLSv1.2', 128), ('AES256-CCM8', 'TLSv1.2', 256), ('AES256-CCM', 'TLSv1.2', 256), ('AES128-CCM8', 'TLSv1.2', 128), ('AES128-CCM', 'TLSv1.2', 128), ('AES256-SHA256', 'TLSv1.2', 256), ('AES128-SHA256', 'TLSv1.2', 128), ('AES256-SHA', 'SSLv3', 256), ('AES128-SHA', 'SSLv3', 128), ('ARIA256-GCM-SHA384', 'TLSv1.2', 256), ('ARIA128-GCM-SHA256', 'TLSv1.2', 128), ('CAMELLIA256-SHA256', 'TLSv1.2', 256), ('CAMELLIA128-SHA256', 'TLSv1.2', 128), ('CAMELLIA256-SHA', 'SSLv3', 256), ('CAMELLIA128-SHA', 'SSLv3', 128)]], 'peercert': {}, 'cipher': ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256), 'compression': None} is not an instance of ====================================================================== FAIL: test_default_ecdh_curve (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_ssl.py", line 3064, in test_default_ecdh_curve self.assertIn("ECDH", s.cipher()[0]) AssertionError: 'ECDH' not found in 'TLS_AES_256_GCM_SHA384' ====================================================================== FAIL: test_shared_ciphers (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_ssl.py", line 3381, in test_shared_ciphers self.fail(name) AssertionError: TLS_AES_256_GCM_SHA384 ====================================================================== ERROR: test_create_server_ssl_match_failed (test.test_asyncio.test_events.EPollEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_asyncio/test_events.py", line 1172, in test_create_server_ssl_match_failed proto.transport.close() AttributeError: 'NoneType' object has no attribute 'close' ====================================================================== ERROR: test_create_server_ssl_match_failed (test.test_asyncio.test_events.PollEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_asyncio/test_events.py", line 1172, in test_create_server_ssl_match_failed proto.transport.close() AttributeError: 'NoneType' object has no attribute 'close' ====================================================================== ERROR: test_create_server_ssl_match_failed (test.test_asyncio.test_events.SelectEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.5/Lib/test/test_asyncio/test_events.py", line 1172, in test_create_server_ssl_match_failed proto.transport.close() AttributeError: 'NoneType' object has no attribute 'close' ---------- components: Tests messages: 339756 nosy: vstinner priority: normal severity: normal status: open title: Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5 versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:43:09 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 09 Apr 2019 14:43:09 +0000 Subject: [issue36574] Error with self in python In-Reply-To: <1554816340.61.0.00352106981466.issue36574@roundup.psfhosted.org> Message-ID: <1554820989.94.0.274301895334.issue36574@roundup.psfhosted.org> Steven D'Aprano added the comment: The file you have attached doesn't seem to be a Python script, it seems to be some sort of Windows batch file or similar. Please supply an actual Python file. (Hint: remove the "del code.py" line from your batch file.) Also, copy and paste the traceback you receive, as text (not a screenshot). It may help if you read this for ways to submit good bug reports: http://www.sscce.org/ Thank you. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:46:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 14:46:56 +0000 Subject: [issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5 In-Reply-To: <1554820906.29.0.786226900608.issue36576@roundup.psfhosted.org> Message-ID: <1554821216.75.0.174622303491.issue36576@roundup.psfhosted.org> STINNER Victor added the comment: I wasn't sure if tests pass or not on OpenSSL 1.1.0. My colleague Miro checked: the full Python 3.5 test suite pass on Fedora 28 with OpenSSL 1.1.0. python35 is linked to OpenSSL 1.1.0 on Fedora 28: https://src.fedoraproject.org/rpms/python35/blob/f28/f/python35.spec#_121 Example of successful python35 build: https://koji.fedoraproject.org/koji/buildinfo?buildID=1236291 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 10:47:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 14:47:33 +0000 Subject: [issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5 In-Reply-To: <1554820906.29.0.786226900608.issue36576@roundup.psfhosted.org> Message-ID: <1554821253.47.0.0145267691865.issue36576@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12671 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:05:26 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 09 Apr 2019 15:05:26 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554822326.81.0.676453176473.issue36559@roundup.psfhosted.org> Xavier de Gaye added the comment: > You could also use the internal _sha512 module. It's always present This is not true at the moment, the _sha512 module is not present when openssl is missing. This is a bug in setup.py that prevents building the _sha512 module when openssl is missing. See issue 36544. It is possible that this issue (since it started because of hashlib failures) and also issue 36414 are caused by this problem. ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:08:48 2019 From: report at bugs.python.org (Jesse Farnham) Date: Tue, 09 Apr 2019 15:08:48 +0000 Subject: [issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition) In-Reply-To: <1488481944.03.0.0307704051627.issue29699@psf.upfronthosting.co.za> Message-ID: <1554822528.23.0.706461229107.issue29699@roundup.psfhosted.org> Change by Jesse Farnham : ---------- nosy: +jesse.farnham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:19:01 2019 From: report at bugs.python.org (cagney) Date: Tue, 09 Apr 2019 15:19:01 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554823141.8.0.403218813018.issue36533@roundup.psfhosted.org> cagney added the comment: I pointed out two issues with breaking the locks. Your response addressed the less important issue: - the guarantee that log records don't interleave is lost Since the documentation seems to be silent the guarantee (or expectation) is implied - logging systems emit records atomically - if this isn't true across fork() then the exception should be documented. but it didn't address the more fundamental problem: - when the child enters the code 'b' is undefined i.e., breaking the lock will allow the child to access data in an undefined state. This will result in either core dumps or hangs (presumably the motivation for the original change was to prevent this?). For instance, if the fork() happens while a thread is holding the FILE lock on a log file, then the child trying to access that FILE will hang. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:20:18 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 15:20:18 +0000 Subject: [issue36146] Refactor setup.py In-Reply-To: <1551368254.14.0.622163548129.issue36146@roundup.psfhosted.org> Message-ID: <1554823218.81.0.70078817321.issue36146@roundup.psfhosted.org> miss-islington added the comment: New changeset 2ee077f7955e0349074f16a7afee40b4914619f7 by Miss Islington (bot) (xdegaye) in branch 'master': bpo-36544 : Fix regression introduced in bpo-36146 (GH-12708) https://github.com/python/cpython/commit/2ee077f7955e0349074f16a7afee40b4914619f7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:20:18 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 15:20:18 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554823218.85.0.219421958686.issue36544@roundup.psfhosted.org> miss-islington added the comment: New changeset 2ee077f7955e0349074f16a7afee40b4914619f7 by Miss Islington (bot) (xdegaye) in branch 'master': bpo-36544 : Fix regression introduced in bpo-36146 (GH-12708) https://github.com/python/cpython/commit/2ee077f7955e0349074f16a7afee40b4914619f7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:21:11 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 15:21:11 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554823271.13.0.928632541709.issue36559@roundup.psfhosted.org> Christian Heimes added the comment: Thanks for pointing to the other issue. This is clearly a regression and should be fixed ASAP. I have ACKed your PR and pushed it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:26:31 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 09 Apr 2019 15:26:31 +0000 Subject: [issue14817] pkgutil.extend_path has no tests In-Reply-To: <1337109540.72.0.0262382182113.issue14817@psf.upfronthosting.co.za> Message-ID: <1554823591.51.0.812556553875.issue14817@roundup.psfhosted.org> Joannah Nanjekye added the comment: @Windson please open a PR for review with your code. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:30:25 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 15:30:25 +0000 Subject: [issue36577] setup doesn't report missing _ssl and _hashlib Message-ID: <1554823825.45.0.360858351265.issue36577@roundup.psfhosted.org> New submission from Christian Heimes : setup does not report _ssl and _hashlib as failed to build in case OpenSSL libs or headers are missing. Related to #36544 and #36146 Reproducer: $ ./configure --with-openssl=/invalid $ make ... running build running build_ext The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time running build_scripts ... With fix: $ ./configure --with-openssl=/invalid $ make ... running build running build_ext Python build finished successfully! The necessary bits to build these optional modules were not found: _hashlib _ssl 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: _abc atexit pwd time Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381 running build_scripts ... ---------- components: Build messages: 339765 nosy: christian.heimes priority: normal severity: normal status: open title: setup doesn't report missing _ssl and _hashlib versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:35:05 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 15:35:05 +0000 Subject: [issue36577] setup doesn't report missing _ssl and _hashlib In-Reply-To: <1554823825.45.0.360858351265.issue36577@roundup.psfhosted.org> Message-ID: <1554824105.65.0.892590643776.issue36577@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +12672 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:35:05 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 15:35:05 +0000 Subject: [issue36146] Refactor setup.py In-Reply-To: <1551368254.14.0.622163548129.issue36146@roundup.psfhosted.org> Message-ID: <1554824105.71.0.277357811576.issue36146@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +12673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:42:49 2019 From: report at bugs.python.org (Ryan Ware) Date: Tue, 09 Apr 2019 15:42:49 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554824569.24.0.936011985417.issue30458@roundup.psfhosted.org> Change by Ryan Ware : ---------- nosy: +ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:44:44 2019 From: report at bugs.python.org (Ryan Ware) Date: Tue, 09 Apr 2019 15:44:44 +0000 Subject: [issue35906] Header Injection in urllib In-Reply-To: <1549413131.7.0.216595978501.issue35906@roundup.psfhosted.org> Message-ID: <1554824684.38.0.135552383249.issue35906@roundup.psfhosted.org> Change by Ryan Ware : ---------- nosy: +ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:46:06 2019 From: report at bugs.python.org (Ryan Ware) Date: Tue, 09 Apr 2019 15:46:06 +0000 Subject: [issue35907] Unnecessary URL scheme exists to allow file:// reading file in urllib In-Reply-To: <1549441191.29.0.148559977828.issue35907@roundup.psfhosted.org> Message-ID: <1554824766.51.0.591246587757.issue35907@roundup.psfhosted.org> Change by Ryan Ware : ---------- nosy: +ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:46:15 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 09 Apr 2019 15:46:15 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554824775.79.0.197304546836.issue36544@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:52:08 2019 From: report at bugs.python.org (Adam Olsen) Date: Tue, 09 Apr 2019 15:52:08 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554825128.03.0.851690961646.issue1583@roundup.psfhosted.org> Adam Olsen added the comment: The fd field may be written from the main thread simultaneous with the signal handler activating and reading it out. Back in 2007 the only POSIX-compliant type allowed for that was sig_atomic_t, anything else was undefined. Looks like pycore_atomic.h should have alternatives now but I'm not at all familiar with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:54:39 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 15:54:39 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange Message-ID: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> New submission from ?? : == output == python2 /tmp/demo.py 31749 task#1 result:(False, 'ls: cannot access alksdfjalkdsfadsfk: No such file or directoryn') 31751 task#2 result:(False, 'ls: cannot access alksdfjalkdsfadsfk: No such file or directoryn') 31752 task#3 result:(False, '3n') 31750 task#4 result:(False, '4n') 31749 task#6 result:(False, '6n') 31752 task#7 result:(False, '7n') 31750 task#8 result:(False, '8n') 31751 task#9 result:(False, '9n') Traceback (most recent call last): File "/tmp/demo.py", line 74, in runner() File "/tmp/demo.py", line 64, in runner rc_orig = value.get() File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get raise self._value ValueError: empty range for randrange() (1,1, 0) == The python2.7 demo == http://paste.ubuntu.org.cn/4379593 == More == The interesting thing is if you modify demo.py like this . http://paste.ubuntu.org.cn/4379595 Almost the code can be run normal. ---------- components: Library (Lib) files: demo.py messages: 339767 nosy: ?? priority: normal severity: normal status: open title: multiprocessing pool + subprocess ValueError: empty range for randrange versions: Python 3.6 Added file: https://bugs.python.org/file48253/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:56:17 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 15:56:17 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554825377.0.0.872137193052.issue36578@roundup.psfhosted.org> Change by ?? : Removed file: https://bugs.python.org/file48253/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:56:26 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 15:56:26 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554825386.75.0.0853114724355.issue36578@roundup.psfhosted.org> Change by ?? : Added file: https://bugs.python.org/file48254/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:59:27 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 15:59:27 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554825567.16.0.809676628554.issue36578@roundup.psfhosted.org> Change by ?? : Added file: https://bugs.python.org/file48255/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 11:59:38 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 15:59:38 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554825578.91.0.942030527744.issue36578@roundup.psfhosted.org> Change by ?? : Removed file: https://bugs.python.org/file48254/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:01:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:01:19 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554825679.53.0.0158861894026.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9c14061a2c2df9a9b84d0aab190a50c24a0d52f4 by Victor Stinner in branch '2.7': bpo-36560: Fix reference leak hunting in regrtest (GH-12744) (GH-12745) https://github.com/python/cpython/commit/9c14061a2c2df9a9b84d0aab190a50c24a0d52f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:01:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:01:27 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554825687.52.0.236333993388.issue36560@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12674 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:03:46 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 16:03:46 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554825826.96.0.983038396884.issue36578@roundup.psfhosted.org> Change by ?? : Removed file: https://bugs.python.org/file48255/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:03:55 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 16:03:55 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554825835.78.0.387144771542.issue36578@roundup.psfhosted.org> Change by ?? : Added file: https://bugs.python.org/file48256/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:07:12 2019 From: report at bugs.python.org (=?utf-8?b?5a2R5b2x?=) Date: Tue, 09 Apr 2019 16:07:12 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554826032.71.0.791973117349.issue36578@roundup.psfhosted.org> ?? added the comment: My python version info: Python 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516] on linux2 Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516] on linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:11:03 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 09 Apr 2019 16:11:03 +0000 Subject: [issue36578] multiprocessing pool + subprocess ValueError: empty range for randrange In-Reply-To: <1554825279.75.0.461430616172.issue36578@roundup.psfhosted.org> Message-ID: <1554826263.43.0.647124022606.issue36578@roundup.psfhosted.org> SilentGhost added the comment: The error you're seeing stems from this bit of code: random.randint(1, 0) With zero resulting from `taskid % 5` operation for values of taskid divisible by 5. Obviously, when you comment out this line you're not seeing the error. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:12:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:12:48 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554826368.31.0.406042021094.issue36508@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e65f01f78d7bda3013fc5be485afa87ff56511d9 by Victor Stinner in branch 'master': bpo-36508: python-config don't export LINKFORSHARED (GH-12661) https://github.com/python/cpython/commit/e65f01f78d7bda3013fc5be485afa87ff56511d9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:12:57 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 16:12:57 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1554826377.72.0.755939915281.issue36508@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:26:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:26:21 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554827181.65.0.941966336699.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bb4447897a5f141eecf42987a1191a3330c5d7ed by Victor Stinner in branch 'master': bpo-36560: regrtest: don't collect the GC twice (GH-12747) https://github.com/python/cpython/commit/bb4447897a5f141eecf42987a1191a3330c5d7ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:31:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:31:39 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554827499.92.0.537127521303.issue36560@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:35:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:35:50 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554827750.72.0.616961542088.issue36544@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12677 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:37:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:37:24 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554827844.34.0.261125580111.issue36544@roundup.psfhosted.org> STINNER Victor added the comment: Xavier de Gaye: Oops! I also saw such errors but I didn't understand them. Thanks for the fix! I wrote PR 12750 to fix another minor issue which isn't directly related to your fix (nor to my previous refactoring). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:40:14 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 16:40:14 +0000 Subject: [issue36577] setup doesn't report missing _ssl and _hashlib In-Reply-To: <1554823825.45.0.360858351265.issue36577@roundup.psfhosted.org> Message-ID: <1554828014.99.0.335648184702.issue36577@roundup.psfhosted.org> miss-islington added the comment: New changeset 8abc3f4f91e6b523c761c7a6fa2e3405019803a1 by Miss Islington (bot) (Christian Heimes) in branch 'master': bpo-36577: setup.py reports missing OpenSSL again (GH-12746) https://github.com/python/cpython/commit/8abc3f4f91e6b523c761c7a6fa2e3405019803a1 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:40:14 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 09 Apr 2019 16:40:14 +0000 Subject: [issue36146] Refactor setup.py In-Reply-To: <1551368254.14.0.622163548129.issue36146@roundup.psfhosted.org> Message-ID: <1554828014.94.0.398241906996.issue36146@roundup.psfhosted.org> miss-islington added the comment: New changeset 8abc3f4f91e6b523c761c7a6fa2e3405019803a1 by Miss Islington (bot) (Christian Heimes) in branch 'master': bpo-36577: setup.py reports missing OpenSSL again (GH-12746) https://github.com/python/cpython/commit/8abc3f4f91e6b523c761c7a6fa2e3405019803a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:41:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:41:29 +0000 Subject: [issue36146] Refactor setup.py In-Reply-To: <1551368254.14.0.622163548129.issue36146@roundup.psfhosted.org> Message-ID: <1554828089.44.0.110097079806.issue36146@roundup.psfhosted.org> STINNER Victor added the comment: For the record, I introduced a regression which has been fixed in bpo-36544. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:43:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:43:06 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554828186.9.0.689965828766.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: > _abc was written for optimization. Your PR makes it using slower Python code. Could you please test how much this hits the performance of abc? I mostly wrote PR 12743 to debug this issue. Please see the discussion directly on the PR ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:47:44 2019 From: report at bugs.python.org (Christian Heimes) Date: Tue, 09 Apr 2019 16:47:44 +0000 Subject: [issue36577] setup doesn't report missing _ssl and _hashlib In-Reply-To: <1554823825.45.0.360858351265.issue36577@roundup.psfhosted.org> Message-ID: <1554828464.18.0.524251226933.issue36577@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:51:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:51:40 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x Message-ID: <1554828700.04.0.163813636834.issue36579@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/10/builds/2389 0:45:36 [412/420/1] test_venv crashed (Exit code 1) Timeout (0:15:00)! Thread 0x00000001 (most recent call first): File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 987 in communicate File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 476 in run File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 396 in check_output File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py", line 271 in _setup_pip File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py", line 68 in create File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py", line 373 in create File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 68 in run_with_capture File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 400 in do_test_with_pip File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 460 in test_with_pip ... Re-running test 'test_venv' in verbose mode test_defaults (test.test_venv.BasicTest) ... ok ... test_devnull (test.test_venv.EnsurePipTest) ... ok test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok Timeout (0:15:00)! Thread 0x00000001 (most recent call first): File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/selectors.py", line 415 in select File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 1807 in _communicate File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 1000 in communicate File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 39 in check_output File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 428 in do_test_with_pip File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 460 in test_with_pip File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py", line 680 in run File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py", line 740 in __call__ ... test_with_pip (test.test_venv.EnsurePipTest) ... Makefile:1139: recipe for target 'buildbottest' failed make: *** [buildbottest] Error 1 program finished with exit code 2 ---------- components: Tests messages: 339778 nosy: David.Edelsohn, Michael.Felt, vstinner priority: normal severity: normal status: open title: test_venv: test_with_pip() hangs on PPC64 AIX 3.x versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:54:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:54:21 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554828861.36.0.690472823322.issue35934@roundup.psfhosted.org> STINNER Victor added the comment: The change broke multiple buildbots, please fix buildbots or the change will be reverted: https://github.com/python/cpython/pull/11784#issuecomment-481036369 Revert on fail: https://pythondev.readthedocs.io/ci.html#revert-on-fail ---------- nosy: +pablogsal, vstinner resolution: duplicate -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:55:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:55:06 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554828906.19.0.78390403742.issue35934@roundup.psfhosted.org> STINNER Victor added the comment: AMD64 Ubuntu Shared 3.x: https://buildbot.python.org/all/#/builders/141/builds/1498 FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait) ---------------------------------------------------------------------- Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/_test_multiprocessing.py", line 4377, in test_wait_socket self.assertEqual(b''.join(v), expected) AssertionError: b'1\n2\n3\n4\n5\n6\n7\n8\n9\n' != b'0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:56:07 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:56:07 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554828967.99.0.48170229549.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 86f0354fcb815312295b923c55e39364d85d0388 by Victor Stinner in branch '3.7': [3.7] bpo-36560: regrtest: don't collect the GC twice (GH-12747) (GH-12749) https://github.com/python/cpython/commit/86f0354fcb815312295b923c55e39364d85d0388 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:57:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:57:03 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554829023.19.0.561513952625.issue35934@roundup.psfhosted.org> STINNER Victor added the comment: AMD64 FreeBSD CURRENT Shared 3.x: https://buildbot.python.org/all/#/builders/168/builds/885 test_wait (test.test_multiprocessing_spawn.TestWait) ... ok test_wait_integer (test.test_multiprocessing_spawn.TestWait) ... ok test_wait_slow (test.test_multiprocessing_spawn.TestWait) ... ok Process Process-62: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py", line 302, in _bootstrap self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 4337, in _child_test_wait_socket s.connect(address) ConnectionResetError: [Errno 54] Connection reset by peer /usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py:318: ResourceWarning: unclosed traceback.print_exc() ResourceWarning: Enable tracemalloc to get the object allocation traceback Process Process-60: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py", line 302, in _bootstrap self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 4337, in _child_test_wait_socket s.connect(address) ConnectionResetError: [Errno 54] Connection reset by peer /usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py:318: ResourceWarning: unclosed traceback.print_exc() ResourceWarning: Enable tracemalloc to get the object allocation traceback Process Process-59: Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py", line 302, in _bootstrap self.run() File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 4337, in _child_test_wait_socket s.connect(address) ConnectionResetError: [Errno 54] Connection reset by peer /usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/process.py:318: ResourceWarning: unclosed traceback.print_exc() ResourceWarning: Enable tracemalloc to get the object allocation traceback Timeout (0:25:00)! Thread 0x0000000800acc000 (most recent call first): File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/socket.py", line 212 in accept File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 4361 in test_wait_socket File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py", line 680 in run File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py", line 740 in __call__ File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py", line 122 in run File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/suite.py", line 84 in __call__ File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/runner.py", line 176 in run File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py", line 1968 in _run_suite File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py", line 2064 in run_unittest File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest.py", line 178 in test_runner File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest.py", line 182 in runtest_inner File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest.py", line 137 in runtest File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py", line 305 in rerun_failed_tests File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py", line 623 in _main File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py", line 586 in main File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/main.py", line 640 in main File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/__main__.py", line 2 in File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/runpy.py", line 85 in _run_code File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/runpy.py", line 192 in _run_module_as_main test_wait_socket (test.test_multiprocessing_spawn.TestWait) ... *** Error code 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 12:58:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 16:58:40 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554829120.06.0.222308431891.issue35934@roundup.psfhosted.org> STINNER Victor added the comment: s390x SLES 3.x: https://buildbot.python.org/all/#/builders/16/builds/2625 FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait) FAIL: test_wait_socket (test.test_multiprocessing_spawn.TestWait) Re-running failed tests in verbose mode Re-running test 'test_multiprocessing_fork' in verbose mode FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait) Re-running test 'test_multiprocessing_spawn' in verbose mode ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:01:11 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 17:01:11 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554829271.59.0.430566757044.issue35934@roundup.psfhosted.org> Giampaolo Rodola' added the comment: Those are old failures (+/- 17 hours ago). I committed: https://github.com/python/cpython/pull/12735 ...which fixed them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:02:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:02:29 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554829349.17.0.175391233184.issue36235@roundup.psfhosted.org> STINNER Victor added the comment: Oh, the test failed on Python 2.7 on macOS: x86-64 High Sierra 2.7 https://buildbot.python.org/all/#/builders/140/builds/211 ====================================================================== FAIL: test_customize_compiler (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/distutils/tests/test_sysconfig.py", line 134, in test_customize_compiler 'sc_cc -E') AssertionError: '/usr/bin/clang -E' != 'sc_cc -E' ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:08:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:08:17 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554829697.1.0.191607128764.issue36235@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12678 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:12:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:12:30 +0000 Subject: [issue34373] test_time errors on AIX In-Reply-To: <1533917751.88.0.56676864532.issue34373@psf.upfronthosting.co.za> Message-ID: <1554829950.34.0.608072021074.issue34373@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8709490f48fc27b3dd1a16acb33bea2299c6a575 by Victor Stinner in branch 'master': bpo-34373: Fix time.mktime() on AIX (GH-12726) https://github.com/python/cpython/commit/8709490f48fc27b3dd1a16acb33bea2299c6a575 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:19:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:19:36 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554830376.63.0.916382987176.issue35934@roundup.psfhosted.org> STINNER Victor added the comment: > Those are old failures (+/- 17 hours ago). I committed: > https://github.com/python/cpython/pull/12735 Oh, you wrote "BPO-" rather than "bpo-" and so your commit wasn't mentioned here: commit 8702b67dad62a9084f6c1823dce10653743667c8 Author: Giampaolo Rodola Date: Tue Apr 9 04:42:06 2019 +0200 BPO-17561: set create_server backlog default to None (GH-12735) It turns out doing socket.listen(0) does not equal to "choose a reasonable default". It actually means "set backlog to 0". As such set backlog=None as the default for socket.create_server. Fixes the following BB failures: https://github.com/python/cpython/pull/11784#issuecomment-481036369 Ref. BPO-1756, GH-11784. > ...which fixed them. Oh, great! Thanks for the fix. Sorry, I was 10 days late to handle emails from the buildbot-status mailing list. I only reported failures, I didn't check if it has been fixed in the meanwhile. I close again the issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:21:33 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Tue, 09 Apr 2019 17:21:33 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554830493.38.0.541485260046.issue35934@roundup.psfhosted.org> Giampaolo Rodola' added the comment: No problem. My bad that I mistyped the "BPO" thing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:22:59 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 09 Apr 2019 17:22:59 +0000 Subject: [issue36414] Multiple test failures in GCC and Clang optional builds on Travis CI In-Reply-To: <1553412920.81.0.155092332299.issue36414@roundup.psfhosted.org> Message-ID: <1554830579.25.0.422958528623.issue36414@roundup.psfhosted.org> Xavier de Gaye added the comment: FWIW PR 12708 has been merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:24:44 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 09 Apr 2019 17:24:44 +0000 Subject: [issue36544] cannot import hashlib when openssl is missing In-Reply-To: <1554567501.08.0.227124733254.issue36544@roundup.psfhosted.org> Message-ID: <1554830684.16.0.595464892355.issue36544@roundup.psfhosted.org> Xavier de Gaye added the comment: Thanks Victor for the refactoring of setup.py. That was badly needed indeed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:28:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:28:40 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554830920.28.0.297501073011.issue36559@roundup.psfhosted.org> STINNER Victor added the comment: Note: *Technically*, you can disable the compilation of the _sha512 module using "*disabled*" in Modules/Setup, but I'm not sure if it's a common use case. At least, it makes sense to me when we are sure that OpenSSL and _hashlib are available ;-) I didn't want to mention that since I'm not sure that it's really relevant in this discussion. (I was aware of the regression, and hopefully it's now fixed!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:29:41 2019 From: report at bugs.python.org (Vy Nguyen) Date: Tue, 09 Apr 2019 17:29:41 +0000 Subject: [issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted In-Reply-To: <1532105129.76.0.56676864532.issue34172@psf.upfronthosting.co.za> Message-ID: <1554830981.96.0.178709915991.issue34172@roundup.psfhosted.org> Change by Vy Nguyen : ---------- nosy: +Vy Nguyen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:32:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:32:30 +0000 Subject: [issue35934] Add socket.create_server() utility function In-Reply-To: <1549566902.79.0.677687282333.issue35934@roundup.psfhosted.org> Message-ID: <1554831150.93.0.652730553261.issue35934@roundup.psfhosted.org> STINNER Victor added the comment: I was sure that I already reported the issue... In fact, I commented bpo-17561 :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:43:34 2019 From: report at bugs.python.org (=?utf-8?q?Joan_Tomas_=28Tommy=29_Pujol_Mu=C3=B1oz?=) Date: Tue, 09 Apr 2019 17:43:34 +0000 Subject: [issue36574] Error with self in python In-Reply-To: <1554816340.61.0.00352106981466.issue36574@roundup.psfhosted.org> Message-ID: <1554831814.48.0.130931356818.issue36574@roundup.psfhosted.org> Joan Tomas (Tommy) Pujol Mu?oz added the comment: The python file. It works in Linux (Ubuntu) but not in Windows; at least for me. The output error is : Traceback (most recent call last): File "pySelf.py", line 8, in print(Person.__init__("Some","One",21,"American")) TypeError: __init__() missing 1 required positional argument: 'nationality' ---------- Added file: https://bugs.python.org/file48257/pySelf.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:53:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:53:09 +0000 Subject: [issue17561] Add socket.bind_socket() convenience function In-Reply-To: <1364402909.97.0.467946240817.issue17561@psf.upfronthosting.co.za> Message-ID: <1554832389.96.0.837641666206.issue17561@roundup.psfhosted.org> STINNER Victor added the comment: """ Fixed. There's a remaining failing BB: https://buildbot.python.org/all/#/builders/176/builds/185/steps/4/logs/stdio ...but the failure appears unrelated and it has been red for a while. """ That's known and unrelated issue: https://bugs.python.org/issue31453 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 13:54:28 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 09 Apr 2019 17:54:28 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554832468.75.0.433007727507.issue36235@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 22de4ce498b656063e236350e8404981c13e1cd8 by Victor Stinner in branch '2.7': bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12751) https://github.com/python/cpython/commit/22de4ce498b656063e236350e8404981c13e1cd8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:06:16 2019 From: report at bugs.python.org (Tim Hatch) Date: Tue, 09 Apr 2019 18:06:16 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1554833175.99.0.717952874202.issue36541@roundup.psfhosted.org> Tim Hatch added the comment: Here's approximately what it would look like to do the big change now: https://github.com/python/cpython/compare/master...thatch:lib2to3-update-grammar (one test failing, and some helpers may need more test coverage) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:06:37 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 09 Apr 2019 18:06:37 +0000 Subject: [issue36574] Error with self in python In-Reply-To: <1554816340.61.0.00352106981466.issue36574@roundup.psfhosted.org> Message-ID: <1554833197.19.0.726510185033.issue36574@roundup.psfhosted.org> Steven D'Aprano added the comment: The error message is correct. The bug is in your code. Also, the code you tell us that you are running is not the same as the code you are actually running. You should not call __init__ directly as you do: # this is wrong Person.__init__("Some","One",21,"American") Do this instead: Person("Some","One",21,"American") Closing this as it is not a bug in Python, it is a bug in your code. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:13:16 2019 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 09 Apr 2019 18:13:16 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1554833596.47.0.328977745817.issue34160@roundup.psfhosted.org> Stefan Behnel added the comment: This is done now. Thanks everyone who helped in discussing and implementing this change. I will leave Serhiy's last PR (adding the "sort_attrs" flag option) open for a while until I'm sure we have a better solution for comparing XML in 3.8, at which point I would reject it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:17:05 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 09 Apr 2019 18:17:05 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554833825.17.0.142864285276.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: > Back in 2007 the only POSIX-compliant type allowed for that was sig_atomic_t, anything else was undefined. Fair enough, but having a non-atomic type is still much better than a completely wrong type. In other words, the requirement of fitting a file descriptor is more important than being atomic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:19:51 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 09 Apr 2019 18:19:51 +0000 Subject: [issue31512] Add non-elevated symlink support for dev mode Windows 10 In-Reply-To: <1505762190.77.0.84923243723.issue31512@psf.upfronthosting.co.za> Message-ID: <1554833991.17.0.0174389354573.issue31512@roundup.psfhosted.org> Steve Dower added the comment: New changeset 0e10766574f4e287cd6b5e5860a1ca75488f4119 by Steve Dower (Vidar Tonaas Fauske) in branch 'master': bpo-31512: Add non-elevated symlink support for Windows (GH-3652) https://github.com/python/cpython/commit/0e10766574f4e287cd6b5e5860a1ca75488f4119 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:20:25 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 09 Apr 2019 18:20:25 +0000 Subject: [issue31512] Add non-elevated symlink support for dev mode Windows 10 In-Reply-To: <1505762190.77.0.84923243723.issue31512@psf.upfronthosting.co.za> Message-ID: <1554834025.44.0.509424478596.issue31512@roundup.psfhosted.org> Steve Dower added the comment: Done ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 14:55:56 2019 From: report at bugs.python.org (Adam Olsen) Date: Tue, 09 Apr 2019 18:55:56 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554836156.59.0.101306592011.issue1583@roundup.psfhosted.org> Adam Olsen added the comment: Disagree; if you're writing signal-handling code you should be very careful to do it properly, even if that's only proper for your current platform. If you can't do it properly you should find an alternative that doesn't involve signals. The fact that sig_atomic_t is only 1 byte on VxWorks strongly implies using int WILL fail in strange ways on that platform. I can see three options: 1) use pycore_atomic.h, implementing it for VxWorks if you haven't already. This also implies sig_atomic_t could have been int but wasn't for some reason, such as performance. 2) disable wakeup_fd entirely. It's obscure, GNOME being the biggest user I can think of. 3) unpack the int into an array of sig_atomic_t. Only the main thread writes to it so this method is ugly but viable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 15:00:05 2019 From: report at bugs.python.org (Steven Vascellaro) Date: Tue, 09 Apr 2019 19:00:05 +0000 Subject: [issue32884] Adding the ability for getpass to print asterisks when passowrd is typed In-Reply-To: <1519122533.37.0.467229070634.issue32884@psf.upfronthosting.co.za> Message-ID: <1554836405.0.0.288850383089.issue32884@roundup.psfhosted.org> Steven Vascellaro added the comment: @matanya.stroh: Don't forget to erase the asterisks if the user hits backspace. ``` def win_getpass(prompt='Password: ', stream=None, show_asterisks=False): """Prompt for password with echo off, using Windows getch().""" if sys.stdin is not sys.__stdin__: return fallback_getpass(prompt, stream) for c in prompt: msvcrt.putwch(c) pw = "" while 1: c = msvcrt.getwch() if c == '\r' or c == '\n': break if c == '\003': raise KeyboardInterrupt if c == '\b': if len(pw) > 0: pw = pw[:-1] msvcrt.putwch('\b') msvcrt.putwch(' ') msvcrt.putwch('\b') else: pw = pw + c if show_asterisks: msvcrt.putwch('*') msvcrt.putwch('\r') msvcrt.putwch('\n') return pw ``` Alternatively, could let the user define the masking character, similar to Tkinter's Entry widget. ``` def win_getpass(prompt='Password: ', stream=None, mask=''): """Prompt for password with echo off, using Windows getch().""" if sys.stdin is not sys.__stdin__: return fallback_getpass(prompt, stream) if len(mask) > 1: raise TypeError('mask argument must be a zero- or one-character str') for c in prompt: msvcrt.putwch(c) pw = "" while 1: c = msvcrt.getwch() if c == '\r' or c == '\n': break if c == '\003': raise KeyboardInterrupt if c == '\b': if len(pw) > 0: pw = pw[:-1] msvcrt.putwch('\b') msvcrt.putwch(' ') msvcrt.putwch('\b') else: pw = pw + c if mask: msvcrt.putwch(mask) msvcrt.putwch('\r') msvcrt.putwch('\n') return pw ``` I'm in favor of supporting masking. While it does reveal the password length, it's an accessibility feature many users have come to expect. I'd rather have this in the standard library than have developers implement their own custom, potentially insecure methods for password input. ---------- nosy: +stevoisiak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 16:34:54 2019 From: report at bugs.python.org (Kingsley McDonald) Date: Tue, 09 Apr 2019 20:34:54 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1554842094.84.0.919271091367.issue36549@roundup.psfhosted.org> Kingsley McDonald added the comment: Hello there, I'm an absolute beginner here and this whole thing is a little overwhelming, so please bear with me. I think this would be a suitable first task for me to take on because it appears to be a simple one-line change (correct me if I'm mistaken, though). ---------- nosy: +kingsley _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 16:40:09 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 09 Apr 2019 20:40:09 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554842409.55.0.72200733846.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: I'm not sure with what you disagree. At least, you have to admit that using sig_atomic_t is buggy for different reasons than signal safety, namely that there is no guarantee that one can safely convert back and forth to an "int". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 16:41:03 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 09 Apr 2019 20:41:03 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554842463.81.0.851708340639.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: > unpack the int into an array of sig_atomic_t. What do you mean with this? You can't write a complete array atomically, so I don't see how this would help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 17:03:56 2019 From: report at bugs.python.org (Adam Olsen) Date: Tue, 09 Apr 2019 21:03:56 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554843836.74.0.675381269398.issue1583@roundup.psfhosted.org> Adam Olsen added the comment: Converting to/from sig_atomic_t could have a compile time check on currently supported platforms and isn't buggy for them. For platforms with a different size you could do a runtime check, only allowing a fd in the range of 0-254 (with 255 reserved); that could sometimes fail, yes, but at least it's explicit, easily understood failure. Just using int would fail in undefined ways down the road, likely writing to a random fd instead (corrupting whatever it was doing), with no way to trace it back. Unpacking the int would mean having one sig_atomic_t for 'invalid', using that instead of INVALID_FD, plus an array of sig_atomic_t for the fd itself. Every time you want to change the fd you first set the 'invalid' flag, then the individual bytes, then clear 'invalid'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 17:08:33 2019 From: report at bugs.python.org (John Parejko) Date: Tue, 09 Apr 2019 21:08:33 +0000 Subject: [issue36580] unittest.mock does not understand dataclasses Message-ID: <1554844113.82.0.464270307904.issue36580@roundup.psfhosted.org> New submission from John Parejko : The new dataclasses.dataclass is very useful for describing the properties of a class, but it appears that Mocks of such decorated classes do not catch the members that are defined in the dataclass. I believe the root cause of this is the fact that unittest.mock.Mock generates the attributes of its spec object via `dir`, and the non-defaulted dataclass attributes do not appear in dir. Given the utility in building classes with dataclass, it would be very useful if Mocks could see the class attributes of the dataclass. Example code: import dataclasses import unittest.mock @dataclasses.dataclass class Foo: name: str baz: float bar: int = 12 FooMock = unittest.mock.Mock(Foo) fooMock = FooMock() # should fail: Foo.__init__ takes two arguments # I would expect these to be True, but they are False 'name' in dir(fooMock) 'baz' in dir(fooMock) 'bar' in dir(fooMock) ---------- components: Library (Lib), Tests messages: 339808 nosy: John Parejko2 priority: normal severity: normal status: open title: unittest.mock does not understand dataclasses type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 17:26:59 2019 From: report at bugs.python.org (cagney) Date: Tue, 09 Apr 2019 21:26:59 +0000 Subject: [issue20074] open() of read-write non-seekable streams broken In-Reply-To: <1388088109.09.0.0894725958863.issue20074@psf.upfronthosting.co.za> Message-ID: <1554845219.2.0.320580655277.issue20074@roundup.psfhosted.org> cagney added the comment: Another example is PTY: Python 2.7.15 (default, Oct 15 2018, 15:24:06) [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> pty, tty = os.openpty() >>> print(pty, tty) (3, 4) >>> import io >>> rw = io.open(pty, "r+") Traceback (most recent call last): File "", line 1, in IOError: File or stream is not seekable. >>> rw = open("/dev/tty", "r+") >>> rw.write("hi") >>> rw.flush() hi>>> Python 3.7.3+ (heads/3.7-dirty:0a16bb15af, Apr 9 2019, 13:45:22) [GCC 8.3.1 20190223 (Red Hat 8.3.1-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> pty, tty = os.openpty() >>> import io >>> rw = io.open(pty, "r+") Traceback (most recent call last): File "", line 1, in io.UnsupportedOperation: File or stream is not seekable. ---------- nosy: +cagney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 17:34:14 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 09 Apr 2019 21:34:14 +0000 Subject: [issue36569] @staticmethod seems to work with setUpClass, but docs say it shouldn't In-Reply-To: <1554788435.05.0.183130492369.issue36569@roundup.psfhosted.org> Message-ID: <1554845654.48.0.750256152101.issue36569@roundup.psfhosted.org> Brett Cannon added the comment: It's more of a "can't be an instance method" than a strict "only classmethod". Can I ask why you want it to be a strictmethod instead of a classmethod? I personally don't want to change the docs as I think that encourages a potentially bad situation where someone meant to have a classmethod and didn't realize the difference between that and staticmethod. But if there's a legitimate need for staticmethod then I'm open to reconsidering how the docs are written. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 17:56:44 2019 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 09 Apr 2019 21:56:44 +0000 Subject: [issue36580] unittest.mock does not understand dataclasses In-Reply-To: <1554844113.82.0.464270307904.issue36580@roundup.psfhosted.org> Message-ID: <1554847004.7.0.258028026707.issue36580@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not sure why dataclasses would be different here: >>> import dataclasses >>> import unittest.mock >>> @dataclasses.dataclass ... class Foo: ... name: str ... baz: float ... bar: int = 12 ... >>> import inspect >>> inspect.signature(Foo) None> >>> Foo is just a normal class with a normal __init__. This is no different than if you don't use dataclasses: >>> class Bar: ... def __init__(self, name: str, baz: float, bar: int = 12) -> None: ... pass ... >>> Bar() Traceback (most recent call last): File "", line 1, in TypeError: __init__() missing 2 required positional arguments: 'name' and 'baz' >>> inspect.signature(Bar) None> >>> BarMock = unittest.mock.Mock(Bar) >>> barMock = BarMock() ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 18:18:57 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 22:18:57 +0000 Subject: [issue36580] unittest.mock does not understand dataclasses In-Reply-To: <1554844113.82.0.464270307904.issue36580@roundup.psfhosted.org> Message-ID: <1554848337.07.0.337355315197.issue36580@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: mock.Mock doesn't do signature validation by default for constructor and methods. This is expected. create_autospec [0] should be used to make sure the signature is validated.' import dataclasses import unittest.mock @dataclasses.dataclass class Foo: name: str baz: float bar: int = 12 FooMock = unittest.mock.create_autospec(Foo) fooMock = FooMock() # Will fail now since it's specced ? cpython git:(master) ./python.exe ../backups/bpo36580.py Traceback (most recent call last): File "../backups/bpo36580.py", line 11, in fooMock = FooMock() # should fail: Foo.__init__ takes two arguments File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 984, in __call__ _mock_self._mock_check_sig(*args, **kwargs) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", line 103, in checksig sig.bind(*args, **kwargs) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/inspect.py", line 3021, in bind return args[0]._bind(args[1:], kwargs) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/inspect.py", line 2936, in _bind raise TypeError(msg) from None TypeError: missing a required argument: 'name' On the other hand 'name' in dir(FooMock) doesn't have the attributes (name and baz) present I suppose they are constructed dynamically when an object is created from Foo since they are present in dir(Foo()) and mock is not able to detect them? mock.create_autospec does an initial pass of dir(Foo) to copy the attributes [1] and perhaps it's not able to copy name and bar while baz is copied. Below are for FooMock = create_autospec(Foo) . So 'name' in dir(Foo) is False for dataclasses. Is this a known behavior? dir(Foo) ['__annotations__', '__class__', '__dataclass_fields__', '__dataclass_params__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'bar'] dir(Foo(1, 2)) ['__annotations__', '__class__', '__dataclass_fields__', '__dataclass_params__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'bar', 'baz', 'name'] dir(create_autospec(Foo)) ['__annotations__', '__class__', '__dataclass_fields__', '__dataclass_params__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'assert_any_call', 'assert_called', 'assert_called_once', 'assert_called_once_with', 'assert_called_with', 'assert_has_calls', 'assert_not_called', 'attach_mock', 'bar', 'call_args', 'call_args_list', 'call_count', 'called', 'configure_mock', 'method_calls', 'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 'side_effect'] print('name' in dir(fooMock)) # False print('baz' in dir(fooMock)) # False print('bar' in dir(fooMock)) # True [0] https://docs.python.org/3/library/unittest.mock.html#unittest.mock.create_autospec [1] https://github.com/python/cpython/blob/0e10766574f4e287cd6b5e5860a1ca75488f4119/Lib/unittest/mock.py#L2263 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 18:46:11 2019 From: report at bugs.python.org (Dylan Semler) Date: Tue, 09 Apr 2019 22:46:11 +0000 Subject: [issue36581] __dir__ on unittest.mock not safe for all spec types Message-ID: <1554849971.17.0.495097985154.issue36581@roundup.psfhosted.org> New submission from Dylan Semler : If a MagicMock is created with a spec or spec_set that is a non-list iterable of strings (like a tuple), calling dir() on said mock produces a Traceback. Here's a minimum example: ? cat poc.py from unittest.mock import MagicMock mock = MagicMock(spec=('a', 'tuple')) dir(mock) ? python3 poc.py Traceback (most recent call last): File "poc.py", line 4, in dir(mock) File "/usr/lib64/python3.6/unittest/mock.py", line 677, in __dir__ return sorted(set(extras + from_type + from_dict + TypeError: can only concatenate tuple (not "list") to tuple ---------- components: Library (Lib) messages: 339813 nosy: Dylan Semler priority: normal severity: normal status: open title: __dir__ on unittest.mock not safe for all spec types type: crash versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:00:30 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 23:00:30 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1554850830.22.0.630414238364.issue35181@roundup.psfhosted.org> Cheryl Sabella added the comment: @barry, you started a review of PR10016 and I believe all your requested changes have been made, so please review again when you get a chance. Please also take a look at PR10376. Thanks! ---------- nosy: +cheryl.sabella type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:05:02 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 23:05:02 +0000 Subject: [issue36581] __dir__ on unittest.mock not safe for all spec types In-Reply-To: <1554849971.17.0.495097985154.issue36581@roundup.psfhosted.org> Message-ID: <1554851102.99.0.860992580066.issue36581@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock > spec: This can be either a list of strings or an existing object (a class or instance) that acts as the specification for the mock object. If you pass in an object then a list of strings is formed by calling dir on the object (excluding unsupported magic attributes and methods). Accessing any attribute not in this list will raise an AttributeError. Docs state it should be list of strings. Can you please link to docs where an iterable of strings is mentioned? A simple patch would be to wrap it inside a list() call but I am not sure of making the interface more relaxed which was documented to accept list of strings. I am adding module mock devs to take a call on this. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 8684f1dfa5..35dc7b044e 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -679,7 +679,7 @@ class NonCallableMock(Base): if not FILTER_DIR: return object.__dir__(self) - extras = self._mock_methods or [] + extras = list(self._mock_methods or []) from_type = dir(type(self)) from_dict = list(self.__dict__) ---------- nosy: +cjw296, mariocj89, michael.foord, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:16:02 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 23:16:02 +0000 Subject: [issue36580] unittest.mock does not understand dataclasses In-Reply-To: <1554844113.82.0.464270307904.issue36580@roundup.psfhosted.org> Message-ID: <1554851762.46.0.910030606521.issue36580@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: To add to this mock.Mock also copies dir(spec) but creating an instance from mock doesn't copy it where it's not a problem with create_autospec. Mock with spec does only attribute validation whereas create_autospec does signature validation. There is another open issue to make mock use spec passed as if it's autospecced issue30587 where this could be used as a data point to change API. I am adding mock devs for confirmation. ---------- nosy: +cjw296, mariocj89, michael.foord versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:17:27 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 23:17:27 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1554851847.16.0.711016450098.issue36541@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:22:42 2019 From: report at bugs.python.org (Roundup Robot) Date: Tue, 09 Apr 2019 23:22:42 +0000 Subject: [issue36581] __dir__ on unittest.mock not safe for all spec types In-Reply-To: <1554849971.17.0.495097985154.issue36581@roundup.psfhosted.org> Message-ID: <1554852162.42.0.041287597384.issue36581@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12679 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:32:02 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 09 Apr 2019 23:32:02 +0000 Subject: [issue33387] Simplify bytecodes for try-finally, try-except and with blocks. In-Reply-To: <1525026522.22.0.682650639539.issue33387@psf.upfronthosting.co.za> Message-ID: <1554852722.64.0.44101066198.issue33387@roundup.psfhosted.org> Cheryl Sabella added the comment: What would be the best way to resolve the discussion between this and issue 32949? Would it be good to try to get one of them into 3.8? ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:38:53 2019 From: report at bugs.python.org (Trey Hunner) Date: Tue, 09 Apr 2019 23:38:53 +0000 Subject: [issue36582] collections.UserString encode method returns a string Message-ID: <1554853133.32.0.976890929788.issue36582@roundup.psfhosted.org> New submission from Trey Hunner : It looks like the encode method for UserString incorrectly wraps its return value in a str call. ``` >>> from collections import UserString >>> UserString("hello").encode('utf-8') == b'hello' False >>> UserString("hello").encode('utf-8') "b'hello'" >>> type(UserString("hello").encode('utf-8')) ``` ---------- components: Library (Lib) messages: 339818 nosy: trey priority: normal severity: normal status: open title: collections.UserString encode method returns a string versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:50:46 2019 From: report at bugs.python.org (Dylan Semler) Date: Tue, 09 Apr 2019 23:50:46 +0000 Subject: [issue36581] __dir__ on unittest.mock not safe for all spec types In-Reply-To: <1554849971.17.0.495097985154.issue36581@roundup.psfhosted.org> Message-ID: <1554853846.84.0.899765326349.issue36581@roundup.psfhosted.org> Dylan Semler added the comment: I agree docs only say "list of strings" and so this isn't a case where there's behavior that contrasts with the documentation. I merely ran into this issue in my project and found it difficult to get to the root of so wanted to fix it upstream. I made a patch and reported this bug only as a formality to accompany my patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 19:51:04 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 09 Apr 2019 23:51:04 +0000 Subject: [issue36582] collections.UserString encode method returns a string In-Reply-To: <1554853133.32.0.976890929788.issue36582@roundup.psfhosted.org> Message-ID: <1554853864.93.0.831720210146.issue36582@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 20:01:03 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 00:01:03 +0000 Subject: [issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods In-Reply-To: <1490001553.25.0.894325859627.issue29858@psf.upfronthosting.co.za> Message-ID: <1554854463.14.0.0862719851274.issue29858@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- versions: +Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 20:31:21 2019 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 10 Apr 2019 00:31:21 +0000 Subject: [issue12910] urllib.quote quotes too many chars, e.g., '()' In-Reply-To: <1315304798.98.0.174203108938.issue12910@psf.upfronthosting.co.za> Message-ID: <1554856281.57.0.399306542946.issue12910@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 750d74fac5c510e39958b3f79641fe54096ee54f by Senthil Kumaran (J?rn Hees) in branch 'master': bpo-12910: update and correct quote docstring (#2568) https://github.com/python/cpython/commit/750d74fac5c510e39958b3f79641fe54096ee54f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 20:31:48 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 00:31:48 +0000 Subject: [issue12910] urllib.quote quotes too many chars, e.g., '()' In-Reply-To: <1315304798.98.0.174203108938.issue12910@psf.upfronthosting.co.za> Message-ID: <1554856308.14.0.898727952173.issue12910@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch pull_requests: +12681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 20:39:59 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 00:39:59 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554856799.54.0.10465302874.issue14826@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +12682 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 20:39:59 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 00:39:59 +0000 Subject: [issue36276] [CVE-2019-9740] Python urllib CRLF injection vulnerability In-Reply-To: <1552440411.97.0.7095697352.issue36276@roundup.psfhosted.org> Message-ID: <1554856799.67.0.691680999682.issue36276@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +12683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 20:53:06 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 00:53:06 +0000 Subject: [issue12910] urllib.quote quotes too many chars, e.g., '()' In-Reply-To: <1315304798.98.0.174203108938.issue12910@psf.upfronthosting.co.za> Message-ID: <1554857586.39.0.100517721314.issue12910@roundup.psfhosted.org> miss-islington added the comment: New changeset 796698adf558f2255474945082856538b1effb0b by Miss Islington (bot) in branch '3.7': bpo-12910: update and correct quote docstring (GH-2568) https://github.com/python/cpython/commit/796698adf558f2255474945082856538b1effb0b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 21:04:35 2019 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 10 Apr 2019 01:04:35 +0000 Subject: [issue12910] urllib.quote quotes too many chars, e.g., '()' In-Reply-To: <1315304798.98.0.174203108938.issue12910@psf.upfronthosting.co.za> Message-ID: <1554858275.8.0.335875621401.issue12910@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 9 21:24:01 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 10 Apr 2019 01:24:01 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554859441.62.0.540580067318.issue36559@roundup.psfhosted.org> Raymond Hettinger added the comment: > You could also use the internal _sha512 module. > It's always present, small, lean and provides a SHA512 > implementation with sufficient performance. I suppose we could do this but it borders on telling folks that we're worried about using our own public APIs, that importing hashlib is bad for them. It shouldn't be that way, hashlib is a collection of hash functions -- it is clear why this import isn't small and fast. It suggests that something is wrong with the implementation. The focus on client code in random seems like the wrong focus. That is just typical of what other clients would do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 00:02:16 2019 From: report at bugs.python.org (josephshi@yahoo.com) Date: Wed, 10 Apr 2019 04:02:16 +0000 Subject: [issue35324] ssl: FileNotFoundError when do handshake In-Reply-To: <1543300721.51.0.788709270274.issue35324@psf.upfronthosting.co.za> Message-ID: <1554868936.2.0.351637831146.issue35324@roundup.psfhosted.org> josephshi at yahoo.com added the comment: I am not sure if it is because openssl refuse the ip and port. Like I said, I share both python 3.6 and python 3.7 on one host and they should share one openssl on that machine. The code is same. How can the openssl refuse one with 3.7 and not with 3.6? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 01:22:31 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 10 Apr 2019 05:22:31 +0000 Subject: [issue36582] collections.UserString encode method returns a string In-Reply-To: <1554853133.32.0.976890929788.issue36582@roundup.psfhosted.org> Message-ID: <1554873751.94.0.861347912587.issue36582@roundup.psfhosted.org> Raymond Hettinger added the comment: Trey, would you like to submit a PR to fix this? (Be sure to add a test case). ---------- assignee: -> rhettinger type: -> behavior versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 01:44:21 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 05:44:21 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554875061.09.0.932657780053.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: > """ Since the documentation seems to be silent the guarantee (or expectation) is implied - logging systems emit records atomically - if this isn't true across fork() then the exception should be documented. """ We can add a note to the docs. As a general rule: documentation being silent means there are zero guarantees. Behavior of the existing implementations over time is the only source of truth. > """ but it didn't address the more fundamental problem: - when the child enters the code 'b' is undefined i.e., breaking the lock will allow the child to access data in an undefined state. This will result in either core dumps or hangs (presumably the motivation for the original change was to prevent this?). """ nope. the contrived emit() pseudocode from msg339650 never defined b in the first place. that code, if massaged into python syntax would raise an UnboundLocalError no matter who executed it. a fork() from another thread would not change that. There is no concept of undefined/uninitialized state from the Python perspective. The motivation for the original fix was entirely deadlock avoidance in code that uses fork. It failed and introduced an alternate form of deadlock in code that had been lucky up until that point. Thus my new PR proposing to fix the regression by making that not fail yet still preventing locks from starting out held in the child process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 01:56:12 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 10 Apr 2019 05:56:12 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554875772.42.0.33719615902.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: > Unpacking the int would mean having one sig_atomic_t for 'invalid', using that instead of INVALID_FD, plus an array of sig_atomic_t for the fd itself. Every time you want to change the fd you first set the 'invalid' flag, then the individual bytes, then clear 'invalid'. I'm not sure that this is thread-safe as processors can reorder instructions, so there is no guarantee that memory is written in the expected order. That's one of the problems that C11/C++11 atomics solve. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:22:39 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 10 Apr 2019 07:22:39 +0000 Subject: [issue36583] Do not swallow exceptions in the _ssl module Message-ID: <1554880959.84.0.895759680892.issue36583@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently some exceptions can be swallowed in the _ssl module. The proposed PR fixes this. Some examples: * Use PyDict_GetItemWithError() instead of PyDict_GetItem(). The latter swallows any exceptions. Although it is very unlikely that an exception be raised here, it may be possible. * Do not overwrite arbitrary exceptions in PyUnicode_FSConverter(), PyUnicode_AsASCIIString() and PyObject_GetBuffer(). MemoryError most likely can be raised in the first two cases. Only expected exceptions (TypeError or UnicodeEncodeError) will now be replaced with a TypeError, and cadata type will be checked before trying to get a buffer or encode. ---------- components: Library (Lib) messages: 339827 nosy: alex, christian.heimes, dstufft, janssen, serhiy.storchaka priority: normal severity: normal status: open title: Do not swallow exceptions in the _ssl module versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:24:54 2019 From: report at bugs.python.org (beruhan) Date: Wed, 10 Apr 2019 07:24:54 +0000 Subject: [issue36584] cython nametuple TypeError Message-ID: <1554881094.13.0.241658399375.issue36584@roundup.psfhosted.org> New submission from beruhan : I have a class that inherits from NamedTuple,I have compile it to pyd file on windows use cython,when I import the class and create a object in another py file,It throws error 'TypeError: __new__() takes 1 positional argument but 4 were given' when I don't compile it to pyd,It can use normally,How to deal with it? ---------- components: Cross-Build messages: 339828 nosy: Alex.Willmer, beruhan, gvanrossum, levkivskyi priority: normal severity: normal status: open title: cython nametuple TypeError type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:26:59 2019 From: report at bugs.python.org (beruhan) Date: Wed, 10 Apr 2019 07:26:59 +0000 Subject: [issue36584] cython nametuple TypeError In-Reply-To: <1554881094.13.0.241658399375.issue36584@roundup.psfhosted.org> Message-ID: <1554881219.98.0.537225550326.issue36584@roundup.psfhosted.org> beruhan added the comment: the class definitions as follows? from typing import NamedTuple class Info(NamedTuple): service: str damage: str privilege: str info = Info("http", "no", "no") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:27:12 2019 From: report at bugs.python.org (zheng) Date: Wed, 10 Apr 2019 07:27:12 +0000 Subject: [issue36417] unicode.isdecimal bug in online Python 2 documentation In-Reply-To: <1553438833.3.0.95385374587.issue36417@roundup.psfhosted.org> Message-ID: <1554881232.05.0.33193967919.issue36417@roundup.psfhosted.org> Change by zheng : ---------- keywords: +patch pull_requests: +12684 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:31:08 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 10 Apr 2019 07:31:08 +0000 Subject: [issue35459] Use PyDict_GetItemWithError() instead of PyDict_GetItem() In-Reply-To: <1544525657.6.0.788709270274.issue35459@psf.upfronthosting.co.za> Message-ID: <1554881468.48.0.24543906593.issue35459@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are few occurrences of PyDict_GetItem(), PyDict_GetItemString() and _PyDict_GetItemId() in cases where they are unlikely failed. These cases will be considered in separate issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:31:29 2019 From: report at bugs.python.org (zheng) Date: Wed, 10 Apr 2019 07:31:29 +0000 Subject: [issue36417] unicode.isdecimal bug in online Python 2 documentation In-Reply-To: <1553438833.3.0.95385374587.issue36417@roundup.psfhosted.org> Message-ID: <1554881489.53.0.133351889668.issue36417@roundup.psfhosted.org> zheng added the comment: I propose we copy over the exact changes made to the Python 3 documentation. I looked through the code mentioned in the other thread. Namely, `Objects/unicodeobject.c` and `Tools/unicode/makeunicodedata.py`. The implementation is identical between python 2 and python 3. The only difference appears to be the unicode version used. # decimal digit, integer digit decimal = 0 if record[6]: flags |= DECIMAL_MASK decimal = int(record[6]) digit = 0 if record[7]: flags |= DIGIT_MASK digit = int(record[7]) if record[8]: flags |= NUMERIC_MASK numeric.setdefault(record[8], []).append(char) Another form of validation I did was enumerate all the digits and decimals and compare between versions. It looks like the general change is that there are a bunch of new unicode characters introduced in python 3. The exception is NEW TAI LUE THAM DIGIT ONE which gets recategorized as a digit. python 2, compiled with UCS4 for u in map(unichr, list(range(0x10FFFF))): if unicode.isdigit(u): print(unicodedata.name(u)) python 3 for u in map(chr, range(0x10FFFF)): if str.isdigit(u): print(name(u)) ---------- nosy: +zheng _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:38:51 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 10 Apr 2019 07:38:51 +0000 Subject: [issue36584] cython nametuple TypeError In-Reply-To: <1554881094.13.0.241658399375.issue36584@roundup.psfhosted.org> Message-ID: <1554881931.26.0.210880531818.issue36584@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a bug tracker of CPython -- the C implementation of Python. For bugs in Cython use different tracker. ---------- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 03:57:29 2019 From: report at bugs.python.org (Inada Naoki) Date: Wed, 10 Apr 2019 07:57:29 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554883049.2.0.952793475428.issue36559@roundup.psfhosted.org> Inada Naoki added the comment: * Is hashlib large, slow to import library? -- Yes. * random module use hashlib only for specific (rare) use case? -- Yes. * Does user of random module needs hashlib in most case? -- No. For example, tmpfile user may not need hashlib. I'm +1 on PR 12728. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 04:27:06 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 10 Apr 2019 08:27:06 +0000 Subject: [issue36583] Do not swallow exceptions in the _ssl module In-Reply-To: <1554880959.84.0.895759680892.issue36583@roundup.psfhosted.org> Message-ID: <1554884826.7.0.542256410947.issue36583@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +12686 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 04:51:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 08:51:12 +0000 Subject: [issue35906] [CVE-2019-9947] Header Injection in urllib In-Reply-To: <1549413131.7.0.216595978501.issue35906@roundup.psfhosted.org> Message-ID: <1554886272.58.0.672894548624.issue35906@roundup.psfhosted.org> STINNER Victor added the comment: According to https://bugzilla.redhat.com/show_bug.cgi?id=1695572, the CVE-2019-9947 has been assigned to this issue. ---------- nosy: +vstinner title: Header Injection in urllib -> [CVE-2019-9947] Header Injection in urllib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:07:09 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:07:09 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554887229.83.0.914721621117.issue14826@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +12687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:08:05 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:08:05 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554887285.15.0.965588352182.issue14826@roundup.psfhosted.org> Gregory P. Smith added the comment: urllib.request.URLopener() and FancyURLopener() automatically quote() URLs for the user. Those APIs are marked deprecated since 3.3 but have no timeline for removal. urllib.request.urlopen() does not use those, so URLs passed in are not auto-quoted. i'll clarify the docs for URLopener. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:11:07 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 09:11:07 +0000 Subject: [issue918368] urllib doesn't correct server returned urls Message-ID: <1554887467.62.0.347945182857.issue918368@roundup.psfhosted.org> STINNER Victor added the comment: > For the other referenced issue1153027, bug is not reproducible in the > trunk and I see that fix has been made in revision 43132. This change was a fix for bpo-1353433: commit ddb84d7c69addc5d5e2ab3e327260d97b52af3a7 Author: Georg Brandl Date: Sat Mar 18 11:35:18 2006 +0000 Bug #1353433: be conciliant with spaces in redirect URLs ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:11:30 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:11:30 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554887490.12.0.51587453658.issue30458@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch pull_requests: +12688 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:13:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 09:13:08 +0000 Subject: [issue1353433] Http redirection error in urllib2.py Message-ID: <1554887588.28.0.859551593324.issue1353433@roundup.psfhosted.org> STINNER Victor added the comment: > Added a fix in rev. 43132. In Git, it became the commit: commit ddb84d7c69addc5d5e2ab3e327260d97b52af3a7 Author: Georg Brandl Date: Sat Mar 18 11:35:18 2006 +0000 Bug #1353433: be conciliant with spaces in redirect URLs ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:17:54 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:17:54 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554887874.53.0.072420291803.issue14826@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 2fb2bc81c3f40d73945c6102569495140e1182c7 by Gregory P. Smith in branch 'master': bpo-14826: document that URLopener quotes fullurl. (GH-12758) https://github.com/python/cpython/commit/2fb2bc81c3f40d73945c6102569495140e1182c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:18:04 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 09:18:04 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554887884.94.0.447522072613.issue14826@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:18:18 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 09:18:18 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554887898.48.0.500589461762.issue14826@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12690 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:22:34 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:22:34 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554888154.92.0.0198099231302.issue30458@roundup.psfhosted.org> Gregory P. Smith added the comment: Martin claimed "Actually, the CRLF + space can be injected via percent encoding" I am unable to reproduce that behavior using urllib.request.urlopen() or urllib.request.URLopener.open() in my master/3.8 tree. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:23:06 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:23:06 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554888186.16.0.538415248369.issue30458@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:30:36 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 09:30:36 +0000 Subject: [issue14826] urlopen URL with unescaped space In-Reply-To: <1337158473.64.0.398540003062.issue14826@psf.upfronthosting.co.za> Message-ID: <1554888636.15.0.655729380639.issue14826@roundup.psfhosted.org> miss-islington added the comment: New changeset 9d2ccf173e2e8ff069153f603d2e5b1ea757e734 by Miss Islington (bot) in branch '3.7': bpo-14826: document that URLopener quotes fullurl. (GH-12758) https://github.com/python/cpython/commit/9d2ccf173e2e8ff069153f603d2e5b1ea757e734 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:32:36 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:32:36 +0000 Subject: [issue35906] [CVE-2019-9947] Header Injection in urllib In-Reply-To: <1549413131.7.0.216595978501.issue35906@roundup.psfhosted.org> Message-ID: <1554888756.48.0.0021137880741.issue35906@roundup.psfhosted.org> Gregory P. Smith added the comment: my fix proposed in issue30458 fixes this issue. i do not think this one deserved its own CVE; at least https://nvd.nist.gov/vuln/detail/CVE-2019-9947's current text also points to the other one. ---------- nosy: +gregory.p.smith resolution: -> duplicate superseder: -> [CVE-2019-9740][security] CRLF Injection in httplib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 05:32:49 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 09:32:49 +0000 Subject: [issue35906] [CVE-2019-9947] Header Injection in urllib In-Reply-To: <1549413131.7.0.216595978501.issue35906@roundup.psfhosted.org> Message-ID: <1554888769.88.0.89631588465.issue35906@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:19:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:19:19 +0000 Subject: [issue1153027] http_error_302() crashes with 'HTTP/1.1 400 Bad Request Message-ID: <1554891559.62.0.836481258716.issue1153027@roundup.psfhosted.org> STINNER Victor added the comment: > Sorry, I meant fixed in revision 72351. Commit in Git: commit 690ce9b353bc0a86d0886470adbaa50e813de3b8 Author: Senthil Kumaran Date: Tue May 5 18:41:13 2009 +0000 Fix for issue1153027, making Py3k changes similar to fix in issue918368. This will address: a) urllib/ in py3k, b) urllib in py2x is addressed by issue918368. c) urllib2 in py2x was already addressed in Revision 43132. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:28:27 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 10 Apr 2019 10:28:27 +0000 Subject: [issue36585] test_posix.py fails due to unsupported RWF_HIPRI Message-ID: <1554892107.72.0.359102203411.issue36585@roundup.psfhosted.org> New submission from Jeroen Demeyer : On Linux with an old kernel: 0:03:59 load avg: 5.97 [300/420/1] test_posix failed -- running: test_tools (1 min 11 sec), test_concurrent_futures (2 min 42 sec) test test_posix failed -- Traceback (most recent call last): File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_posix.py", line 311, in test_preadv_flags self.assertEqual(posix.preadv(fd, buf, 3, os.RWF_HIPRI), 10) OSError: [Errno 95] Operation not supported The problem is obvious: it's testing a flag which is not supported by this kernel. The fact that the macro RWF_HIPRI is defined (which is a compile-time condition) does not imply that the kernel actually supports it (which is a run-time condition). ---------- messages: 339844 nosy: jdemeyer, pablogsal priority: normal severity: normal status: open title: test_posix.py fails due to unsupported RWF_HIPRI _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:32:12 2019 From: report at bugs.python.org (Inada Naoki) Date: Wed, 10 Apr 2019 10:32:12 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1554892332.02.0.31930035556.issue27860@roundup.psfhosted.org> Inada Naoki added the comment: @moritzs Would you create a pull request on GitHub? Or may I create a pull request for your patch? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:36:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:36:15 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554892575.98.0.457417082583.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I didn't recall that this issue (this class of security vulnerabilities) has a so old history. I found *A LOT* of similar open issues. Here are my notes. Maybe most open issues should be closed as duplicate of this one to clarify the status of urllib in Python? :-) Emails: * 2019: https://mail.python.org/pipermail/python-dev/2019-April/157014.html * 2017: https://mail.python.org/pipermail/python-dev/2017-July/148699.html Open issues: * 2011, bpo-13359: "urllib2 doesn't escape spaces in http requests" Not marked as a security issue. * 2012, bpo-14826: "urlopen URL with unescaped space" Fix using quote(self.__original, safe="%/:=&?~#+!$,;'@()*[]|") ... and the changed has then be reverted because it broke buildbots. Still open. * 2013, bpo-17322: "urllib.request add_header() currently allows trailing spaces (and other weird stuff)" Not marked as a security issue. * 2014, bpo-22928: "HTTP header injection in urrlib2/urllib/httplib/http.client (CVE-2016-5699)" Marked as fixed, but user Orange explained in the first comment of in bpo-30458 that the fix is incomplete. * 2017, bpo-30458: "[CVE-2019-9740][security] CRLF Injection in httplib" (this issue) * 2017, bpo-32085: "[Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages!" * 2019, bpo-35906: "[CVE-2019-9947] Header Injection in urllib" (another CVE!) Closed issues: * 2004, bpo-918368: "urllib doesn't correct server returned urls" (urllib) FIXED BY: commit 7c2867fcb1ade429a41e030585332ea26e3f60e1 Fix: fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]") * 2005, bpo-1353433: "Http redirection error in urllib2.py" (urllib2) FIXED BY: commit ddb84d7c69addc5d5e2ab3e327260d97b52af3a7 Fix: newurl = newurl.replace(' ', '%20') * 2005, bpo-1153027: "http_error_302() crashes with 'HTTP/1.1 400 Bad Request" FIXED BY: commit 690ce9b353bc0a86d0886470adbaa50e813de3b8 (Lib/urllib/request.py) Fix: fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]") * bpo-29606: "urllib FTP protocol stream injection" Duplicate of bpo-30119. * bpo-30119: "(ftplib) A remote attacker could possibly attack by containing the newline characters" FIXED BY: commmit 8c2d4cf092c5f0335e7982392a33927579c4d512 Fix: reject "\r" and "\n" in FTP.putline() (Lib/ftplib.py) * bpo-36276: "[CVE-2019-9740] Python urllib CRLF injection vulnerability" Closed as duplicate of bpo-30458 Rejected pull requests: * https://github.com/python/cpython/pull/1216/files bpo-29606: Reject "\n" in ftp_open() of Lib/urllib/request.py * https://github.com/python/cpython/pull/2800/files bpo-29606: Reject "\n" in ftp_open() and open_ftp() of Lib/urllib/request.py * https://github.com/python/cpython/pull/2301/files bpo-30713: The splittype(), splitport() and splithost() functions of the urllib.parse module now reject URLs which contain a newline character. * https://github.com/python/cpython/pull/2303/files bpo-30713: The splittype(), splitport() and splithost() functions of the urllib.parse module now reject URLs which contain a newline character, but splittype() accepts newlines after the type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:36:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:36:30 +0000 Subject: [issue30458] [CVE-2019-9740][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554892590.33.0.172697428899.issue30458@roundup.psfhosted.org> Change by STINNER Victor : ---------- versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:42:31 2019 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 10 Apr 2019 10:42:31 +0000 Subject: [issue36586] multiprocessing.Queue.close doesn't behave as documented Message-ID: <1554892951.92.0.81637767288.issue36586@roundup.psfhosted.org> New submission from Thomas Grainger : The docs for https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Queue.close read: > Indicate that no more data will be put on this queue by the current process. The background thread will quit once it has flushed all buffered data to the pipe. This is called automatically when the queue is garbage collected. >From this text it seems to me as though the queue should be used as follows: import contextlib import multiprocessing def worker(q): with contextlib.closing(q): q.put_nowait('hello') def controller(): q = multiprocessing.Queue() q.close() # no more 'put's from this process p = multiprocessing.Process(target=worker, args=(q, )) p.start() assert q.get() == 'hello' p.join() assert p.exitcode == 0 print('OK!') if __name__ == '__main__': controller() however I get this: Traceback (most recent call last): File "controller.py", line 22, in controller() File "controller.py", line 15, in controller assert q.get() == 'hello' File "/usr/lib/python3.7/multiprocessing/queues.py", line 94, in get res = self._recv_bytes() File "/usr/lib/python3.7/multiprocessing/connection.py", line 212, in recv_bytes self._check_closed() File "/usr/lib/python3.7/multiprocessing/connection.py", line 136, in _check_closed raise OSError("handle is closed") OSError: handle is closed ---------- messages: 339847 nosy: graingert priority: normal severity: normal status: open title: multiprocessing.Queue.close doesn't behave as documented _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:43:18 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:43:18 +0000 Subject: [issue30458] [CVE-2019-9740][CVE-2019-9947][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554892998.64.0.68926448087.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: > * 2019, bpo-35906: "[CVE-2019-9947] Header Injection in urllib" (another CVE!) Gregory P. Smith just marked bpo-35906 as a duplicate of this issue. Copy of his msg339842: """ my fix proposed in issue30458 fixes this issue. i do not think this one deserved its own CVE; at least https://nvd.nist.gov/vuln/detail/CVE-2019-9947's current text also points to the other one. """ Until the status of CVE-2019-9947 is clarified, I added CVE-2019-9947 in the title of this issue to help to better track all CVEs :-) Did someone contact the CVE organization to do something with CVE-2019-9947? ---------- title: [CVE-2019-9740][security] CRLF Injection in httplib -> [CVE-2019-9740][CVE-2019-9947][security] CRLF Injection in httplib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:43:53 2019 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 10 Apr 2019 10:43:53 +0000 Subject: [issue36586] multiprocessing.Queue.close doesn't behave as documented In-Reply-To: <1554892951.92.0.81637767288.issue36586@roundup.psfhosted.org> Message-ID: <1554893033.67.0.347174535914.issue36586@roundup.psfhosted.org> Thomas Grainger added the comment: Should the docs be: > Indicate that no more data will be put on or got from this queue by the current process. The background thread will quit once it has flushed all buffered data to the pipe. This is called automatically when the queue is garbage collected. Or should the Queue allow closing only one direction of the bidirectional channel? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:45:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:45:12 +0000 Subject: [issue30458] [CVE-2019-9740][CVE-2019-9947][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554893112.12.0.910696926569.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: > The CVE-2019-9740 has been assigned to the bpo-36276 I don't know how CVE are assigned. Since this issue started with "the patch in CVE-2016-5699 can be broke by an addition space", would it make sense to reuse CVE-2016-5699 rather than using a new CVE? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:48:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:48:21 +0000 Subject: [issue30458] [CVE-2019-9740][CVE-2019-9947][security] CRLF Injection in httplib In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554893301.49.0.194972952354.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: > Closed issues: I forgot: * 2017, bpo-30713: "Reject newline character (U+000A) in URLs in urllib.parse" Rejected: the ftplib vulnerabilty has been fixed by bpo-30119 with commmit 8c2d4cf092c5f0335e7982392a33927579c4d512. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:50:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 10:50:15 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554893415.3.0.695273691849.issue30458@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [CVE-2019-9740][CVE-2019-9947][security] CRLF Injection in httplib -> [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:57:42 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 10 Apr 2019 10:57:42 +0000 Subject: [issue36585] test_posix.py fails due to unsupported RWF_HIPRI In-Reply-To: <1554892107.72.0.359102203411.issue36585@roundup.psfhosted.org> Message-ID: <1554893862.2.0.504051613727.issue36585@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +12691 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 06:59:20 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 10 Apr 2019 10:59:20 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554893960.96.0.00473338222228.issue30458@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: As @gregory.p.smith noted in GitHub [0] this fixes only protocol level bugs. There are some parsing ambiguities in urllib that are potential security issues still to be fixed. issue20271 - urllib.urlparse('http://benign.com\[attacker.com]') returns attacker.com as hostname . A slightly related issue https://bugs.python.org/issue20271 issue35748 - urllib.urlparse(r'http://spam\eggs!cheese&aardvark at evil.com') returns evil.com as hostname issue23505 - Urlparse insufficient validation leads to open redirect issue33661 - urllib may leak sensitive HTTP headers to a third-party web site (Redirecting from https to http might also pass some headers in plain text. This behavior was changed in requests, golang, Curl that had their own respective CVEs) As a fun side note this vulnerability was used by one of our own tests as a feature from 2012 to test another security issue (issue14001) [1] :) [0] https://github.com/python/cpython/pull/12755#issuecomment-481599611 [1] https://github.com/python/cpython/pull/12755#issuecomment-481618741 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 07:28:11 2019 From: report at bugs.python.org (Martin Panter) Date: Wed, 10 Apr 2019 11:28:11 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554895691.95.0.502607260147.issue30458@roundup.psfhosted.org> Martin Panter added the comment: Gregory, I haven?t tried recent Python code, but I expect the problem with percent decoding is still there. If you did try my example, what results did you see? Be aware that these techniques only work if the OS co-operates and connects to localhost when you give it the longer host string. At the moment I have glibc 2.26 on x86-64 Linux. In the Python 3 master branch, the percent-encoding should be decoded in ?urllib.request.Request._parse?: def _parse(self): ... self.host, self.selector = _splithost(rest) if self.host: self.host = unquote(self.host) Then in ?AbstractHTTPHandler.do_request_? the decoded host string becomes the ?Host? header field value, without any encoding: def do_request_(self, request): host = request.host ... sel_host = host ... if not request.has_header('Host'): request.add_unredirected_header('Host', sel_host) Perhaps one solution to both my version and Orange?s original version is to encode the ?Host? header field value properly. This might also apply to the ?http.client? code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:08:39 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 12:08:39 +0000 Subject: [issue29284] Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1 In-Reply-To: <1484584964.59.0.239435362381.issue29284@psf.upfronthosting.co.za> Message-ID: <1554898119.86.0.14024893981.issue29284@roundup.psfhosted.org> Cheryl Sabella added the comment: This seems like a reasonable request. A description of `thread_name_prefix` should probably also be added to the body of the class description instead of just in the versionadded directive. Assigning to @Mariatta for the sprints. Nosying @gregory.p.smith as he added the parameter in issue 27664. ---------- assignee: docs at python -> Mariatta nosy: +Mariatta, gregory.p.smith stage: -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:12:25 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 12:12:25 +0000 Subject: [issue32008] Example suggest to use a TLSv1 socket In-Reply-To: <1510428965.62.0.213398074469.issue32008@psf.upfronthosting.co.za> Message-ID: <1554898345.6.0.929207425359.issue32008@roundup.psfhosted.org> Cheryl Sabella added the comment: @christian.heimes, this one looks ready to merge and close. Please take a look when you get a chance. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:19:35 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 12:19:35 +0000 Subject: [issue28626] Tutorial: rearrange discussion of output formatting to encourage f-strings In-Reply-To: <1478452855.22.0.932657206329.issue28626@psf.upfronthosting.co.za> Message-ID: <1554898775.27.0.937951627694.issue28626@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- keywords: -needs review, patch resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:23:55 2019 From: report at bugs.python.org (Christian Heimes) Date: Wed, 10 Apr 2019 12:23:55 +0000 Subject: [issue36583] Do not swallow exceptions in the _ssl module In-Reply-To: <1554880959.84.0.895759680892.issue36583@roundup.psfhosted.org> Message-ID: <1554899035.93.0.832195040489.issue36583@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: -> serhiy.storchaka type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:28:42 2019 From: report at bugs.python.org (Vidar Fauske) Date: Wed, 10 Apr 2019 12:28:42 +0000 Subject: [issue31226] shutil.rmtree fails when target has an internal directory junction (Windows) In-Reply-To: <1502978298.87.0.60982184572.issue31226@psf.upfronthosting.co.za> Message-ID: <1554899322.74.0.287899307502.issue31226@roundup.psfhosted.org> Vidar Fauske added the comment: I think the submitted PR could need a pair of eyes now. I've sorted the merge conflicts, and addressed the previous review points by eryksun. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:32:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 12:32:58 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554899578.74.0.184544272671.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: bpo-36276 has been marked as a duplicate of this issue. According to the following message, urllib3 is also vulnerable to HTTP Header Injection: https://bugs.python.org/issue36276#msg337837 Copy of Alvin Chang's msg337837: """ I am also seeing the same issue with urllib3 import urllib3 pool_manager = urllib3.PoolManager() host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123" url = "http://" + host + ":8080/test/?test=a" try: info = pool_manager.request('GET', url).info() print(info) except Exception: pass nc -l localhost 7777 GET /?a=1 HTTP/1.1 X-injected: header TEST: 123:8080/test/?test=a HTTP/1.1 Host: localhost:7777 Accept-Encoding: identity """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:35:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 12:35:01 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554899701.99.0.904215209359.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: > According to the following message, urllib3 is also vulnerable to HTTP Header Injection: (...) And the issue has been reported to urllib3: https://github.com/urllib3/urllib3/issues/1553 Copy of the first message: """ At https://bugs.python.org/issue36276 there's an issue in Python's urllib that an attacker controlling the request parameter can inject headers by injecting CR/LF chars. A commenter mentions that the same bug is present in urllib3: https://bugs.python.org/issue36276#msg337837 So reporting it here to make sure it gets attention. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:38:01 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 12:38:01 +0000 Subject: [issue34698] urllib.request.Request.set_proxy doesn't (necessarily) replace type In-Reply-To: <1537031851.88.0.956365154283.issue34698@psf.upfronthosting.co.za> Message-ID: <1554899881.53.0.762539690169.issue34698@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +orsenthil versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:50:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 12:50:27 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554900627.12.0.00606291379074.issue36533@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:50:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 12:50:50 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1554900650.29.0.0995627325699.issue36549@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:56:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 12:56:02 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554900962.99.0.749685419445.issue36235@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12692 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:56:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 12:56:46 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554901006.53.0.986943719579.issue36235@roundup.psfhosted.org> STINNER Victor added the comment: Good, my change fixed x86-64 High Sierra 2.7 buildbot: https://buildbot.python.org/all/#/builders/140/builds/216 I wrote PR 12764 to forward-port the fix to the master branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 08:57:16 2019 From: report at bugs.python.org (Inada Naoki) Date: Wed, 10 Apr 2019 12:57:16 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1554901036.3.0.501536766706.issue36346@roundup.psfhosted.org> Inada Naoki added the comment: I think these ABI incompatible options are used many people. But it is helpful to find extensions which using legacy APIs before Python 3.10 is released. I had found ujson and MarkupSafe used legacy APIs. I fixed MarkupSafe. I don't care ujson because it is wrapper of wchar_t based C library and there are enough json libraries. I suppose there are some other packages in PyPI, but I'm not sure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 09:03:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 13:03:09 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554901389.62.0.356006577132.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: Since this issue has a long history and previously attempts to fix it failed, it seems like the Internet is a black or white world, more like a scale of gray... *Maybe* we need to provide a way to allow to pass junk characters in an URL? (disable URL validation) Idea: add an optional parameter to urllib, httplib, maybe also ftplib, to allow arbitrary "invalid" URLs / FTP commands. It would be a parameter *per request*, not a global option. I don't propose to have a global configuration option like an environment variable, urllib attribute or something else. A global option would be hard to control and would impact just too much code. My PEP 433 has been rejected because of the sys.setdefaultcloexec(cloexec: bool) function which allowed to change globally the behavior of Python. The PEP 446 has been accepted with no *global* option to opt-in for the old behavior, but only "local" *per file descriptor*: os.set_inheritable(fd, inheritable). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 09:40:21 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 13:40:21 +0000 Subject: [issue21318] sdist fails with symbolic links do non-existing files In-Reply-To: <1398040266.25.0.437462468374.issue21318@psf.upfronthosting.co.za> Message-ID: <1554903621.03.0.897799182287.issue21318@roundup.psfhosted.org> Cheryl Sabella added the comment: This was fixed under issue 12885. ---------- nosy: +cheryl.sabella resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> distutils.filelist.findall() fails on broken symlink in Py2.x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 09:45:47 2019 From: report at bugs.python.org (cagney) Date: Wed, 10 Apr 2019 13:45:47 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554903947.39.0.196013026426.issue36533@roundup.psfhosted.org> cagney added the comment: > nope. the contrived emit() pseudocode from msg339650 never defined b in the first place. that code, if massaged into python syntax would raise an UnboundLocalError no matter who executed it. a fork() from another thread would not change that. There is no concept of undefined/uninitialized state from the Python perspective. Wow! It is pseudo code, right? (I figured using Ada like attributes was a bit of a giveaway). Nitpicking it achieves nothing (if you feel that your language needs 'b' pre-defined then, hey!, pre-define it; I'm pretty sure that won't fix the problem of operations such b[i] = 2 not being atomic yet alone thread-safe in Python). Lets instead focus on my point that breaking the locks won't fix the problem. For instance, above. Or "For instance, if the fork() happens while a thread is holding the FILE lock on a log file, then the child trying to access that FILE will hang." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 09:49:42 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 13:49:42 +0000 Subject: [issue24011] Add error checks to PyInit_signal() In-Reply-To: <1429471695.96.0.523863138973.issue24011@psf.upfronthosting.co.za> Message-ID: <1554904182.13.0.320388474518.issue24011@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- stage: patch review -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 09:55:40 2019 From: report at bugs.python.org (cagney) Date: Wed, 10 Apr 2019 13:55:40 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554904540.49.0.588095147278.issue36533@roundup.psfhosted.org> cagney added the comment: BTW, non-visible change might be to use a global readers-writer lock where fork() is the writer. https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 10:02:12 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 14:02:12 +0000 Subject: [issue30612] Unusual Windows registry path syntax In-Reply-To: <1497000804.0.0.079840477122.issue30612@psf.upfronthosting.co.za> Message-ID: <1554904932.16.0.169960584221.issue30612@roundup.psfhosted.org> Cheryl Sabella added the comment: @chrullrich, were you still interested in creating a PR for this? Thanks! ---------- nosy: +cheryl.sabella versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 10:14:38 2019 From: report at bugs.python.org (cagney) Date: Wed, 10 Apr 2019 14:14:38 +0000 Subject: [issue36587] race in logging code when fork() Message-ID: <1554905678.69.0.300642105392.issue36587@roundup.psfhosted.org> New submission from cagney : Buried in issue36533; it should probably be turned into a test case. Exception ignored in: Traceback (most recent call last): File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 269, in _after_at_fork_weak_calls _at_fork_weak_calls('release') File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 254, in _at_fork_weak_calls for instance in _at_fork_acquire_release_weakset: File "/home/python/v3.7.3/lib/python3.7/_weakrefset.py", line 60, in __iter__ for itemref in self.data: RuntimeError: Set changed size during iteration Exception in thread Thread-1: Traceback (most recent call last): File "/home/python/v3.7.3/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/home/python/v3.7.3/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "./btc.py", line 11, in lockie h = logging.Handler() File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 824, in __init__ self.createLock() File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 847, in createLock _register_at_fork_acquire_release(self) File "/home/python/v3.7.3/lib/python3.7/logging/__init__.py", line 250, in _register_at_fork_acquire_release _at_fork_acquire_release_weakset.add(instance) File "/home/python/v3.7.3/lib/python3.7/_weakrefset.py", line 83, in add self._commit_removals() File "/home/python/v3.7.3/lib/python3.7/_weakrefset.py", line 56, in _commit_removals discard(l.pop()) IndexError: pop from empty list ---------- components: Library (Lib) files: btc.py messages: 339866 nosy: cagney priority: normal severity: normal status: open title: race in logging code when fork() type: crash versions: Python 3.7 Added file: https://bugs.python.org/file48258/btc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 10:15:39 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 14:15:39 +0000 Subject: [issue19476] Add a dedicated specification for module "reloading" to the language reference In-Reply-To: <1383328344.74.0.699907316394.issue19476@psf.upfronthosting.co.za> Message-ID: <1554905739.24.0.131003542673.issue19476@roundup.psfhosted.org> Cheryl Sabella added the comment: Hi Eric, Is this still a concern since PEP 451 has been implemented for over 5 years now? Thanks! ---------- nosy: +cheryl.sabella -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 10:25:12 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 10 Apr 2019 14:25:12 +0000 Subject: [issue36587] race in logging code when fork() In-Reply-To: <1554905678.69.0.300642105392.issue36587@roundup.psfhosted.org> Message-ID: <1554906312.23.0.664255495945.issue36587@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +gregory.p.smith, vinay.sajip type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 10:41:13 2019 From: report at bugs.python.org (Eric Snow) Date: Wed, 10 Apr 2019 14:41:13 +0000 Subject: [issue19476] Add a dedicated specification for module "reloading" to the language reference In-Reply-To: <1383328344.74.0.699907316394.issue19476@psf.upfronthosting.co.za> Message-ID: <1554907273.22.0.658200338533.issue19476@roundup.psfhosted.org> Eric Snow added the comment: Thanks for checking in, Cheryl! Clearly no one picked up this banner. :) Furthermore, I'm not aware of any reload-related complaints coming from the community. I know of only a couple major use cases for reload(): refresh parts of a running app during development and reload a config (e.g. SIGHUP). Those use cases seem to be mostly stable. Given ~4.5 years of zero activity here, I think it's safe to say nothing further is going to happen. :) So I'm closing this issue. At this point I don't see much value in keeping it open. If someone later finds a concrete motivator for more detail about module-reloading in the language reference (or decide they want to drive this effort) then they can re-open this issue (or create a new one) at that point. ---------- resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 11:04:50 2019 From: report at bugs.python.org (Michael Felt) Date: Wed, 10 Apr 2019 15:04:50 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX Message-ID: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> New submission from Michael Felt : This is something that probably shouts - boring - but back in 2012 it was a hot topic for linux2 and linux3. Maybe - as far back as 1996 (when AIX4 was new) "aix3" and "aix4" made sense. Whether that is true, or not - is pointless these days - for Python3. In the python code I have reviewed - for various reasons - I have never seen any code with "sys.platform() == "aixX" (where X is any of 5, 6, 7). There was a reference to "aix3" and "aix4" in setup.py (recently removed, and there is no replacement for aix5, aix6, or aix7 - not needed!) What I mostly see is sys.platform.startswith("aix"). The other form of the same test is sys.platform[:3] == 'aix' sys.platform is "build" related, e.g., potentially bound to libc issues. Even if this was the case (AIX offers since 2007 - official binary compatibility from old to new (when libc is dynamically linked, not static linked), was "unofficial" for aix3 and aix4). Yes, I am sure there are arguments along the line of "why change" since we have been updating it - always, and/or the documentation says so. linux2 had to stay, because there was known code that compared with linux2 (and that code was having problems when python was built on linux3 - hence the change to make sys.platform return linux2 for all Python3.2 and younger). FYI: in Cpython (master) there are no references to "aixX". All the references there are (in .py) are: michael at x071:[/data/prj/python/git/cpython-master]find . -name \*.py | xargs egrep "[\"']aix" ./Lib/asyncio/unix_events.py: if is_socket or (is_fifo and not sys.platform.startswith("aix")): ./Lib/ctypes/__init__.py: if _sys.platform.startswith("aix"): ./Lib/ctypes/util.py:elif sys.platform.startswith("aix"): ./Lib/ctypes/util.py: elif sys.platform.startswith("aix"): ./Lib/distutils/command/build_ext.py: elif sys.platform[:3] == 'aix': ./Lib/distutils/util.py: elif osname[:3] == "aix": ./Lib/sysconfig.py: elif osname[:3] == "aix": ./Lib/test/test_asyncio/test_events.py: if sys.platform.startswith("aix"): ./Lib/test/test_faulthandler.py: @unittest.skipIf(sys.platform.startswith('aix'), ./Lib/test/test_strftime.py: or sys.platform.startswith(("aix", "sunos", "solaris"))): ./Lib/test/test_strptime.py: @unittest.skipIf(sys.platform.startswith('aix'), ./Lib/test/test_locale.py: @unittest.skipIf(sys.platform.startswith('aix'), ./Lib/test/test_locale.py: @unittest.skipIf(sys.platform.startswith('aix'), ./Lib/test/test_fileio.py: not sys.platform.startswith(('sunos', 'aix')): ./Lib/test/test_tools/test_i18n.py: @unittest.skipIf(sys.platform.startswith('aix'), ./Lib/test/test_wait4.py: if sys.platform.startswith('aix'): ./Lib/test/test_c_locale_coercion.py:elif sys.platform.startswith("aix"): ./Lib/test/test_shutil.py:AIX = sys.platform[:3] == 'aix' ./Lib/test/test_utf8_mode.py: elif sys.platform.startswith("aix"): I'll write the patch - if I recall it should be a one-liner in configure.ac, but I think some discussion (or blessing) first is appropriate. Maybe even review whether other platforms no longer rely on the X for the platform. Hoping this helps! ---------- components: Build messages: 339869 nosy: Michael.Felt priority: normal severity: normal status: open title: change sys.platform() to just "aix" for AIX versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 11:05:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 15:05:58 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1554908758.55.0.379666129839.issue36588@roundup.psfhosted.org> STINNER Victor added the comment: I like the idea. Would you like to propose a patch? I suggest to only make such change in Python 3.8 and properly document it. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 11:30:41 2019 From: report at bugs.python.org (Adam Olsen) Date: Wed, 10 Apr 2019 15:30:41 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554910241.23.0.782354099466.issue1583@roundup.psfhosted.org> Adam Olsen added the comment: signal-safe is different from thread-safe (despite conceptual similarities), but regardless it's been a long time since I last delved into this so I'm quite rusty. I could be doing it all wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 11:54:50 2019 From: report at bugs.python.org (Michael Felt) Date: Wed, 10 Apr 2019 15:54:50 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908758.55.0.379666129839.issue36588@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: On 10/04/2019 17:05, STINNER Victor wrote: > STINNER Victor added the comment: > > I like the idea. Would you like to propose a patch? I suggest to only make such change in Python 3.8 and properly document it. > > ---------- > nosy: +vstinner > > _______________________________________ > Python tracker > > _______________________________________ > If I understand correctly, the change should be quite simple: diff --git a/configure.ac b/configure.ac index 73ee71c..9632add 100644 --- a/configure.ac +++ b/configure.ac @@ -404,6 +404,7 @@ then ???? MACHDEP="$ac_md_system$ac_md_release" ???? case $MACHDEP in +?????? aix*) MACHDEP="aix";; ??????? linux*) MACHDEP="linux";; ??????? cygwin*) MACHDEP="cygwin";; ??????? darwin*) MACHDEP="darwin";; However, I am less familiar with (where) the appropriate documentation is. A pointer to the documentation is appreciated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 11:56:31 2019 From: report at bugs.python.org (Michael Felt) Date: Wed, 10 Apr 2019 15:56:31 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x In-Reply-To: <1554828700.04.0.163813636834.issue36579@roundup.psfhosted.org> Message-ID: <4d41335e-b685-8904-1e03-d426cdfbb8b2@felt.demon.nl> Michael Felt added the comment: On 09/04/2019 18:51, STINNER Victor wrote: > New submission from STINNER Victor : > > https://buildbot.python.org/all/#/builders/10/builds/2389 > > 0:45:36 [412/420/1] test_venv crashed (Exit code 1) > Timeout (0:15:00)! > Thread 0x00000001 (most recent call first): > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 987 in communicate > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 476 in run > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 396 in check_output > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py", line 271 in _setup_pip > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py", line 68 in create > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/venv/__init__.py", line 373 in create > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 68 in run_with_capture > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 400 in do_test_with_pip > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 460 in test_with_pip > ... > Re-running test 'test_venv' in verbose mode > test_defaults (test.test_venv.BasicTest) ... ok > ... > test_devnull (test.test_venv.EnsurePipTest) ... ok > test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok > test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok > Timeout (0:15:00)! > Thread 0x00000001 (most recent call first): > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/selectors.py", line 415 in select > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 1807 in _communicate > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.py", line 1000 in communicate > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 39 in check_output > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 428 in do_test_with_pip > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_venv.py", line 460 in test_with_pip > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py", line 680 in run > File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/case.py", line 740 in __call__ > ... > test_with_pip (test.test_venv.EnsurePipTest) ... Makefile:1139: recipe for target 'buildbottest' failed > make: *** [buildbottest] Error 1 > program finished with exit code 2 > > ---------- > components: Tests > messages: 339778 > nosy: David.Edelsohn, Michael.Felt, vstinner > priority: normal > severity: normal > status: open > title: test_venv: test_with_pip() hangs on PPC64 AIX 3.x > versions: Python 3.8 > > _______________________________________ > Python tracker > > _______________________________________ > I am looking into this - but as it seems to have gone away again - is there a simple way to get that code back, and/or see what the diff is, before/badrun/after? Michael ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 12:00:48 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 10 Apr 2019 16:00:48 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554912048.9.0.169888675753.issue1583@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 12:30:26 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 16:30:26 +0000 Subject: [issue19770] NNTP.post broken In-Reply-To: <1385382524.39.0.481766399265.issue19770@psf.upfronthosting.co.za> Message-ID: <1554913826.35.0.554746707022.issue19770@roundup.psfhosted.org> Cheryl Sabella added the comment: Hi David, You wrote: > It might be worth adding a post_message method, analogous to the send_message method I added to smtplib. Do you still think this would be worthwhile to add? If so, do you think this would be a good task for someone to work on at the PyCon sprints? Thanks! ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 12:49:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 16:49:03 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x In-Reply-To: <1554828700.04.0.163813636834.issue36579@roundup.psfhosted.org> Message-ID: <1554914943.12.0.570465891658.issue36579@roundup.psfhosted.org> STINNER Victor added the comment: "I am looking into this - but as it seems to have gone away again - is there a simple way to get that code back, and/or see what the diff is, before/badrun/after?" Maybe it's just a flacky test. It's hard to guess. You can get the Git revision of a build by looking at details: https://buildbot.python.org/all/#/builders/10/builds/2389 => Properties: "got_revision: 8702b67dad62a9084f6c1823dce10653743667c8" See also "Changes" tab. Sometimes when a bug disappears, I just close it as "outdated" after a few weeks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 12:49:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 16:49:37 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1554914977.99.0.509812980303.issue36346@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 12:52:48 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Wed, 10 Apr 2019 16:52:48 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1554915168.69.0.215127329164.issue36475@roundup.psfhosted.org> Joannah Nanjekye added the comment: @eric do we need any tests for this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 13:19:25 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 17:19:25 +0000 Subject: [issue34144] venv activate.bat reset codepage fails on windows 10 In-Reply-To: <1531901922.72.0.56676864532.issue34144@psf.upfronthosting.co.za> Message-ID: <1554916765.93.0.050588818872.issue34144@roundup.psfhosted.org> miss-islington added the comment: New changeset 6955d44b41058e3bcc59ff41860bd4cc8948c441 by Miss Islington (bot) (Lorenz Mende) in branch 'master': bpo-34144: Fix of venv acvtivate.bat for win 10 (GH-8321) https://github.com/python/cpython/commit/6955d44b41058e3bcc59ff41860bd4cc8948c441 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 13:38:02 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Wed, 10 Apr 2019 17:38:02 +0000 Subject: [issue24011] Add error checks to PyInit_signal() In-Reply-To: <1429471695.96.0.523863138973.issue24011@psf.upfronthosting.co.za> Message-ID: <1554917882.11.0.0511072141878.issue24011@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- pull_requests: +12693 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 14:15:03 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 10 Apr 2019 18:15:03 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1554920103.24.0.226914954075.issue36549@roundup.psfhosted.org> Serhiy Storchaka added the comment: This issue is easy if you know C. * Find the implementation of str.capitalize in unicodeobject.c and make it using the title case. See on the implementation of str.title for example. * Find tests for str.capitalize and a?d new cases. Finding the proper place for test may be the hardest part. * Update the documentation for str.capitalize. Add the versionchanged directive. * Fix the documentation for str.title. Use str.capitalize in the example. * Add the news and What's New entries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 14:49:44 2019 From: report at bugs.python.org (R. David Murray) Date: Wed, 10 Apr 2019 18:49:44 +0000 Subject: [issue19770] NNTP.post broken In-Reply-To: <1554913826.35.0.554746707022.issue19770@roundup.psfhosted.org> Message-ID: <20190410184942.1F8F1251E73@webabinitio.net> R. David Murray added the comment: I do, and sure. I won't be able to review it, though :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 14:54:49 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 18:54:49 +0000 Subject: [issue36587] race in logging code when fork() In-Reply-To: <1554905678.69.0.300642105392.issue36587@roundup.psfhosted.org> Message-ID: <1554922489.29.0.601518219989.issue36587@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 14:55:18 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 18:55:18 +0000 Subject: [issue36587] race in logging code when fork() In-Reply-To: <1554905678.69.0.300642105392.issue36587@roundup.psfhosted.org> Message-ID: <1554922518.09.0.139345230614.issue36587@roundup.psfhosted.org> Gregory P. Smith added the comment: yeah i saw that bug buried in there, this weakset goes away with my proposed PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:03:55 2019 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 10 Apr 2019 19:03:55 +0000 Subject: [issue36589] Incorrect error handling in curses.update_lines_cols() Message-ID: <1554923035.79.0.592038232821.issue36589@roundup.psfhosted.org> New submission from Zackery Spytz : update_lines_cols() returns 0 if an error occurs, but the generated AC code checks for a return value of -1. ---------- components: Extension Modules messages: 339881 nosy: ZackerySpytz priority: normal severity: normal status: open title: Incorrect error handling in curses.update_lines_cols() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:08:47 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 19:08:47 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1554923327.05.0.656037376529.issue36533@roundup.psfhosted.org> Gregory P. Smith added the comment: The problem i am fixing is merely making Python's logging library not the source of this deadlock because it was not the source in the past. I am solving a regression in CPython behavior between 3.7.0 and 3.7.1 that led to a logging.Handler lock related deadlock in two identified problematic applications. Breaking the logging.Handler owned locks does solve that unless someone has concrete proof from these specific applications that it does otherwise. It would be helpful if someone *willing to actually be constructive* would test them with my PR's patch applied to their 3.7.3 interpreter as confirmation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:09:25 2019 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 10 Apr 2019 19:09:25 +0000 Subject: [issue36589] Incorrect error handling in curses.update_lines_cols() In-Reply-To: <1554923035.79.0.592038232821.issue36589@roundup.psfhosted.org> Message-ID: <1554923365.38.0.281945430674.issue36589@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12694 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:09:52 2019 From: report at bugs.python.org (Ivan Pozdeev) Date: Wed, 10 Apr 2019 19:09:52 +0000 Subject: [issue36501] Remove POSIX.1e ACLs in tests that rely on default permissions behavior In-Reply-To: <1554173646.74.0.526062009257.issue36501@roundup.psfhosted.org> Message-ID: <1554923392.21.0.372288536827.issue36501@roundup.psfhosted.org> Ivan Pozdeev added the comment: Given the downsides, I think the proposed solution as it's now is too hacky to be a net improvement. "Skip mode_t checks" looks like the only way to go (since I've no idea how to "create temporary dirs" transparently for arbitrary test logic). But skipping tests defeats the purpose of a buildbot, so it's not a solution for the problem at hand. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:20:20 2019 From: report at bugs.python.org (Brett Cannon) Date: Wed, 10 Apr 2019 19:20:20 +0000 Subject: [issue36586] multiprocessing.Queue.close doesn't behave as documented In-Reply-To: <1554892951.92.0.81637767288.issue36586@roundup.psfhosted.org> Message-ID: <1554924020.41.0.568256638179.issue36586@roundup.psfhosted.org> Change by Brett Cannon : ---------- components: +Library (Lib) nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:31:06 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 10 Apr 2019 19:31:06 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554924666.26.0.324487988986.issue30458@roundup.psfhosted.org> Gregory P. Smith added the comment: > *Maybe* we need to provide a way to allow to pass junk characters in an URL? (disable URL validation) We should not do this in our http protocol stack code. Anyone who _wants_ that is already intentionally violating the http protocol which defeats the entire purpose of our library and the parameter named "url". Will this break something in the world other than our own test_xmlrpc test? Probably. Do they have a right to complain about it? Not one we need listen to. Such code is doing something that was clearly an abuse of the API. The parameter was named url not raw_data_to_stuff_subversively_into_the_binary_protocol. Its intent was clear. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:33:27 2019 From: report at bugs.python.org (Brett Cannon) Date: Wed, 10 Apr 2019 19:33:27 +0000 Subject: [issue26389] Expand traceback module API to accept just an exception as an argument In-Reply-To: <1455836350.85.0.0162824201978.issue26389@psf.upfronthosting.co.za> Message-ID: <1554924807.08.0.163904453518.issue26389@roundup.psfhosted.org> Brett Cannon added the comment: Boy, having a postional-only parameter in that first position would have been handy when we created this API (as Matthias pointed out). :) The 'exec' keyword-only parameter is obviously the safest option here. Making the first parameter positional-only and then making the other parameters optional would lead to the most fluid API long-term as people I suspect would much rather just pass in an object than always specifying the keyword-only parameter every time going forward. I also doubt anyone is specifying etype by name. So my vote is: +1 to a positional-only first parameter +0 to 'exc' keyword-only parameter ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 15:37:48 2019 From: report at bugs.python.org (Brett Cannon) Date: Wed, 10 Apr 2019 19:37:48 +0000 Subject: [issue30274] Make importlib.abc.ExtensionFileLoader.__init__() documentation match code In-Reply-To: <1493936689.45.0.0881901800669.issue30274@psf.upfronthosting.co.za> Message-ID: <1554925068.85.0.21023617294.issue30274@roundup.psfhosted.org> Brett Cannon added the comment: I realized another solution to this is to make the argument positional-only, then the name simply doesn't matter. Probably unnecessary breakage, though. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 16:18:23 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 10 Apr 2019 20:18:23 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554927503.55.0.176900884868.issue36559@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset d914596a671c4b0f13641359cf43aa0d6fc05070 by Raymond Hettinger (Christian Heimes) in branch 'master': bpo-36559: random module: optimize sha512 import (GH-12742) https://github.com/python/cpython/commit/d914596a671c4b0f13641359cf43aa0d6fc05070 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 16:18:43 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 10 Apr 2019 20:18:43 +0000 Subject: [issue36559] "import random" should import hashlib on demand (nor load OpenSSL) In-Reply-To: <1554729061.73.0.692414846311.issue36559@roundup.psfhosted.org> Message-ID: <1554927523.22.0.60863363603.issue36559@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 16:21:11 2019 From: report at bugs.python.org (Greg Bowser) Date: Wed, 10 Apr 2019 20:21:11 +0000 Subject: [issue36590] Add Bluetooth RFCOMM Support for Windows Message-ID: <1554927671.26.0.0558973169259.issue36590@roundup.psfhosted.org> New submission from Greg Bowser : socketmodule supports Bluetooth RFCOMM sockets for Linux. Given that winsock supports this under windows, it is possible to add windows support as well. ---------- components: IO, Windows messages: 339888 nosy: Greg Bowser, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add Bluetooth RFCOMM Support for Windows type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 16:27:59 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 10 Apr 2019 20:27:59 +0000 Subject: [issue36555] PEP484 @overload vs. str/bytes In-Reply-To: <1554720612.88.0.913385974113.issue36555@roundup.psfhosted.org> Message-ID: <1554928079.91.0.539249651204.issue36555@roundup.psfhosted.org> Guido van Rossum added the comment: > Mypy already takes first overload for ambiguous arguments. This is true, but it requires that the return types match (covariantly, IIUC) for the overlapping types. So you can have @overload def foo(x: int) -> int: ... @overload def foo(x: float) -> float: ... But you can't have @overload def foo(x: int) -> str: ... @overload def foo(x: float) -> float: ... (and the docs explain why -- search for "unsafe_func"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 16:49:41 2019 From: report at bugs.python.org (Kingsley McDonald) Date: Wed, 10 Apr 2019 20:49:41 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1554929381.59.0.297116887036.issue36549@roundup.psfhosted.org> Kingsley McDonald added the comment: Thanks for clarifying all of that! I now have the patch and tests working locally. However, I'm not too sure what documentation needs to be changed for str.title. Should it specify that only the first letter of digraphs are capitalised, rather than the full character? I sure hope I get the hang of this soon :-D ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 16:53:35 2019 From: report at bugs.python.org (Roundup Robot) Date: Wed, 10 Apr 2019 20:53:35 +0000 Subject: [issue36590] Add Bluetooth RFCOMM Support for Windows In-Reply-To: <1554927671.26.0.0558973169259.issue36590@roundup.psfhosted.org> Message-ID: <1554929615.65.0.177501313391.issue36590@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12695 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 17:03:51 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 21:03:51 +0000 Subject: [issue24116] --with-pydebug has no effect when the final python binary is compiled In-Reply-To: <1430637278.73.0.597162622661.issue24116@psf.upfronthosting.co.za> Message-ID: <1554930231.11.0.255635610478.issue24116@roundup.psfhosted.org> Cheryl Sabella added the comment: If this is a documentation issue on the build, then I think this issue should be moved to the devguide repo on GitHub. I'm not sure if it's still unclear though, so maybe this could just be closed? ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 17:10:33 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 10 Apr 2019 21:10:33 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554930633.91.0.0442024245924.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: > signal-safe is different from thread-safe I know, but I think that other threads can receive signals too. So in that case, it needs to be signal-safe as well as thread-safe. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 17:16:52 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 21:16:52 +0000 Subject: [issue1222585] C++ compilation support for distutils Message-ID: <1554931012.46.0.79317096379.issue1222585@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 17:19:33 2019 From: report at bugs.python.org (Terry Davis) Date: Wed, 10 Apr 2019 21:19:33 +0000 Subject: [issue36591] Should be a typing.UserNamedTuple Message-ID: <1554931173.44.0.541756182017.issue36591@roundup.psfhosted.org> New submission from Terry Davis : There should be a builtin alias for `Type[NamedTuple]` so that library authors user-supplied `NamedTuple`s can properly type-check their code. Here's a code sample that causes an issue in my IDE (PyCharm) ******************************** from typing import NamedTuple, Type def fun(NT: NamedTuple, fill): # Complains that NamedTuple is not callable nt = NT(*fill) return nt UserNamedTuple = Type[NamedTuple] def fun(NT: UserNamedTuple, fill): # No complaints nt = NT(*fill) return nt ******************************** This could just be an issue with PyCharm (I don't use mypy), but the correct to annotate this is with a Type[NamedTuple], so I hope mypy et. al. wouldn't this as a special case... ---------- components: Library (Lib) messages: 339893 nosy: Terry Davis priority: normal severity: normal status: open title: Should be a typing.UserNamedTuple type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 18:05:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 22:05:48 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1554933948.96.0.217277863985.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: > Will this break something in the world other than our own test_xmlrpc test? Probably. Do they have a right to complain about it? Not one we need listen to. I understand. But. Can we consider that for old Python versions like Python 2.7 and 3.5? This change will be applied to all supported Python versions. I recall that when Python 2.7 started to validate TLS certificate, the change broke some applications. Are these applications badly written? Yes! But well, "it worked well before". Sometimes, when you work in a private network, the security matters less, whereas it might be very expensive to fix a legacy application. At Red Hat, we developed a solution to let customers to opt-out from this fix (to no validate TLS certificates), because it is just too expensive for customers to fix their legacy code but they would like to be able to upgrade RHEL. One option to not validate URLs is to downgrade Python, but I'm not sure that it's the best compromise :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 18:06:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 22:06:17 +0000 Subject: [issue19770] NNTP.post broken In-Reply-To: <1385382524.39.0.481766399265.issue19770@psf.upfronthosting.co.za> Message-ID: <1554933977.61.0.43734991249.issue19770@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 18:09:28 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 22:09:28 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1554934168.55.0.902368528943.issue36588@roundup.psfhosted.org> STINNER Victor added the comment: > However, I am less familiar with (where) the appropriate documentation is. A pointer to the documentation is appreciated. It would be nice to add a note to: * https://docs.python.org/dev/whatsnew/3.8.html#changes-in-the-python-api * https://docs.python.org/dev/library/sys.html#sys.platform In the source code, there are the files: * Doc/whatsnew/3.8.rst * Doc/library/sys.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 18:36:55 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 10 Apr 2019 22:36:55 +0000 Subject: [issue18564] Integer overflow in socketmodule In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1554935815.56.0.753518384404.issue18564@roundup.psfhosted.org> Cheryl Sabella added the comment: Michele Orr?, Would you be interested in making a GitHub pull request for your patch? Thanks! ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 18:51:43 2019 From: report at bugs.python.org (Adam Olsen) Date: Wed, 10 Apr 2019 22:51:43 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554936703.8.0.975839054619.issue1583@roundup.psfhosted.org> Adam Olsen added the comment: signalmodule.c has a hack to limit it to the main thread. Otherwise there's all sorts of platform-specific behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 19:36:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 23:36:47 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1554939407.21.0.868552722703.issue31904@roundup.psfhosted.org> STINNER Victor added the comment: Please stop adding more pull requests, I cannot review too many at the same time. I would prefer to have a limit of 4 open PRs. I don't propose to close existing ones. Just stop to add more :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 19:38:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 10 Apr 2019 23:38:51 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554939531.2.0.153402269888.issue36235@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a9bd8925c7fa50dd3cfab125b824ec192133ef49 by Victor Stinner in branch 'master': bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764) https://github.com/python/cpython/commit/a9bd8925c7fa50dd3cfab125b824ec192133ef49 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 19:39:00 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 23:39:00 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554939540.06.0.93581708299.issue36235@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 19:55:25 2019 From: report at bugs.python.org (Geraldo Xexeo) Date: Wed, 10 Apr 2019 23:55:25 +0000 Subject: [issue36592] is behave different for integers in 3.6 and 3.7 Message-ID: <1554940525.0.0.506385110502.issue36592@roundup.psfhosted.org> New submission from Geraldo Xexeo : # When you run the program: a,b=300,300 print(a is b) #you get different results in 3.6 (True) and 3.7 (False) ---------- components: Interpreter Core files: testisbehavior.py messages: 339900 nosy: Geraldo.Xexeo priority: normal severity: normal status: open title: is behave different for integers in 3.6 and 3.7 versions: Python 3.6, Python 3.7 Added file: https://bugs.python.org/file48259/testisbehavior.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 19:58:58 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 10 Apr 2019 23:58:58 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554940738.51.0.267374402116.issue36235@roundup.psfhosted.org> miss-islington added the comment: New changeset d9b25a2627ff6f4e10d46b4de4fff941b63497c7 by Miss Islington (bot) in branch '3.7': bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764) https://github.com/python/cpython/commit/d9b25a2627ff6f4e10d46b4de4fff941b63497c7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:01:17 2019 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 11 Apr 2019 00:01:17 +0000 Subject: [issue36592] is behave different for integers in 3.6 and 3.7 In-Reply-To: <1554940525.0.0.506385110502.issue36592@roundup.psfhosted.org> Message-ID: <1554940877.8.0.946429557233.issue36592@roundup.psfhosted.org> Eric V. Smith added the comment: Python makes no guarantee as to whether an identity test on integers would return True or False. You should not depend on the behavior in any particular version. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:04:16 2019 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 11 Apr 2019 00:04:16 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? Message-ID: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> New submission from Ned Batchelder : In Python 3.7.3, having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. I know, this sounds unlikely... $ cat traced_sscce.py # sscce.py import sys def trace(frame, event, arg): return trace if len(sys.argv) > 1: sys.settrace(trace) from unittest.mock import MagicMock class A: pass m = MagicMock(spec=A) print("isinstance: ", isinstance(m, A)) $ python3.7.2 traced_sscce.py isinstance: True $ python3.7.2 traced_sscce.py 1 isinstance: True $ python3.7.2 -VV Python 3.7.2 (default, Feb 17 2019, 16:54:12) [Clang 10.0.0 (clang-1000.10.44.4)] $ python3.7.3 traced_sscce.py isinstance: True $ python3.7.3 traced_sscce.py 1 isinstance: False $ python3.7.3 -VV Python 3.7.3 (default, Apr 10 2019, 10:27:53) [Clang 10.0.0 (clang-1000.10.44.4)] Note that if you move the mock import to before the settrace call, everything works fine. ---------- components: Library (Lib) files: traced_sscce.py messages: 339903 nosy: nedbat priority: normal severity: normal status: open title: Trace function interferes with MagicMock isinstance? versions: Python 3.7 Added file: https://bugs.python.org/file48260/traced_sscce.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:06:03 2019 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 11 Apr 2019 00:06:03 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554941163.0.0.119988640676.issue36593@roundup.psfhosted.org> Ned Batchelder added the comment: This also affects Python 3.8.0a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:06:11 2019 From: report at bugs.python.org (Shane) Date: Thu, 11 Apr 2019 00:06:11 +0000 Subject: [issue36592] is behave different for integers in 3.6 and 3.7 In-Reply-To: <1554940525.0.0.506385110502.issue36592@roundup.psfhosted.org> Message-ID: <1554941171.71.0.497016305569.issue36592@roundup.psfhosted.org> Shane added the comment: This is the sort of thing that makes me avoid "is" in favor of "==" for most applications. Understanding when two objects point to the same memory requires a deeper understanding of the underlying code than I usually want to delve into. Anyway, I find it interesting that for 3.7.3: >>> a, b = 256, 256 >>> a is b True >>> a, b = 257, 257 >>> a is b False So 2**8 is a magic number, for whatever reason. I'll be sticking with "=="... ---------- nosy: +Shane Smith -eric.smith type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:06:16 2019 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 11 Apr 2019 00:06:16 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554941176.58.0.994904580126.issue36593@roundup.psfhosted.org> Change by Ned Batchelder : ---------- keywords: +3.7regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:07:20 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 00:07:20 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554941240.25.0.121495373459.issue36593@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:10:57 2019 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 11 Apr 2019 00:10:57 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings Message-ID: <1554941457.39.0.484149638582.issue36594@roundup.psfhosted.org> Change by Zackery Spytz : ---------- components: Extension Modules, Interpreter Core nosy: ZackerySpytz priority: normal severity: normal status: open title: Undefined behavior due to incorrect usage of %p in format strings versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:12:01 2019 From: report at bugs.python.org (Shane) Date: Thu, 11 Apr 2019 00:12:01 +0000 Subject: [issue36595] Text Search in Squeezed Output Viewer Message-ID: <1554941521.08.0.779423976753.issue36595@roundup.psfhosted.org> New submission from Shane : Would it be possible to enhance IDLE's new Squeezed Output Viewer (which I LOVE, btw), with a text search feature? If I'm in a module's help documentation, I'm usually looking for something, and I often end up copying the text into notepad and searching for it there. Seems like text search would be a useful feature. Thanks for reading, ---------- assignee: terry.reedy components: IDLE messages: 339906 nosy: Shane Smith, terry.reedy priority: normal severity: normal status: open title: Text Search in Squeezed Output Viewer type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:14:02 2019 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 11 Apr 2019 00:14:02 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings Message-ID: <1554941642.48.0.810913327773.issue36594@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12698 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:14:26 2019 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 11 Apr 2019 00:14:26 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings Message-ID: <1554941666.55.0.100758767166.issue36594@roundup.psfhosted.org> New submission from Zackery Spytz : The attached PR fixes incorrect usages of %p in format strings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:19:37 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 00:19:37 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554941977.12.0.0365608572993.issue36593@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: There are very few changes to mock.py on bisecting with the example in the report is d358a8cda75446a8e0b5d99149f709395d5eae19 the problem? I am surprised by the reason this commit leads to change in behavior with set trace. ? cpython git:(master) ? cat ../backups/bpo36593.py import sys def trace(frame, event, arg): return trace if len(sys.argv) > 1: sys.settrace(trace) from unittest.mock import MagicMock class A: pass m = MagicMock(spec=A) print("isinstance: ", isinstance(m, A)) ? cpython git:(master) ? git checkout d358a8cda75446a8e0b5d99149f709395d5eae19 Lib/unittest/mock.py ? cpython git:(master) ? ./python.exe ../backups/bpo36593.py 1 isinstance: False ? cpython git:(master) ? git checkout d358a8cda75446a8e0b5d99149f709395d5eae19~1 Lib/unittest/mock.py ? cpython git:(master) ? ./python.exe ../backups/bpo36593.py 1 isinstance: True commit d358a8cda75446a8e0b5d99149f709395d5eae19 Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Mon Jan 21 01:37:54 2019 -0800 bpo-20239: Allow repeated deletion of unittest.mock.Mock attributes (GH-11629) * Allow repeated deletion of unittest.mock.Mock attributes * fixup! Allow repeated deletion of unittest.mock.Mock attributes * fixup! fixup! Allow repeated deletion of unittest.mock.Mock attributes (cherry picked from commit 222d303ade8aadf0adcae5190fac603bdcafe3f0) Co-authored-by: Pablo Galindo ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:21:17 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 00:21:17 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings In-Reply-To: <1554941666.55.0.100758767166.issue36594@roundup.psfhosted.org> Message-ID: <1554942077.39.0.574278749642.issue36594@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:30:28 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 00:30:28 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554942628.57.0.616952219107.issue36593@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: On an initial guess this is the change that went through and using object.__delattr__(self, name) instead of super().__delattr__(name) restores the old behavior and there are no test case failures. But I still have to check the change and how it's related to set trace. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 955af5d2b8..42fbc22e74 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -728,11 +728,10 @@ class NonCallableMock(Base): # not set on the instance itself return - if name in self.__dict__: - object.__delattr__(self, name) - obj = self._mock_children.get(name, _missing) - if obj is _deleted: + if name in self.__dict__: + super().__delattr__(name) + elif obj is _deleted: raise AttributeError(name) if obj is not _missing: del self._mock_children[name] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:35:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 00:35:15 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554942915.5.0.508268423959.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: I modified my PR to reuse tp_traverse. Inada-san: would you mind to review my change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 20:40:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 00:40:40 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554943240.57.0.77299235005.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: Do you think that a gc.is_object_debugger_enabled() function would be needed? The tracemalloc module has 3 functions: * start(), stop() * is_tracing() The faulthandler module has 3 functions: * enable() / disable() * is_enabled() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 21:07:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 01:07:51 +0000 Subject: [issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set In-Reply-To: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> Message-ID: <1554944871.55.0.822526622596.issue36235@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 21:13:03 2019 From: report at bugs.python.org (Alex LordThorsen) Date: Thu, 11 Apr 2019 01:13:03 +0000 Subject: [issue22377] %Z in strptime doesn't match EST and others In-Reply-To: <1410301455.57.0.912701656833.issue22377@psf.upfronthosting.co.za> Message-ID: <1554945183.9.0.539572207698.issue22377@roundup.psfhosted.org> Alex LordThorsen added the comment: It's been a while since I've committed a patch. Do I still upload a diff file here or should I open a PR for the doc changes on github? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 21:31:17 2019 From: report at bugs.python.org (Geraldo Xexeo) Date: Thu, 11 Apr 2019 01:31:17 +0000 Subject: [issue36592] is behave different for integers in 3.6 and 3.7 In-Reply-To: <1554940525.0.0.506385110502.issue36592@roundup.psfhosted.org> Message-ID: <1554946277.94.0.0104096098176.issue36592@roundup.psfhosted.org> Geraldo Xexeo added the comment: "So 2**8 is a magic number, for whatever reason." Actually, this is true. Accordingly to https://rushter.com/blog/python-integer-implementation/ "Optimization of commonly-used integers Small integer objects in a range of -5 to 256 are always pre-allocated during initialization. Because Python integers are immutable, we can use them as singletons. Every time you need to create small integer instead of creating new object Python just points to already allocated one. Thereby it saves a lot of space and computation for commonly-used integers. Interestingly enough, the PyLongObject structure takes at least 28 bytes for every allocated integer and therefore takes three times as much memory as a simple 64-bit C integer." This are constants #define NSMALLPOSINTS 257 #define NSMALLNEGINTS 5 You can find the code in: https://github.com/python/cpython/blob/master/Objects/longobject.c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 21:52:59 2019 From: report at bugs.python.org (Shane) Date: Thu, 11 Apr 2019 01:52:59 +0000 Subject: [issue36592] is behave different for integers in 3.6 and 3.7 In-Reply-To: <1554940525.0.0.506385110502.issue36592@roundup.psfhosted.org> Message-ID: <1554947579.59.0.879556060857.issue36592@roundup.psfhosted.org> Shane added the comment: Well, then I guess that explains it! Still, like I said, I tend to shy away from features that require such a deep understanding of the implementation in order to avoid "gotchas". "is" does have its uses, but for me they very very rarely come up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:07:20 2019 From: report at bugs.python.org (Chris Siebenmann) Date: Thu, 11 Apr 2019 02:07:20 +0000 Subject: [issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file Message-ID: <1554948440.07.0.28828566641.issue36596@roundup.psfhosted.org> New submission from Chris Siebenmann : The easiest reproduction of this is: import tarfile tarfile.open("/dev/zero", "r:") (If you use plain "r" you get a hang in attempted lzma decoding.) I believe this is probably due to a missing 'elif self.offset == 0:' in the 'except EOFHeaderError' exception handling case that almost all of the other exception handlers have. This appears to be a very long standing issue based on the history of the code. ---------- components: Library (Lib) messages: 339915 nosy: cks priority: normal severity: normal status: open title: tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:07:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 02:07:46 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554948466.01.0.195134855763.issue36389@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:16:39 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 02:16:39 +0000 Subject: [issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file In-Reply-To: <1554948440.07.0.28828566641.issue36596@roundup.psfhosted.org> Message-ID: <1554948999.15.0.026899162836.issue36596@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lars.gustaebel, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:18:16 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 02:18:16 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554949096.32.0.276665636387.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: bpo-33803 bug can be reintroduced using the following patch: diff --git a/Python/hamt.c b/Python/hamt.c index 67af04c437..67da8ec22c 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -2478,8 +2478,10 @@ hamt_alloc(void) if (o == NULL) { return NULL; } +#if 0 o->h_count = 0; o->h_root = NULL; +#endif o->h_weakreflist = NULL; PyObject_GC_Track(o); return o; And then run: ./python -m test -v test_context The best would be to also be able to catch the bug in: ./python -m test -v test_asyncio Problem: Right now, my GC object debugger implementation is way too slow to use a threshold lower than 100, whereas the bug is catched like "immediately" using gc.set_threshold(5). Maybe my implementation should be less naive: rather than always check *all* objects tracked by the GC, have different thresholds depending on the generation? Maybe reuse GC thresholds? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:25:09 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 11 Apr 2019 02:25:09 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554949509.32.0.171260352972.issue33722@roundup.psfhosted.org> Terry J. Reedy added the comment: My *guess* is that you created the branch for PR 7491 when your local master branch was months out of date. Or you branched off of the 3.7 branch. Whatever, your patch proposed to revert recent changes to master, touching about 1000 files. When you pushed the button on the github web page to compare and possibly make a PR, you should have seen a list of +- 1000 changes in the proposed PR, closed the window, deleted the branch on the fork and your repository, and started over with a new branch from freshly updated master. You are right that the review requests were automatic. However, I am not sure how the 6 month delay factors into what happened. Since Guido closed the PR rather than suggest fixing it further, I suggest that you start over as suggested above and look closely before pressing 'Create PR'. It appears that you already deleted the branch from the fork. >From my limited knowledge of how to use unitest.mock correctly, I agree that the example looks plausible. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:41:32 2019 From: report at bugs.python.org (Jay Crotts) Date: Thu, 11 Apr 2019 02:41:32 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554950492.98.0.327858288054.issue33722@roundup.psfhosted.org> Jay Crotts added the comment: Yeah the PR had been stale for a while, and I re-based my fork without closing the PR, so when I pushed it to the fork it updated the PR reviewer list. Silly mistake by me, I should have made sure the diff wasn't huge before pushing it. I know review time is valuable and did not mean to waste it. If you think it is a worthwhile change I'm happy to start over with another PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:49:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 02:49:25 +0000 Subject: [issue36597] Travis CI: doctest failure Message-ID: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> New submission from STINNER Victor : On my https://github.com/python/cpython/pull/12770 the doctest job of Travis CI failed with: https://travis-ci.org/python/cpython/jobs/518572326 mkdir -p build Building NEWS from Misc/NEWS.d with blurb PATH=./venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D latex_elements.papersize= -q -W -j4 -W . build/doctest /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) /home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead. env.note_versionchange('deprecated', version[0], node, self.lineno) Warning, treated as error: ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m.one().two().three() Expected: Got: obj dead or exiting Makefile:44: recipe for target 'build' failed make[1]: *** [build] Error 2 -- I can reproduce this issue on Linux with: $ cd Doc $ make venv $ PATH=./venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D latex_elements.papersize= -q -W -j4 -W . build/doctest I get random errors: Warning, treated as error: ********************************************************************** File "library/datetime.rst", line 686, in default Failed example: d.strftime("%A %d. %B %Y") Expected: 'Monday 11. March 2002' Got: 'lundi 11. mars 2002' Warning, treated as error: ********************************************************************** File "library/collections.rst", line 914, in default Failed example: p._asdict() Expected: {'x': 11, 'y': 22} Got: OrderedDict([('x', 11), ('y', 22)]) Warning, treated as error: ********************************************************************** File "library/unittest.mock.rst", line ?, in default Failed example: mock.call_args.args Expected: (3, 4) Got: args The virtual environment uses Sphinx 2.0.1. Can it be a change in Sphinx 2 default configuration? ---------- assignee: docs at python components: Documentation messages: 339919 nosy: docs at python, vstinner priority: normal severity: normal status: open title: Travis CI: doctest failure versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:50:22 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 11 Apr 2019 02:50:22 +0000 Subject: [issue36595] IDLE: Add search to Squeezed Output text viewer. In-Reply-To: <1554941521.08.0.779423976753.issue36595@roundup.psfhosted.org> Message-ID: <1554951022.92.0.578420477246.issue36595@roundup.psfhosted.org> Terry J. Reedy added the comment: I agree. The Squeezed Output Viewer is an instance of idlelib.textview.ViewWindow. The latter is for read-only text and is also used for the text displays invoked from About IDLE. I have already thought about making the text searchable. Seaching does not require that the text be editable. An initial implementatation might be a [Search] button that opens the current search dialog linked to the text in the window. ---------- stage: -> test needed title: Text Search in Squeezed Output Viewer -> IDLE: Add search to Squeezed Output text viewer. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 22:55:13 2019 From: report at bugs.python.org (josephshi@yahoo.com) Date: Thu, 11 Apr 2019 02:55:13 +0000 Subject: [issue35324] ssl: FileNotFoundError when do handshake In-Reply-To: <1543300721.51.0.788709270274.issue35324@psf.upfronthosting.co.za> Message-ID: <1554951313.98.0.24183362774.issue35324@roundup.psfhosted.org> josephshi at yahoo.com added the comment: i am sorry. seems I am wrong. the openssl underlying do not the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 23:02:00 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 03:02:00 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554951720.49.0.189930273906.issue36597@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 23:05:49 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 03:05:49 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554951949.96.0.0366063068625.issue33722@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The example looks like a good addition to me since mocking builtins.open is not documented for this use case. Please start a new PR. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 10 23:19:38 2019 From: report at bugs.python.org (Jay Crotts) Date: Thu, 11 Apr 2019 03:19:38 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554952778.58.0.553807392939.issue33722@roundup.psfhosted.org> Change by Jay Crotts : ---------- pull_requests: +12700 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 00:12:58 2019 From: report at bugs.python.org (Gregory Ronin) Date: Thu, 11 Apr 2019 04:12:58 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable Message-ID: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> New submission from Gregory Ronin : In mock.py, in method: def _mock_call(_mock_self, *args, **kwargs): There is a following piece of code: if not _callable(effect): result = next(effect) if _is_exception(result): raise result if result is DEFAULT: result = self.return_value return result ret_val = effect(*args, **kwargs) This works correctly for iterables (such as lists) that are not defined as generators. However, if one defined a generator as a function this would not work. It seems like the check should be not for callable, but for iterable: try: iter(effect) except TypeError: # If not iterable then callable or exception if _callable(effect): ret_val = effect(*args, **kwargs) else: raise effect else: # Iterable result = next(effect) if _is_exception(result): raise result if result is DEFAULT: result = self.return_value return result ---------- components: Tests messages: 339923 nosy: jazzblue priority: normal severity: normal status: open title: mock side_effect should be checked for iterable not callable type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 00:17:59 2019 From: report at bugs.python.org (Ram Rachum) Date: Thu, 11 Apr 2019 04:17:59 +0000 Subject: [issue22377] %Z in strptime doesn't match EST and others In-Reply-To: <1410301455.57.0.912701656833.issue22377@psf.upfronthosting.co.za> Message-ID: <1554956279.11.0.347316539534.issue22377@roundup.psfhosted.org> Change by Ram Rachum : ---------- nosy: -cool-RR _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 00:37:25 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 11 Apr 2019 04:37:25 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554957445.84.0.852140949296.issue33722@roundup.psfhosted.org> Terry J. Reedy added the comment: After looking at the context of the patch and thinking more about whether the patch is a good idea, I am reversing what I said before and think that this issue and the new patch (sorry) should be closed. 1. The new example duplicates the current example. The only difference is that one module name,'__main__', is replaced with another, 'builtins'. Mechanically, there is no difference, so the duplicate adds nothing. 2. The current example, contrary to the claim, "'__main__'.open is replaced", adds .open to __main__ and thereby masks builtins.open in, and only in, __main__. In use, '__main__' in all the current doc examples should be replaced by the name of the module where open is called. This would usually, but not necessarily, be the module being tested. This is explained in the section on where to patch. 3. Touching builtins is generally a bad idea unless one really understands and wants to affect *all* modules in the process, including the test code and unittest code. Beginners should *not* be encouraged to do this. If one replaces a builtin needed by test code or other untested mdoules before the replacement is undone, one disables the test code. The real problem, if any, with the mock examples, is that they usually do everything in one module (usually __main__) while real use involves code and execution in at least two modules. Users are left to work out which examples lines belong in text_xyz, which would be in xyz, and what essential code is missing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 00:43:05 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 11 Apr 2019 04:43:05 +0000 Subject: [issue36595] IDLE: Add search to Squeezed Output text viewer. In-Reply-To: <1554941521.08.0.779423976753.issue36595@roundup.psfhosted.org> Message-ID: <1554957785.31.0.840514883768.issue36595@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 01:32:52 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 05:32:52 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable In-Reply-To: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> Message-ID: <1554960772.5.0.154290604221.issue36598@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak versions: +Python 3.8 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 01:38:20 2019 From: report at bugs.python.org (Jay Crotts) Date: Thu, 11 Apr 2019 05:38:20 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554961100.34.0.22301856421.issue33722@roundup.psfhosted.org> Jay Crotts added the comment: No worries, I think all of your points make sense, especially number one after looking at the patch again. I looked at the docs again, and there is even an example of another built in being patched. Thanks for taking the time to review it. I'm okay with closing it if you don't think there is any value add. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 01:41:21 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 05:41:21 +0000 Subject: [issue24116] --with-pydebug has no effect when the final python binary is compiled In-Reply-To: <1430637278.73.0.597162622661.issue24116@psf.upfronthosting.co.za> Message-ID: <1554961281.87.0.264621450837.issue24116@roundup.psfhosted.org> Inada Naoki added the comment: gcc is not compiler, but linker when `-o python`. So LDFLAGS is used instead of CFLAGS. I don't think we can document and maintain all configure & make behavior. I'm +1 on close this. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 02:07:46 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 06:07:46 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable In-Reply-To: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> Message-ID: <1554962866.96.0.46550401377.issue36598@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I am not sure if the snippets you are referring to are from testing-cabal/mock repo which could be different from master branch. Current code is at [0] if effect is not None: if _is_exception(effect): raise effect elif not _callable(effect): result = next(effect) if _is_exception(result): raise result else: result = effect(*args, **kwargs) if result is not DEFAULT: return result > This works correctly for iterables (such as lists) that are not defined as generators. However, if one defined a generator as a function this would not work. This does seem to work for generator function as below. Sorry, maybe I am getting it wrong with respect to terminologies and understanding the issue. Can you add a short script around what you are expecting? $ cat ../backups/bpo36598.py from unittest.mock import patch def gen(i): while i < 5: yield i i += 1 def foo(): return 1 with patch('__main__.foo', side_effect=gen(0)): for _ in range(2): print(foo()) for _ in range(2): print(foo()) $ ./python.exe ../backups/bpo36598.py 0 1 2 3 [0] https://github.com/python/cpython/blob/a9bd8925c7fa50dd3cfab125b824ec192133ef49/Lib/unittest/mock.py#L1043 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 02:11:39 2019 From: report at bugs.python.org (Jay Crotts) Date: Thu, 11 Apr 2019 06:11:39 +0000 Subject: [issue33722] Document builtins in mock_open In-Reply-To: <1527791734.24.0.682650639539.issue33722@psf.upfronthosting.co.za> Message-ID: <1554963099.6.0.201092223755.issue33722@roundup.psfhosted.org> Change by Jay Crotts : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 02:21:37 2019 From: report at bugs.python.org (Michal) Date: Thu, 11 Apr 2019 06:21:37 +0000 Subject: [issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses In-Reply-To: <1537799403.03.0.956365154283.issue34788@psf.upfronthosting.co.za> Message-ID: <1554963697.93.0.855812160841.issue34788@roundup.psfhosted.org> Michal added the comment: I would like to fix this problem if nobody is against that. I stumbled upon the very same thing recently and I think it would be a nice opportunity to contribute. ---------- nosy: +mic4ael _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 02:24:50 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 06:24:50 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1554963890.01.0.974517456225.issue27860@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 02:56:45 2019 From: report at bugs.python.org (Ben Creasy) Date: Thu, 11 Apr 2019 06:56:45 +0000 Subject: [issue13282] the table of contents in epub file is too long In-Reply-To: <1319796506.79.0.347343158897.issue13282@psf.upfronthosting.co.za> Message-ID: <1554965805.73.0.459177369255.issue13282@roundup.psfhosted.org> Change by Ben Creasy : ---------- nosy: +jcrben _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 02:58:49 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 06:58:49 +0000 Subject: [issue36416] bytes.rpartition bug in online documentation In-Reply-To: <1553437427.15.0.469399643284.issue36416@roundup.psfhosted.org> Message-ID: <1554965929.78.0.931326689171.issue36416@roundup.psfhosted.org> Inada Naoki added the comment: New changeset efc48701496ef020e896fc6a91af3c0c612ac69a by Inada Naoki (pewscorner) in branch 'master': bpo-36416: Correct bytes.rpartition documentation (GH-12543) https://github.com/python/cpython/commit/efc48701496ef020e896fc6a91af3c0c612ac69a ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:03:19 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 07:03:19 +0000 Subject: [issue36580] unittest.mock does not understand dataclasses In-Reply-To: <1554844113.82.0.464270307904.issue36580@roundup.psfhosted.org> Message-ID: <1554966199.33.0.170702792567.issue36580@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Below is a even more simpler reproducer without dataclasses. 'name' is not listed as a class attribute in dir(Person) since it's not defined with a value but 'age' is with zero. Python seems to not to list something not defined with a value in declaration as a class attribute in dir(). Hence 'name' is not copied when Person is used as spec. spec only does attribute access validation. autospeccing [0] can be used for signature validation. The fields for dataclasses are defined in __dataclass_fields__ but I am not sure of special casing copying __dataclass_fields__ fields along with dir for dataclasses when normal Python doesn't list them as class attributes. If needed I would like dir(dataclass) to be changed to include __dataclass_fields__. I would propose closing as not a bug. # ../backups/dataclass_dir.py from unittest.mock import Mock class Person: name: str age: int = 0 def foo(self): pass person_mock = Mock(spec=Person) print(dir(Person)) print(dir(person_mock)) person_mock.foo print("age" in dir(person_mock)) print("name" in dir(person_mock)) $ cpython git:(master) ./python.exe ../backups/dataclass_dir.py ['__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'age', 'foo'] ['__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'age', 'assert_any_call', 'assert_called', 'assert_called_once', 'assert_called_once_with', 'assert_called_with', 'assert_has_calls', 'assert_not_called', 'attach_mock', 'call_args', 'call_args_list', 'call_count', 'called', 'configure_mock', 'foo', 'method_calls', 'mock_add_spec', 'mock_calls', 'reset_mock', 'return_value', 'side_effect'] True False [0] https://docs.python.org/3/library/unittest.mock.html#autospeccing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:05:55 2019 From: report at bugs.python.org (Ben Creasy) Date: Thu, 11 Apr 2019 07:05:55 +0000 Subject: [issue13282] the table of contents in epub file is too long In-Reply-To: <1319796506.79.0.347343158897.issue13282@psf.upfronthosting.co.za> Message-ID: <1554966355.51.0.256011114889.issue13282@roundup.psfhosted.org> Ben Creasy added the comment: Not sure if this is filed elsewhere, but the contents on the page at https://docs.python.org/3/contents.html could really use a collapse button, and could start automatically collapsed. The first half of the page is "What's new" for the past few Python versions and the Changelog. I looked around for an issue in the upstream tracker and didn't see one https://github.com/sphinx-doc/sphinx/issues - I don't know much about Sphinx but it seems like it should be possible with a bit of Javascript and CSS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:14:24 2019 From: report at bugs.python.org (Carl Harris) Date: Thu, 11 Apr 2019 07:14:24 +0000 Subject: [issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file In-Reply-To: <1554948440.07.0.28828566641.issue36596@roundup.psfhosted.org> Message-ID: <1554966864.69.0.959711844607.issue36596@roundup.psfhosted.org> Change by Carl Harris : ---------- nosy: +hitbox _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:25:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:25:37 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554967537.9.0.399048164685.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: Well, same problem with Sphinx 1.8.5. No idea why the job started to fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:30:00 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:30:00 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554967800.35.0.61297134796.issue36597@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12702 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:33:36 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 07:33:36 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: On Thu, Apr 11, 2019 at 11:49 AM STINNER Victor wrote: > > File "library/unittest.mock-examples.rst", line ?, in default > Failed example: > m.one().two().three() > Expected: > > Got: > obj dead or exiting > I'm not sure where "obj is dead or exiting" came from. > File "library/datetime.rst", line 686, in default > Failed example: > d.strftime("%A %d. %B %Y") > Expected: > 'Monday 11. March 2002' > Got: > 'lundi 11. mars 2002' It seems it is caused by non English locale. > File "library/collections.rst", line 914, in default > Failed example: > p._asdict() > Expected: > {'x': 11, 'y': 22} > Got: > OrderedDict([('x', 11), ('y', 22)]) You may run doctest with existing Python, not Python 3.8. > File "library/unittest.mock.rst", line ?, in default > Failed example: > mock.call_args.args > Expected: > (3, 4) > Got: > args I'm not sure about this. -- Inada Naoki ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:36:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:36:33 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554968193.44.0.8029488405.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: > It seems it is caused by non English locale. Right, but why did it start to fail since yesterday? > You may run doctest with existing Python, not Python 3.8. I used the command from the .travis.yml job: "... make -C Doc/ PYTHON=../python "...". It explicitly picks the Python it just compiled. Why would we like to check the doctests using a random Python version, whereas it's Python 3.8 documentation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:46:22 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:46:22 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554968782.82.0.07117297106.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: 8 hours ago, the job still passed at the top of the the master branch (commit a9bd8925c7fa50dd3cfab125b824ec192133ef49): https://travis-ci.org/python/cpython/jobs/518281237 "Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 Pygments-2.3.1 Sphinx-2.0.1 alabaster-0.7.12 babel-2.6.0 blurb-1.0.7 certifi-2019.3.9 chardet-3.0.4 docutils-0.14 idna-2.8 imagesize-1.1.0 packaging-19.0 pyparsing-2.4.0 python-docs-theme-2018.7 pytz-2019.1 requests-2.21.0 six-1.12.0 snowballstemmer-1.2.1 sphinxcontrib-applehelp-1.0.1 sphinxcontrib-devhelp-1.0.1 sphinxcontrib-htmlhelp-1.0.1 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.2 sphinxcontrib-serializinghtml-1.1.3 urllib3-1.24.1" ... PATH=./venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D latex_elements.papersize= -q -W -j4 -W . build/doctest ... The command "xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W -j4" doctest" exited with 0. --- 6 hours ago, it failed: https://travis-ci.org/python/cpython/jobs/518572326 Successfully installed Jinja2-2.10.1 MarkupSafe-1.1.1 Pygments-2.3.1 Sphinx-2.0.1 alabaster-0.7.12 babel-2.6.0 blurb-1.0.7 certifi-2019.3.9 chardet-3.0.4 docutils-0.14 idna-2.8 imagesize-1.1.0 packaging-19.0 pyparsing-2.4.0 python-docs-theme-2018.7 pytz-2019.1 requests-2.21.0 six-1.12.0 snowballstemmer-1.2.1 sphinxcontrib-applehelp-1.0.1 sphinxcontrib-devhelp-1.0.1 sphinxcontrib-htmlhelp-1.0.1 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.2 sphinxcontrib-serializinghtml-1.1.3 urllib3-1.24.1 Warning, treated as error: (...) -- In the 2 builds, pip installed the the same Python modules versions. I compared the raw logs of the 2 builds. In short, they are the same. Maybe the job already failed previously, but only randomly? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:46:44 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 07:46:44 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554968193.44.0.8029488405.issue36597@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: > > It seems it is caused by non English locale. > > Right, but why did it start to fail since yesterday? Is it an error start to fail since yesterday? As far as reading your first report, this is happen only in your local environment. > > You may run doctest with existing Python, not Python 3.8. > > I used the command from the .travis.yml job: "... make -C Doc/ PYTHON=../python "...". It explicitly picks the Python it just compiled. This error is in your environment too. Maybe you re-used old venv? > > Why would we like to check the doctests using a random Python version, whereas it's Python 3.8 documentation? > Because it "doctest". Python behavior (repr) can be changed. Python 3.8 replaces some OrderedDict usage with regular dict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:46:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:46:57 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554968817.85.0.671891278716.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: New changeset adff01e81d291c698581eadd693caa43ae5c78ac by Victor Stinner in branch 'master': bpo-36597: Disable Travis CI doctest job (GH-12775) https://github.com/python/cpython/commit/adff01e81d291c698581eadd693caa43ae5c78ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:47:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:47:47 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554968867.25.0.414771293084.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: I mark this issue as a release blocker to not forget it. I disabled the Travis CI doctest job to repair the CI, but we have to investigate why it started to fail yesterday. ---------- nosy: +lukasz.langa priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:49:11 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 07:49:11 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554968951.38.0.076578067272.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: > As far as reading your first report, this is happen only in your local environment. See the beginning of my first message, the doctest prevents me to merge a PR. But I tested on the master branch without my change, and I get the same issue locally, and the issues seems to be unrelated to my change. """ On my https://github.com/python/cpython/pull/12770 the doctest job of Travis CI failed with: https://travis-ci.org/python/cpython/jobs/518572326 """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:54:13 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 07:54:13 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554969253.97.0.235164911398.issue36597@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: "Object dead or exiting" is a less frequent random error with doctest. I am not sure from where it occurs but occurs for different tests at different times and is overlooked in Travis since the next runs are fine. Sample old builds : https://travis-ci.org/python/cpython/jobs/517606752 https://travis-ci.org/python/cpython/jobs/510847596 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 03:57:50 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 07:57:50 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554969470.37.0.247721878812.issue36597@roundup.psfhosted.org> Inada Naoki added the comment: > See the beginning of my first message, the doctest prevents me to merge a PR. You did not show travis build link which failed other than "obj dead or exiting" error. Don't all other errors happened only on your environment? If no, please link to travis build link. As far as I can confirm now, only "obj dead or exiting" error is problem in Travis. > But I tested on the master branch without my change, and I get the same issue locally, and the issues seems to be unrelated to my change. I suspect your environment (locale and venv used to run doctest), not your changes. > """ > On my https://github.com/python/cpython/pull/12770 the doctest job of Travis CI failed with: > > https://travis-ci.org/python/cpython/jobs/518572326 > """ Only "obj dead or exiting" happened in the job. ---------- nosy: -xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:09:05 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 08:09:05 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554970145.46.0.958101520742.issue36597@roundup.psfhosted.org> Inada Naoki added the comment: https://github.com/python/cpython/blob/master/Doc/library/weakref.rst#finalizer-objects >>> obj = Object() >>> weakref.finalize(obj, print, "obj dead or exiting") #doctest:+ELLIPSIS >>> exit() #doctest:+SKIP obj dead or exiting Note that "#doctest:+SKIP". print("obj dead or exiting") is called after weakref test. This may caused random doctest fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:15:40 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 08:15:40 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554970540.16.0.0625253591159.issue36597@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12703 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:19:16 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 08:19:16 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554970756.8.0.388766404616.issue36597@roundup.psfhosted.org> STINNER Victor added the comment: > You did not show travis build link which failed other than "obj dead or exiting" error. Really? When I click on https://travis-ci.org/python/cpython/jobs/518572326 (the second link of my first message), I still see: """ Warning, treated as error: ********************************************************************** File "library/unittest.mock-examples.rst", line ?, in default Failed example: m.one().two().three() Expected: Got: obj dead or exiting Makefile:44: recipe for target 'build' failed make[1]: *** [build] Error 2 """ This error comes from Travis CI. > I suspect your environment (locale and venv used to run doctest), not your changes. You can ignore the date failure, but how is the following error related to my environment? """ File "library/collections.rst", line 914, in default Failed example: p._asdict() Expected: {'x': 11, 'y': 22} Got: OrderedDict([('x', 11), ('y', 22)]) """ I used the same commands than .travis.yml. If we are unable to get the same environment than in Travis CI, we have a big problem. I agree to ignore the locale, this is a lower priority issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:21:59 2019 From: report at bugs.python.org (Michael Felt) Date: Thu, 11 Apr 2019 08:21:59 +0000 Subject: [issue28009] core logic of uuid.getnode() is broken for netstat In-Reply-To: <1473290315.48.0.840701308825.issue28009@psf.upfronthosting.co.za> Message-ID: <1554970919.81.0.905972310378.issue28009@roundup.psfhosted.org> Change by Michael Felt : ---------- pull_requests: +12704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:23:41 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 08:23:41 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554970756.8.0.388766404616.issue36597@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: On Thu, Apr 11, 2019 at 5:19 PM STINNER Victor wrote: > Really? When I click on https://travis-ci.org/python/cpython/jobs/518572326 (the second link of my first message), I still see: > > """ > Warning, treated as error: > ********************************************************************** > File "library/unittest.mock-examples.rst", line ?, in default > Failed example: > m.one().two().three() > Expected: > > Got: > obj dead or exiting > > Makefile:44: recipe for target 'build' failed > make[1]: *** [build] Error 2 > """ > > This error comes from Travis CI. It is "obj dead or exiting" error. I didn't say it is caused by your environment. It is only error happened in Travis. > > > I suspect your environment (locale and venv used to run doctest), not your changes. > > You can ignore the date failure, but how is the following error related to my environment? > > """ > File "library/collections.rst", line 914, in default > Failed example: > p._asdict() > Expected: > {'x': 11, 'y': 22} > Got: > OrderedDict([('x', 11), ('y', 22)]) namedtuple._asdict() changed to return dict instead of OrderedDict. If your venv is created before the change, this error can be happened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:25:16 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 08:25:16 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554971116.6.0.478602554454.issue36597@roundup.psfhosted.org> Inada Naoki added the comment: I think PR-12776 fixed "obj dead or exiting" error. https://travis-ci.org/python/cpython/jobs/518656385 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:53:53 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 08:53:53 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554972833.78.0.382160744574.issue36597@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 57b1a2862a99677f09614e9e456d36aae9ddd87c by Inada Naoki in branch 'master': bpo-36597: fix random doctest failure (GH-12776) https://github.com/python/cpython/commit/57b1a2862a99677f09614e9e456d36aae9ddd87c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 04:56:29 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 08:56:29 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554972989.08.0.659306565166.issue36597@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 05:15:14 2019 From: report at bugs.python.org (Remy Noel) Date: Thu, 11 Apr 2019 09:15:14 +0000 Subject: [issue36469] Stuck during interpreter exit, attempting to take the GIL In-Reply-To: <1553856319.46.0.350569249761.issue36469@roundup.psfhosted.org> Message-ID: <1554974114.54.0.553723378504.issue36469@roundup.psfhosted.org> Remy Noel added the comment: @eric.snow Unless you confirm there is no way to figure out which thread is/was holding the GIL from a debugging session on the running process, I'll get rid of it at the end of the week. Should i close the ticket then or will you do it ? Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 05:30:26 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 09:30:26 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554975026.75.0.988146103762.issue36597@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 05:33:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 09:33:30 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554975210.14.0.399253544309.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2b00db68554422ec37faba2a80179a0172df6349 by Victor Stinner in branch 'master': bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) https://github.com/python/cpython/commit/2b00db68554422ec37faba2a80179a0172df6349 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 05:45:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 09:45:56 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554975956.73.0.258860546905.issue36389@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 05:50:19 2019 From: report at bugs.python.org (=?utf-8?q?Anders_Hovm=C3=B6ller?=) Date: Thu, 11 Apr 2019 09:50:19 +0000 Subject: [issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub() In-Reply-To: <1513189718.03.0.213398074469.issue32308@psf.upfronthosting.co.za> Message-ID: <1554976219.9.0.668819128019.issue32308@roundup.psfhosted.org> Anders Hovm?ller added the comment: This was a really bad idea in my opinion. We just found this and we have no way to know how this will impact production. It's really absurd that re.sub('(.*)', r'foo', 'asd') is "foo" in python 1 to 3.6 but 'foofoo' in python 3.7. ---------- nosy: +Anders.Hovm?ller _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 05:57:04 2019 From: report at bugs.python.org (=?utf-8?q?Anders_Hovm=C3=B6ller?=) Date: Thu, 11 Apr 2019 09:57:04 +0000 Subject: [issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub() In-Reply-To: <1513189718.03.0.213398074469.issue32308@psf.upfronthosting.co.za> Message-ID: <1554976624.94.0.310816779046.issue32308@roundup.psfhosted.org> Anders Hovm?ller added the comment: Just as a comparison, sed does the 3.6 thing: > echo foo | sed 's/\(.*\)/x\1y/g' xfooy ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:05:39 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:05:39 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554977139.13.0.659112485895.issue36597@roundup.psfhosted.org> Inada Naoki added the comment: New changeset b3c92c6ae923ffb2b9ac5f80b28ecd689de48662 by Inada Naoki in branch 'master': bpo-36597: fix weakref example code (GH-12779) https://github.com/python/cpython/commit/b3c92c6ae923ffb2b9ac5f80b28ecd689de48662 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:11:10 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:11:10 +0000 Subject: [issue36599] weakref document says dict order is unstable Message-ID: <1554977470.77.0.948736759807.issue36599@roundup.psfhosted.org> New submission from Inada Naoki : https://docs.python.org/3/library/doctest.html#warnings "For example, when printing a dict, Python doesn?t guarantee that the key-value pairs will be printed in any particular order," This example should be rewritten with set. ---------- assignee: docs at python components: Documentation messages: 339952 nosy: docs at python, inada.naoki priority: normal severity: normal status: open title: weakref document says dict order is unstable versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:11:49 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:11:49 +0000 Subject: [issue36575] Use _PyTime_GetPerfCounter() in lsprof In-Reply-To: <1554816946.4.0.309099513597.issue36575@roundup.psfhosted.org> Message-ID: <1554977509.09.0.715378342507.issue36575@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 536a35b3f14888999f1ffa5be7239d0c26b73d7a by Inada Naoki in branch 'master': bpo-36575: lsprof: Use _PyTime_GetPerfCounter() (GH-8378) https://github.com/python/cpython/commit/536a35b3f14888999f1ffa5be7239d0c26b73d7a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:12:13 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:12:13 +0000 Subject: [issue36575] Use _PyTime_GetPerfCounter() in lsprof In-Reply-To: <1554816946.4.0.309099513597.issue36575@roundup.psfhosted.org> Message-ID: <1554977533.38.0.958566918458.issue36575@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:13:03 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 11 Apr 2019 10:13:03 +0000 Subject: [issue36416] bytes.rpartition bug in online documentation In-Reply-To: <1553437427.15.0.469399643284.issue36416@roundup.psfhosted.org> Message-ID: <1554977583.39.0.721814404318.issue36416@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:18:00 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:18:00 +0000 Subject: [issue36599] doctest document says dict order is unstable In-Reply-To: <1554977470.77.0.948736759807.issue36599@roundup.psfhosted.org> Message-ID: <1554977880.4.0.843378060624.issue36599@roundup.psfhosted.org> Change by Inada Naoki : ---------- title: weakref document says dict order is unstable -> doctest document says dict order is unstable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:18:50 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 11 Apr 2019 10:18:50 +0000 Subject: [issue36416] bytes.rpartition bug in online documentation In-Reply-To: <1553437427.15.0.469399643284.issue36416@roundup.psfhosted.org> Message-ID: <1554977930.8.0.31032325142.issue36416@roundup.psfhosted.org> miss-islington added the comment: New changeset 04b114eede82c7ffd7b3d9b40e8bf707780b022b by Miss Islington (bot) in branch '3.7': bpo-36416: Correct bytes.rpartition documentation (GH-12543) https://github.com/python/cpython/commit/04b114eede82c7ffd7b3d9b40e8bf707780b022b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:20:02 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:20:02 +0000 Subject: [issue36416] bytes.rpartition bug in online documentation In-Reply-To: <1553437427.15.0.469399643284.issue36416@roundup.psfhosted.org> Message-ID: <1554978002.84.0.687696990821.issue36416@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:34:58 2019 From: report at bugs.python.org (Marcin Niemira) Date: Thu, 11 Apr 2019 10:34:58 +0000 Subject: [issue36600] re-enable test in nntplib Message-ID: <1554978898.45.0.176655214392.issue36600@roundup.psfhosted.org> New submission from Marcin Niemira : Disabled test in not failing anymore. ```./python -m test -u all -v test_nntplib -m test_article_head_body == CPython 3.8.0a3+ (heads/feature/pep-572-improvement-in-smtplib-dirty:f4efa312d1, Apr 8 2019, 21:0) [GCC 7.3.0] == Linux-4.15.0-46-generic-x86_64-with-glibc2.26 little-endian == cwd: /home/n0npax/workspace/cpython/build/test_python_15162 == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 1.13 [1/1] test_nntplib test_article_head_body (test.test_nntplib.NetworkedNNTPTests) ... ok test_article_head_body (test.test_nntplib.NetworkedNNTP_SSLTests) ... ok ---------------------------------------------------------------------- Ran 2 tests in 7.172s OK == Tests result: SUCCESS == 1 test OK. Total duration: 7 sec 282 ms Tests result: SUCCESS ``` ---------- messages: 339955 nosy: Marcin Niemira priority: normal severity: normal status: open title: re-enable test in nntplib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:35:48 2019 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 11 Apr 2019 10:35:48 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554978948.74.0.417603393475.issue36593@roundup.psfhosted.org> Ned Batchelder added the comment: BTW, this started as a bug against coverage.py: https://github.com/nedbat/coveragepy/issues/795 There are some more details there, including the fact that it must be a Python trace function; a C trace function seems not to cause the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:37:55 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:37:55 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554979075.43.0.880008273669.issue36597@roundup.psfhosted.org> Inada Naoki added the comment: New changeset ac31da8f3710f9f9b8dbb4c36b2108fb1e5b4a48 by Inada Naoki in branch '3.7': bpo-36597: fix random doctest failure (GH-12778) https://github.com/python/cpython/commit/ac31da8f3710f9f9b8dbb4c36b2108fb1e5b4a48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:38:23 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 10:38:23 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554979103.35.0.338951172298.issue36389@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:38:43 2019 From: report at bugs.python.org (Marcin Niemira) Date: Thu, 11 Apr 2019 10:38:43 +0000 Subject: [issue36600] re-enable test in nntplib In-Reply-To: <1554978898.45.0.176655214392.issue36600@roundup.psfhosted.org> Message-ID: <1554979123.16.0.992675939407.issue36600@roundup.psfhosted.org> Change by Marcin Niemira : ---------- keywords: +patch pull_requests: +12710 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:38:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:38:52 +0000 Subject: [issue36597] Travis CI: doctest failure In-Reply-To: <1554950965.55.0.0913094506207.issue36597@roundup.psfhosted.org> Message-ID: <1554979132.48.0.304327732069.issue36597@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:40:13 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 11 Apr 2019 10:40:13 +0000 Subject: [issue36601] signals can be caught by any thread Message-ID: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> New submission from Jeroen Demeyer : Because of some discussion that is happening on #1583 I noticed this bit of code in the OS-level signal handler (set by the C function sigaction() or signal()): static void signal_handler(int sig_num) { /* See NOTES section above */ if (getpid() == main_pid) { trip_signal(sig_num); } The check getpid() == main_pid is claimed to check for the main *thread* but in fact it's checking the process ID, which is the same for all threads. So as far as I can tell, this condition is always true. This code essentially goes back to 1994 (commit bb4ba12242), so it may have been true at that time that threads were implemented as processes and that getpid() returned a different value for different threads. Note that this code refers to receiving a signal from the OS. In Python, it's always handled (by the function registered by signal.signal) by the main thread. But the current behaviour actually makes sense, so we should just remove the superfluous check and fix the comments in the code. ---------- messages: 339958 nosy: Rhamphoryncus, jdemeyer priority: normal severity: normal status: open title: signals can be caught by any thread _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:43:16 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 10:43:16 +0000 Subject: [issue32949] Simplify "with"-related opcodes In-Reply-To: <1519566194.29.0.467229070634.issue32949@psf.upfronthosting.co.za> Message-ID: <1554979396.85.0.59458890768.issue32949@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 06:59:34 2019 From: report at bugs.python.org (Laurie Opperman) Date: Thu, 11 Apr 2019 10:59:34 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir Message-ID: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> New submission from Laurie Opperman : Currently, 'pathlib.Path.iterdir' can only list the contents of the instance directory. It is common to also want the contents of subdirectories recursively. The proposal is for 'pathlib.Path.iterdir' to have an argument 'recursive' which when 'True' will cause 'iterdir' to yield contents of subdirectories recursively. This would be trivial to implement as 'iterdir' can simply yield from subdirectories' 'iterdir'. A decision would have to be made whether to continue to yield the subdirectories, or skip them. Another decision would be for whether each path should be resolved before checking if it is a directory to be recursed into. ---------- components: Library (Lib) messages: 339959 nosy: Epic_Wink priority: normal severity: normal status: open title: Recursive directory list with pathlib.Path.iterdir type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:00:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 11:00:27 +0000 Subject: [issue34060] regrtest: log "CPU usage" on Windows In-Reply-To: <1530892869.55.0.56676864532.issue34060@psf.upfronthosting.co.za> Message-ID: <1554980427.53.0.184620166911.issue34060@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:00:35 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 11 Apr 2019 11:00:35 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1554980435.66.0.386889497935.issue36601@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +12711 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:01:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 11:01:19 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554980479.63.0.0811321459479.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4c409beb4c360a73d054f37807d3daad58d1b567 by Victor Stinner in branch 'master': bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782) https://github.com/python/cpython/commit/4c409beb4c360a73d054f37807d3daad58d1b567 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:01:40 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 11 Apr 2019 11:01:40 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1554980500.93.0.453977354447.issue36601@roundup.psfhosted.org> Jeroen Demeyer added the comment: Also note that the documentation of the signal module already has the correct wording: Python signal handlers are always executed in the main Python thread, even if the signal was received in another thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:03:06 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 11 Apr 2019 11:03:06 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554980586.67.0.435845458449.issue1583@roundup.psfhosted.org> Jeroen Demeyer added the comment: > signalmodule.c has a hack to limit it to the main thread. The Python signal handler always runs in the main thread, but the signal can be caught by any thread. In other words, trip_signal() can be run by any thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:04:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 11:04:48 +0000 Subject: [issue1583] Patch for signal.set_wakeup_fd In-Reply-To: <1197328805.69.0.0206473945829.issue1583@psf.upfronthosting.co.za> Message-ID: <1554980688.56.0.85306821689.issue1583@roundup.psfhosted.org> STINNER Victor added the comment: Please don't discuss on closed issues. Either reopen the issue or open a new issue. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:12:24 2019 From: report at bugs.python.org (Roundup Robot) Date: Thu, 11 Apr 2019 11:12:24 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1554981144.5.0.517588608205.issue36602@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12712 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:14:06 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 11:14:06 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1554981246.39.0.636440730525.issue36593@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I think I got to this. See issue12370 (Use of super overwrites use of __class__ in class namespace) . msg138712 suggests a workaround to alias super at the module level. unittest.mock has the below line and NonCallableMock has __class__ defined as a property which is not set when set trace is used since the linked commit in 3.7.2 uses super() is somehow executed by settrace since it's in __delattr__ and not in a code path executed by user code? Looking at the unittest.mock code super is not used anywhere but _safe_super is used which I hope is for this reason. So this is not a case with MagicMock only but rather a case with anything that inherits from NonCallableMock i.e. Mock, MagicMock etc. This is not a problem with import being made before the trace is set as you mentioned so set trace does something that exposes this issue https://github.com/python/cpython/blob/536a35b3f14888999f1ffa5be7239d0c26b73d7a/Lib/unittest/mock.py#L48 # Workaround for issue #12370 # Without this, the __class__ properties wouldn't be set correctly _safe_super = super Sample program in issue12370. Add set trace SuperClass with using super() fails and passes without set trace for super(). Whereas SafeSuperClass that uses _safe_super (module level alias to super) passes both cases irrespective of usage of set trace. Nick coughlan added a message so that unittest.mock should use _safe_super in https://bugs.python.org/issue12370#msg161704 import sys _safe_super = super def trace(frame, event, arg): return trace if len(sys.argv) > 1: sys.settrace(trace) class SuperClass(object): def __init__(self): super().__init__() @property def __class__(self): return int class SafeSuperClass(object): def __init__(self): _safe_super(SafeSuperClass, self).__init__() @property def __class__(self): return int print(isinstance(SuperClass(), int)) print(isinstance(SafeSuperClass(), int)) Running above code with trace and without trace ? cpython git:(master) ? ./python.exe /tmp/buz.py True True ? cpython git:(master) ? ./python.exe /tmp/buz.py 1 False True There is a test for the above in Lib/test/test_super.py at https://github.com/python/cpython/blob/4c409beb4c360a73d054f37807d3daad58d1b567/Lib/test/test_super.py#L87 Add a trace as below in test_super.py at the top and the test case fails import sys def trace(frame, event, arg): return trace sys.settrace(trace) ? cpython git:(master) ? ./python.exe Lib/test/test_super.py ....................F ====================================================================== FAIL: test_various___class___pathologies (__main__.TestSuper) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_super.py", line 100, in test_various___class___pathologies self.assertEqual(x.__class__, 413) AssertionError: .X'> != 413 ---------------------------------------------------------------------- Ran 21 tests in 0.058s FAILED (failures=1) The patch for this issue would be to use _safe_super instead of super() or to fallback to object() in the previous case that doesn't seemed to have suffered from this case. I can try to make a PR with tests. Added Michael for confirmation. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 8684f1dfa5..0e77f0e489 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -739,7 +739,7 @@ class NonCallableMock(Base): obj = self._mock_children.get(name, _missing) if name in self.__dict__: - super().__delattr__(name) + _safe_super(NonCallableMock, self).__delattr__(name) elif obj is _deleted: raise AttributeError(name) if obj is not _missing: ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:17:23 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 11:17:23 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1554981443.63.0.522495629233.issue36602@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:21:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 11:21:06 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1554981666.27.0.124410540714.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: Patch making check on memory block leaks stricter: diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 235d6bfd3a..dfadabdef6 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -130,7 +130,7 @@ def dash_R(ns, the_module, test_name, test_func): failed = False for deltas, item_name, checker in [ (rc_deltas, 'references', check_rc_deltas), - (alloc_deltas, 'memory blocks', check_rc_deltas), + (alloc_deltas, 'memory blocks', check_fd_deltas), (fd_deltas, 'file descriptors', check_fd_deltas) ]: # ignore warmup runs Using this patch, at least the following tests fail: * test_asyncio * test_code * test_collections * test_contextlib * test_contextlib_async * test_ctypes * test_functools * test_multiprocessing_forkserver * test_multiprocessing_spawn * test_regrtest * test_statistics * test_typing * test_xml_etree_c I didn't analyze why yet. I guess that they are not real memory leaks, but more minor issue in the code checking for memory leaks. Sadly, it seems like such small glitch can cause a whole Refleak buildbot worker to fail :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:23:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 11:23:19 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554981799.14.0.456353746419.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: Currently, I'm using the following patch to try to detect bpo-33803 bug using my GC object debugger. It's still a work-in-progress. diff --git a/Lib/site.py b/Lib/site.py index ad1146332b..e184080b19 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -638,3 +638,8 @@ def _script(): if __name__ == '__main__': _script() + +if 'dev' in sys._xoptions: + import gc + gc.enable_object_debugger(100) + #gc.set_threshold(5) diff --git a/Python/hamt.c b/Python/hamt.c index 67af04c437..67da8ec22c 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -2478,8 +2478,10 @@ hamt_alloc(void) if (o == NULL) { return NULL; } +#if 0 o->h_count = 0; o->h_root = NULL; +#endif o->h_weakreflist = NULL; PyObject_GC_Track(o); return o; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:36:33 2019 From: report at bugs.python.org (Dave Page) Date: Thu, 11 Apr 2019 11:36:33 +0000 Subject: [issue35070] test_posix fails on macOS 10.14 Mojave In-Reply-To: <1540497129.89.0.788709270274.issue35070@psf.upfronthosting.co.za> Message-ID: <1554982593.63.0.388401437609.issue35070@roundup.psfhosted.org> Dave Page added the comment: I'm seeing what appears to my uneducated eyes to be the same failure on Mojave, on a brand new machine which is entirely standalone: 12:16:00 0:00:07 load avg: 4.24 [133/416/1] test_posix failed 12:16:00 test test_posix failed -- Traceback (most recent call last): 12:16:00 File "/Users/jenkins/workspace/python-macos-build/Python-3.7.2/Lib/test/test_posix.py", line 1026, in test_getgrouplist 12:16:00 self.assertIn(group, posix.getgrouplist(user, group)) 12:16:00 OSError: [Errno 25] Inappropriate ioctl for device 12:16:00 0:00:07 load avg: 4.24 [134/416/1] test_ast passed System info: pgabf-macos2:Python-3.7.2 jenkins$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.1 (clang-1001.0.46.3) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin pgabf-macos2:Python-3.7.2 jenkins$ system_profiler SPSoftwareDataType Software: System Software Overview: System Version: macOS 10.14.3 (18D42) Kernel Version: Darwin 18.2.0 Boot Volume: Macintosh HD Boot Mode: Normal Computer Name: pgabf-macos2 User Name: Jenkins (jenkins) Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 10 days 1:30 Happy to provide any additional info or try out patches if anyone wants. ---------- nosy: +Dave Page _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:42:28 2019 From: report at bugs.python.org (Joshua Root) Date: Thu, 11 Apr 2019 11:42:28 +0000 Subject: [issue34652] never enable lchmod on Linux In-Reply-To: <1536788618.14.0.956365154283.issue34652@psf.upfronthosting.co.za> Message-ID: <1554982948.06.0.125450662802.issue34652@roundup.psfhosted.org> Joshua Root added the comment: The follow-up fix (AC_CHECK_FUNC -> AC_CHECK_FUNCS) still needs to be backported to 2.7. Currently the lack of it causes lchmod to be disabled on all platforms, not just Linux. ---------- nosy: +jmr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 07:47:11 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 11 Apr 2019 11:47:11 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1554983231.33.0.97968000324.issue36602@roundup.psfhosted.org> SilentGhost added the comment: Is the behaviour you're proposing any different from using Path.rglob('*')? ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 08:46:46 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 12:46:46 +0000 Subject: [issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability In-Reply-To: <1542119446.33.0.788709270274.issue35232@psf.upfronthosting.co.za> Message-ID: <1554986806.28.0.243255738947.issue35232@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- type: -> enhancement versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 08:55:09 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 12:55:09 +0000 Subject: [issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x In-Reply-To: <1516595654.84.0.467229070634.issue32616@psf.upfronthosting.co.za> Message-ID: <1554987309.39.0.303437791081.issue32616@roundup.psfhosted.org> Inada Naoki added the comment: I'm using Mojave. I don't have regression. $ /usr/local/bin/python2 x.py # Homebrew python at 2 1.681729 $ /usr/bin/python x.py # System python2 1.891549 Could someone using High Sierra or Sierra test it? x.py is test script in https://bugs.python.org/issue32616#msg310395 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 08:59:21 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 12:59:21 +0000 Subject: [issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x In-Reply-To: <1516595654.84.0.467229070634.issue32616@psf.upfronthosting.co.za> Message-ID: <1554987561.94.0.191321981051.issue32616@roundup.psfhosted.org> Inada Naoki added the comment: https://github.com/Homebrew/homebrew-core/blob/b2aff6271caa04508fb1529fdd5edbb22f4e7f21/Formula/python%402.rb#L75-L82 Homebrew checks compiler version too. I don't think it's worth enough to add more code to avoid this trouble. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:03:31 2019 From: report at bugs.python.org (Antony Lee) Date: Thu, 11 Apr 2019 13:03:31 +0000 Subject: [issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability In-Reply-To: <1542119446.33.0.788709270274.issue35232@psf.upfronthosting.co.za> Message-ID: <1554987811.71.0.0616209474537.issue35232@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:10:39 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 13:10:39 +0000 Subject: [issue16712] collections.abc.Sequence should not provide __reversed__ In-Reply-To: <1355835361.63.0.373231585566.issue16712@psf.upfronthosting.co.za> Message-ID: <1554988239.28.0.89444345063.issue16712@roundup.psfhosted.org> Inada Naoki added the comment: I close this issue because Reversible ABC was added. It's sad that Sequnce.__reversed__ is just makes reversed() slow without any benefit. But removing it without breaking backward compatibility is not easy for now. ---------- resolution: -> wont fix stage: needs patch -> resolved status: open -> closed versions: +Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:18:54 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 13:18:54 +0000 Subject: [issue13927] Document time.ctime format In-Reply-To: <1328215776.48.0.974828105123.issue13927@psf.upfronthosting.co.za> Message-ID: <1554988734.44.0.165604116023.issue13927@roundup.psfhosted.org> Cheryl Sabella added the comment: I would like to help get this issue merged as it's already been approved by a core developer. Does anyone object to the change? Victor made a suggestion on the PR for alternative wording and I wanted to give others a chance to comment on that. Also, looking at the man page for asctime, they use `Www Mmm dd hh:mm:ss yyyy` as the description of the output. Maybe it would be helpful to add this since it shows the spacing and explicitly shows the day number taking up 2 characters? Thanks! ---------- nosy: +belopolsky, cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:20:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 13:20:50 +0000 Subject: [issue18697] Unify arguments names in Unicode object C API documentation In-Reply-To: <1376074126.58.0.40251146149.issue18697@psf.upfronthosting.co.za> Message-ID: <1554988850.39.0.903598859222.issue18697@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:45:34 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 13:45:34 +0000 Subject: [issue36378] Add support to load from paths to json.load In-Reply-To: <1553071458.39.0.659237706871.issue36378@roundup.psfhosted.org> Message-ID: <1554990334.0.0.668918067277.issue36378@roundup.psfhosted.org> Inada Naoki added the comment: I close this because PR is closed already, and same idea was discussed on -ideas ML. ---------- nosy: +inada.naoki resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:48:02 2019 From: report at bugs.python.org (Harmandeep Singh) Date: Thu, 11 Apr 2019 13:48:02 +0000 Subject: [issue13927] Document time.ctime format In-Reply-To: <1328215776.48.0.974828105123.issue13927@psf.upfronthosting.co.za> Message-ID: <1554990482.61.0.0757399432304.issue13927@roundup.psfhosted.org> Harmandeep Singh added the comment: This is not python compatible format, I want something like "%a %b %d %H:%M:%S %Y" to explain it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 09:56:22 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 11 Apr 2019 13:56:22 +0000 Subject: [issue2281] Enhanced cPython profiler with high-resolution timer In-Reply-To: <1205359008.42.0.436050296007.issue2281@psf.upfronthosting.co.za> Message-ID: <1554990982.21.0.944070768504.issue2281@roundup.psfhosted.org> Inada Naoki added the comment: I think https://bugs.python.org/issue36575 fixed this. ---------- nosy: +inada.naoki resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:02:32 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 11 Apr 2019 14:02:32 +0000 Subject: [issue36600] re-enable test in nntplib In-Reply-To: <1554978898.45.0.176655214392.issue36600@roundup.psfhosted.org> Message-ID: <1554991352.48.0.273639127678.issue36600@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Tests nosy: +vstinner type: -> behavior versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:05:12 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 11 Apr 2019 14:05:12 +0000 Subject: [issue22377] %Z in strptime doesn't match EST and others In-Reply-To: <1410301455.57.0.912701656833.issue22377@psf.upfronthosting.co.za> Message-ID: <1554991512.04.0.519505200081.issue22377@roundup.psfhosted.org> SilentGhost added the comment: PR on github, Alex ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:11:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 14:11:35 +0000 Subject: [issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1554991895.54.0.94447956682.issue18748@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12713 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:11:50 2019 From: report at bugs.python.org (Jeremy McMillan) Date: Thu, 11 Apr 2019 14:11:50 +0000 Subject: [issue34788] ipaddress module fails on rfc4007 scoped IPv6 addresses In-Reply-To: <1537799403.03.0.956365154283.issue34788@psf.upfronthosting.co.za> Message-ID: <1554991910.91.0.865080945307.issue34788@roundup.psfhosted.org> Jeremy McMillan added the comment: I think the code in SaltStack to handle scoped IPv6 addresses is mature, so please look at these examples. https://github.com/saltstack/salt/blob/2085cb1078f187adf82a0cf19b39d350ff1bbd50/salt/_compat.py#L125 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:13:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 14:13:42 +0000 Subject: [issue18748] libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1554992022.56.0.884465175523.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: I looked at this old issue. First of all, "bug.py" filename is accurate: this program contains a bug, but it's non-obvious. * the main thread opens a file which gets the file descriptor 3 * a new thread is spawns which indirectly closes this file descriptor on: sys.stdout.close() * the main thread is not aware that the file has been closed, and so will try to close the same file descriptor 3 sometime during Python shutdown * then, sometimes, the glibc fails with an internal error because the main thread closed a file descriptor which was just opened by the other thread to implement thread cancellation: that logs "libgcc_s.so.1 must be installed for pthread_cancel to work" and calls abort() Note: the Python file object remains alive until the "t" local variable is cleared, since "t.fh" contains a strong reference to the file object. Again: it's a bug in the program. "libgcc_s.so.1 must be installed for pthread_cancel to work" is just *one* example of bad thing that can happen. What can be do on the Python side? Well, stop to ignore silently I/O errors when a file is closed by its destructor. I wrote a shy PR 12786 to only log these exceptions in development mode (-X dev). I'm not sure if we could stop to silence these exceptions *by default*. Python has been modified last years to first raise an exception on I/O errors when file.close() is called explicitly, and then a similar change has been done for call to socket.socket.close(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:14:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 14:14:46 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1554992086.11.0.183459464104.issue18748@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: libgcc_s.so.1 must be installed for pthread_cancel to work -> io.IOBase destructor silence I/O error on close() by default _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:38:05 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 14:38:05 +0000 Subject: [issue13927] Document time.ctime format In-Reply-To: <1328215776.48.0.974828105123.issue13927@psf.upfronthosting.co.za> Message-ID: <1554993485.17.0.625458741911.issue13927@roundup.psfhosted.org> Cheryl Sabella added the comment: I guess what I'm thinking of `Www Mmm dd hh:mm:ss yyyy` as representing isn't so much a format, but rather a literal replacement of where each value has a placeholder in the string (that is, a pattern). So, even if `Www` doesn't mean anything, to me it means that the first three characters in the string are a Weekday, then there's a space, then Mmm is the month, then a space, then dd is the day number (with zero sometimes suppressed), etc. If that is more confusing than not using it, then that's fine. I just wanted to mention it. Using %d to me is also confusing since the docs define %d as `Day of the month as a decimal number [01,31]`. This clearly isn't using 01, but rather suppressing the 0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 10:47:18 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 14:47:18 +0000 Subject: [issue19770] NNTP: add post_message wrapper to post Email Message objects In-Reply-To: <1385382524.39.0.481766399265.issue19770@psf.upfronthosting.co.za> Message-ID: <1554994038.64.0.146994893403.issue19770@roundup.psfhosted.org> Cheryl Sabella added the comment: Thanks David! If someone is looking for an issue to work on, I'll keep this one in mind with the caveat that it won't be reviewed during the sprints. And if no one works on it at that time, then it might be a good first issue afterwards. I'm updating the title to reflect the request. ---------- stage: -> needs patch title: NNTP.post broken -> NNTP: add post_message wrapper to post Email Message objects type: behavior -> enhancement versions: +Python 3.8 -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:17:03 2019 From: report at bugs.python.org (cagney) Date: Thu, 11 Apr 2019 15:17:03 +0000 Subject: [issue36603] should pty.openpty() set pty/tty inheritable? Message-ID: <1554995823.59.0.731055677634.issue36603@roundup.psfhosted.org> New submission from cagney : pty.openpty(), on systems with a working os.openpty() / openpty(3) executes: if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) goto posix_error; if (_Py_set_inheritable(master_fd, 0, NULL) < 0) goto error; if (_Py_set_inheritable(slave_fd, 0, NULL) < 0) goto error; where as on systems where this is fails it instead executes: master_fd, slave_name = _open_terminal() slave_fd = slave_open(slave_name) i.e., result = os.open(tty_name, os.O_RDWR) return master_fd, slave_fd where os.open() was "Changed in version 3.4: The new file descriptor is now non-inheritable." (personally I'd deprecate pty.openpty(), but that is just me) ---------- components: IO messages: 339982 nosy: cagney priority: normal severity: normal status: open title: should pty.openpty() set pty/tty inheritable? versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:23:38 2019 From: report at bugs.python.org (Michael Felt) Date: Thu, 11 Apr 2019 15:23:38 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1554996218.47.0.519977583383.issue36588@roundup.psfhosted.org> Michael Felt added the comment: Was: root at x064:[/data/prj/python/python3-3.8]./python Python 3.8.0a3+ (heads/bpo-28009-2-dirty:2fb2bc81c3, Apr 11 2019, 07:09:55) [C] on aix6 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.platform 'aix6' >>> import os >>> os.uname()[3] '7' ./python ../git/python3-3.8/Tools/scripts/patchcheck.py Getting base branch for PR ... origin/master Getting the list of files that have been added/changed ... 6 files Fixing Python file whitespace ... 0 files Fixing C file whitespace ... 0 files Fixing docs whitespace ... 0 files Docs modified ... yes Misc/ACKS updated ... NO Misc/NEWS.d updated with `blurb` ... yes configure regenerated ... yes pyconfig.h.in regenerated ... no On system I built on: root at x066:[/data/prj/python/python3-3.8]./python Python 3.8.0a3+ (heads/bpo-36588-aix-platform-dirty:2021d40faa, Apr 11 2019, 15:16:05) [C] on aix Type "help", "copyright", "credits" or "license" for more information. >>> import os,sys >>> sys.platform 'aix' >>> os.uname()[3] '6' And on AIX7 system: root at x064:[/data/prj/python/python3-3.8]./python Python 3.8.0a3+ (heads/bpo-36588-aix-platform-dirty:2021d40faa, Apr 11 2019, 15:16:05) [C] on aix Type "help", "copyright", "credits" or "license" for more information. >>> import os,sys >>> sys.platform 'aix' >>> os.uname()[3] '7' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:26:13 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 11 Apr 2019 15:26:13 +0000 Subject: [issue36603] should pty.openpty() set pty/tty inheritable? In-Reply-To: <1554995823.59.0.731055677634.issue36603@roundup.psfhosted.org> Message-ID: <1554996373.12.0.94949453968.issue36603@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:27:40 2019 From: report at bugs.python.org (Michael Felt) Date: Thu, 11 Apr 2019 15:27:40 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1554996460.57.0.24088061955.issue36588@roundup.psfhosted.org> Change by Michael Felt : ---------- keywords: +patch pull_requests: +12714 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:47:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 15:47:51 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1554997671.75.0.497976981076.issue36389@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12715 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:53:30 2019 From: report at bugs.python.org (Bjorn Madsen) Date: Thu, 11 Apr 2019 15:53:30 +0000 Subject: [issue36604] Add recipe to itertools Message-ID: <1554998010.79.0.74047877309.issue36604@roundup.psfhosted.org> New submission from Bjorn Madsen : I would like to add a recipe to the itertools documentation (if it belongs there?) The recipe presents a method to generate set(powerset([iterable])) in a fraction of the runtime. I thought others might find this method helpful and pushed it to github under MIT license. The recipe is available with test here: https://github.com/root-11/python_recipes ---------- components: Extension Modules messages: 339984 nosy: Bjorn.Madsen priority: normal severity: normal status: open title: Add recipe to itertools type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 11:57:05 2019 From: report at bugs.python.org (SilentGhost) Date: Thu, 11 Apr 2019 15:57:05 +0000 Subject: [issue36604] Add recipe to itertools In-Reply-To: <1554998010.79.0.74047877309.issue36604@roundup.psfhosted.org> Message-ID: <1554998225.93.0.909052144636.issue36604@roundup.psfhosted.org> Change by SilentGhost : ---------- assignee: -> docs at python components: +Documentation -Extension Modules nosy: +docs at python, rhettinger versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:20:58 2019 From: report at bugs.python.org (Hugh Redelmeier) Date: Thu, 11 Apr 2019 16:20:58 +0000 Subject: [issue36603] should pty.openpty() set pty/tty inheritable? In-Reply-To: <1554995823.59.0.731055677634.issue36603@roundup.psfhosted.org> Message-ID: <1554999658.81.0.882805851322.issue36603@roundup.psfhosted.org> Change by Hugh Redelmeier : ---------- nosy: +hugh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:26:05 2019 From: report at bugs.python.org (Andrew Stanton) Date: Thu, 11 Apr 2019 16:26:05 +0000 Subject: [issue32451] python -m venv activation issue when using cygwin on windows In-Reply-To: <1514607229.33.0.213398074469.issue32451@psf.upfronthosting.co.za> Message-ID: <1554999965.9.0.0215166256041.issue32451@roundup.psfhosted.org> Andrew Stanton added the comment: I dont think this is a Cygwin only problem, as this is happening to me when running WSL (Windows subsystem for Linux). I can run Scripts\Activate.ps1 from powershell, Scripts\activate.bat from cmd, but running scripts/activate from wsl reports this same error. ---------- nosy: +astanton1978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:50:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 16:50:06 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h Message-ID: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> New submission from STINNER Victor : Attached PR fix the issue. ---------- components: Build messages: 339986 nosy: vstinner priority: normal severity: normal status: open title: make tags should also parse Modules/_io/*.c and Modules/_io/*.h versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:52:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 16:52:37 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555001557.54.0.0362094080846.issue36605@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12716 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:53:28 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 16:53:28 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable In-Reply-To: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> Message-ID: <1555001608.31.0.99077014754.issue36598@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +12717 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:54:34 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 16:54:34 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555001674.67.0.493632987998.issue36593@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +12718 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 12:55:28 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 16:55:28 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable In-Reply-To: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> Message-ID: <1555001728.33.0.327883048969.issue36598@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: -12717 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 13:05:16 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 17:05:16 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555002316.04.0.985076485757.issue36593@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Copying my comment from GitHub : This issue occurs only when the mock module import and code are executed under tracing. In order to test this I have tried patching sys.modules to remove unittest.mock in order to trigger an import under tracing. Though unittest.mock is deleted reference to unittest.mock.patch is held by two tests (test_patch_dict_test_prefix and test_patch_test_prefix) that change the TEST_PREFIX. Hence somehow there is a difference in the unittest.mock.patch object referred under these tests and inside mock module causing reference to unchanged TEST_PREFIX and hence test case failures. So I have kept a reference to old patch object and restored it in the end of this test to make sure everything is in sync. There is some difficulty in testing this since the import needs to be executed under tracing and manipulating sys.modules to delete unittest.mock and reimport causes some old references in other tests to go out of sync. A clean way to do this would be to have this test as a separate file and hence not impacting other tests but I am not sure if it's worth enough to justify a separate file to test this. Maybe I am missing something here on a better way to test this. Any guidance would be helpful. Thanks ---------- keywords: -patch nosy: +cjw296, mariocj89 stage: patch review -> versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 13:05:36 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 17:05:36 +0000 Subject: [issue36593] Trace function interferes with MagicMock isinstance? In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555002336.45.0.71505299146.issue36593@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- stage: -> patch review type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 13:18:57 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 11 Apr 2019 17:18:57 +0000 Subject: [issue36606] calling super() causes __class__ to be not defined when sys.settrace(trace) is set Message-ID: <1555003137.23.0.80747971032.issue36606@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : I came across this issue in issue36593 where MagicMock had a custom __class__ attribute set and one of the methods used super() which caused __class__ not to be set. This seems to have been fixed in the past with issue12370 and a workaround to alias super at module level and use it was suggested in msg161704. Usage of the alias seems to solve the issue for Mock but the fix for __class__ breaks when sys.settrace is set. Example code as below with custom __class__ defined and with running the code under sys.settrace() super() doesn't set __class__ but using _safe_super alias works. Another aspect in the mock related issue is that the call to super() is under a codepath that is not executed during normal run but executed when sys.settrace during import itself. import sys _safe_super = super def trace(frame, event, arg): return trace if len(sys.argv) > 1: sys.settrace(trace) class SuperClass(object): def __init__(self): super().__init__() @property def __class__(self): return int class SafeSuperClass(object): def __init__(self): _safe_super(SafeSuperClass, self).__init__() @property def __class__(self): return int print(isinstance(SuperClass(), int)) print(isinstance(SafeSuperClass(), int)) Running above code with trace and without trace ? cpython git:(master) ? ./python.exe /tmp/buz.py True True ? cpython git:(master) ? ./python.exe /tmp/buz.py 1 False True There is a test for the above in Lib/test/test_super.py at https://github.com/python/cpython/blob/4c409beb4c360a73d054f37807d3daad58d1b567/Lib/test/test_super.py#L87 Add a trace as below in test_super.py at the top and the test case fails import sys def trace(frame, event, arg): return trace sys.settrace(trace) ? cpython git:(master) ? ./python.exe Lib/test/test_super.py ....................F ====================================================================== FAIL: test_various___class___pathologies (__main__.TestSuper) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_super.py", line 100, in test_various___class___pathologies self.assertEqual(x.__class__, 413) AssertionError: .X'> != 413 ---------------------------------------------------------------------- Ran 21 tests in 0.058s FAILED (failures=1) ---------- components: Interpreter Core messages: 339988 nosy: benjamin.peterson, eric.snow, michael.foord, ncoghlan, nedbat, xtreak priority: normal severity: normal status: open title: calling super() causes __class__ to be not defined when sys.settrace(trace) is set type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 13:46:30 2019 From: report at bugs.python.org (Matthew Barnett) Date: Thu, 11 Apr 2019 17:46:30 +0000 Subject: [issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub() In-Reply-To: <1513189718.03.0.213398074469.issue32308@psf.upfronthosting.co.za> Message-ID: <1555004790.75.0.31029331727.issue32308@roundup.psfhosted.org> Matthew Barnett added the comment: It's now consistent with Perl, PCRE and .Net (C#), as well as re.split(), re.sub(), re.findall() and re.finditer(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 14:02:53 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 11 Apr 2019 18:02:53 +0000 Subject: [issue24011] Add error checks to PyInit_signal() In-Reply-To: <1429471695.96.0.523863138973.issue24011@psf.upfronthosting.co.za> Message-ID: <1555005773.19.0.826426224549.issue24011@roundup.psfhosted.org> Joannah Nanjekye added the comment: @berkerpeksag I made the requested changes on the PR. PTAL. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 14:12:48 2019 From: report at bugs.python.org (Nick Davies) Date: Thu, 11 Apr 2019 18:12:48 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads Message-ID: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> New submission from Nick Davies : This problem was identified in https://bugs.python.org/issue34970 but I think the fix might have been incorrect. The theory in issue34970 was that GC was causing the weakrefset for `all_tasks` to change during iteration. However Weakset provides an `_IterationGuard` class to prevent GC from changing the set during iteration and hence preventing this problem in a single thread. My thoughts on this problem are: - `asyncio.tasks._all_tasks` is shared for all users of asyncio (https://github.com/python/cpython/blob/3.7/Lib/asyncio/tasks.py#L818) - Any new Task constructed mutates `_all_tasks` (https://github.com/python/cpython/blob/3.7/Lib/asyncio/tasks.py#L117) - _IterationGuard won't protect iterations in this case because calls to Weakset.add will always commit changes even if there is something iterating (https://github.com/python/cpython/blob/3.6/Lib/_weakrefset.py#L83) - calls to `asyncio.all_tasks` or `asyncio.tasks.Task.all_tasks` crash if any task is started on any thread during iteration. Repro code: ``` import asyncio from threading import Thread async def do_nothing(): await asyncio.sleep(0) async def loop_tasks(): loop = asyncio.get_event_loop() while True: loop.create_task(do_nothing()) await asyncio.sleep(0.01) def old_thread(): loop = asyncio.new_event_loop() while True: asyncio.tasks.Task.all_tasks(loop=loop) def new_thread(): loop = asyncio.new_event_loop() while True: asyncio.all_tasks(loop=loop) old_t = Thread(target=old_thread) new_t = Thread(target=new_thread) old_t.start() new_t.start() asyncio.run(loop_tasks()) ``` Output: ``` Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "tmp/test_asyncio.py", line 25, in new_thread asyncio.all_tasks(loop=loop) File "/usr/lib/python3.7/asyncio/tasks.py", line 40, in all_tasks return {t for t in list(_all_tasks) File "/usr/lib/python3.7/_weakrefset.py", line 60, in __iter__ for itemref in self.data: RuntimeError: Set changed size during iteration Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "tmp/test_asyncio.py", line 19, in old_thread asyncio.tasks.Task.all_tasks(loop=loop) File "/usr/lib/python3.7/asyncio/tasks.py", line 52, in _all_tasks_compat return {t for t in list(_all_tasks) if futures._get_loop(t) is loop} File "/usr/lib/python3.7/_weakrefset.py", line 60, in __iter__ for itemref in self.data: RuntimeError: Set changed size during iteration ``` ---------- components: asyncio messages: 339991 nosy: Nick Davies, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio.all_tasks() crashes if asyncio is used in multiple threads versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 14:30:40 2019 From: report at bugs.python.org (Gregory Ronin) Date: Thu, 11 Apr 2019 18:30:40 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable In-Reply-To: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> Message-ID: <1555007440.83.0.024928226116.issue36598@roundup.psfhosted.org> Gregory Ronin added the comment: You are right. I was not calling generator the right way in mock. After I tried your suggestion it works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 14:50:28 2019 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 11 Apr 2019 18:50:28 +0000 Subject: [issue34249] Full set of format codes applies to strftime only In-Reply-To: <1532704035.87.0.56676864532.issue34249@psf.upfronthosting.co.za> Message-ID: <1555008628.85.0.279703926308.issue34249@roundup.psfhosted.org> Paul Ganssle added the comment: To clarify, as far as I know, this note *does* apply to both strftime and strptime, as CPython doesn't have its own implementation of either. I'm not sure if any guarantees are made that the supported formatting codes will be the same between the two. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 14:55:05 2019 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 11 Apr 2019 18:55:05 +0000 Subject: [issue22454] Adding the opposite function of shlex.split() In-Reply-To: <1411328149.26.0.00522128245951.issue22454@psf.upfronthosting.co.za> Message-ID: <1555008905.55.0.916869283753.issue22454@roundup.psfhosted.org> Change by Paul Ganssle : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 16:08:39 2019 From: report at bugs.python.org (Dmitrii Pasechnik) Date: Thu, 11 Apr 2019 20:08:39 +0000 Subject: [issue36432] Running python test suite fails on macOS 10.14.4 with resource.RLIMIT_STACK error In-Reply-To: <1553584151.61.0.380593331105.issue36432@roundup.psfhosted.org> Message-ID: <1555013319.97.0.287099984673.issue36432@roundup.psfhosted.org> Change by Dmitrii Pasechnik : ---------- nosy: +dimpase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 16:28:18 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 20:28:18 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555014498.67.0.0259693617999.issue36605@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 21a74a9d77c5ac628808b9faace18b824ca056f7 by Victor Stinner in branch 'master': bpo-36605: make tags: parse Modules/_io directory (GH-12789) https://github.com/python/cpython/commit/21a74a9d77c5ac628808b9faace18b824ca056f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 16:30:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 11 Apr 2019 20:30:35 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1555014635.4.0.0951815508458.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9e23f0a27cb8bf6e4ea1d2aef36a91502282bbc9 by Victor Stinner in branch '3.7': [3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) (GH-12788) https://github.com/python/cpython/commit/9e23f0a27cb8bf6e4ea1d2aef36a91502282bbc9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 17:13:40 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 11 Apr 2019 21:13:40 +0000 Subject: [issue20582] socket.getnameinfo() does not document flags In-Reply-To: <1392042265.22.0.885252016144.issue20582@psf.upfronthosting.co.za> Message-ID: <1555017220.42.0.247346172594.issue20582@roundup.psfhosted.org> miss-islington added the comment: New changeset 3993ccb6820d4239ce3d9e1c5d31f13b86e0000b by Miss Islington (bot) (Emmanuel Arias) in branch 'master': bpo-20582: add link for manpage for flags on getnameinfo() (GH-11977) https://github.com/python/cpython/commit/3993ccb6820d4239ce3d9e1c5d31f13b86e0000b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 18:10:45 2019 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 11 Apr 2019 22:10:45 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555020645.69.0.165429852367.issue36602@roundup.psfhosted.org> Paul Ganssle added the comment: > Is the behaviour you're proposing any different from using Path.rglob('*')? I believe `rglob("*")` is eager, while `iterdir` is lazy. @Epic_Wink: > This would be trivial to implement as 'iterdir' can simply yield from subdirectories' 'iterdir'. One thing you may need to worry about here is the fact that symlinks can have cycles, so you may need to do some cycle detection to avoid creating the dangerous possibility of infinite loops. There's also the question of whether you want this to be a depth-first or breadth-first traversal, and whether you would want both of these to be options. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 18:13:02 2019 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Thu, 11 Apr 2019 22:13:02 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module Message-ID: <1555020782.09.0.948988048159.issue36608@roundup.psfhosted.org> New submission from Sviatoslav Sydorenko : Hi, I've noticed that there's an idea to not pollute Git tree with vendored blobs. In particular, `ensurepip` is one of the components doing this. Such a wish was expressed here: https://bugs.python.org/issue35277#msg330098 So I thought I'd take a stab at it... ---------- components: Library (Lib) messages: 339998 nosy: dstufft, pradyunsg, serhiy.storchaka, webknjaz priority: normal severity: normal status: open title: Replace bundled pip and setuptools with a downloader in the ensurepip module type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 18:17:25 2019 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Thu, 11 Apr 2019 22:17:25 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module In-Reply-To: <1555020782.09.0.948988048159.issue36608@roundup.psfhosted.org> Message-ID: <1555021045.82.0.562067773497.issue36608@roundup.psfhosted.org> Change by Sviatoslav Sydorenko : ---------- keywords: +patch pull_requests: +12719 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 18:28:15 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 22:28:15 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1555021695.43.0.967641444151.issue17267@roundup.psfhosted.org> Cheryl Sabella added the comment: It seems that there was interest in this enhancement a few years ago. @joar, would you be able to convert your patch to a GitHub pull request on the master branch? Thanks! ---------- nosy: +cheryl.sabella versions: +Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 18:41:55 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 22:41:55 +0000 Subject: [issue26205] Inconsistency concerning nested scopes In-Reply-To: <1453774587.84.0.143729632402.issue26205@psf.upfronthosting.co.za> Message-ID: <1555022515.72.0.350572878067.issue26205@roundup.psfhosted.org> Cheryl Sabella added the comment: Assigning to @Mariatta for the sprints. ---------- assignee: docs at python -> Mariatta nosy: +Mariatta, cheryl.sabella versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 18:58:36 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 11 Apr 2019 22:58:36 +0000 Subject: [issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order In-Reply-To: <1537942683.07.0.545547206417.issue34805@psf.upfronthosting.co.za> Message-ID: <1555023516.37.0.42282578228.issue34805@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 20:26:04 2019 From: report at bugs.python.org (James Saryerwinnie) Date: Fri, 12 Apr 2019 00:26:04 +0000 Subject: [issue29288] Lookup Error while importing idna from a worker thread In-Reply-To: <1484605845.11.0.283710954459.issue29288@psf.upfronthosting.co.za> Message-ID: <1555028764.56.0.125734545742.issue29288@roundup.psfhosted.org> James Saryerwinnie added the comment: I ran into this as well also using the embedded distribution for windows (https://docs.python.org/3/using/windows.html#the-embeddable-package). socket.getaddrinfo() will encode unicode hostnames using idna and trigger this error if you call this function in threads: PS C:\Users\Administrator\Downloads\python-3.7.3-embed-amd64> cat .\repro.py import threading import socket def task(): try: socket.getaddrinfo('www.google.com', 443) except Exception as e: print("FAIL: %s" % e) raise threads = [] for i in range(50): t = threading.Thread(target=task) threads.append(t) for t in threads: t.start() for t in threads: t.join() print("DONE") PS C:\Users\Administrator\Downloads\python-3.7.3-embed-amd64> .\python.exe .\repro.py FAIL: unknown encoding: idna FAIL: unknown encoding: idna Exception in thread Thread-5: Traceback (most recent call last): File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\threading.py", line 917, in _bootstrap_inner File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\threading.py", line 865, in run File ".\repro.py", line 7, in task socket.getaddrinfo('www.google.com', 443) File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\socket.py", line 748, in getaddrinfo LookupError: unknown encoding: idna FAIL: unknown encoding: idna Exception in thread Thread-4: Traceback (most recent call last): File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\threading.py", line 917, in _bootstrap_inner File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\threading.py", line 865, in run File ".\repro.py", line 7, in task socket.getaddrinfo('www.google.com', 443) File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\socket.py", line 748, in getaddrinfo LookupError: unknown encoding: idna Exception in thread Thread-6: Traceback (most recent call last): File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\threading.py", line 917, in _bootstrap_inner File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\threading.py", line 865, in run File ".\repro.py", line 7, in task socket.getaddrinfo('www.google.com', 443) File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\socket.py", line 748, in getaddrinfo LookupError: unknown encoding: idna DONE Confirmed that adding u''.encode('idna') fixes this issue. ---------- nosy: +James.Saryerwinnie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 21:44:21 2019 From: report at bugs.python.org (Tom Goddard) Date: Fri, 12 Apr 2019 01:44:21 +0000 Subject: [issue16177] Typing left parenthesis in IDLE causes intermittent Cocoa Tk crash on OS X In-Reply-To: <1349800735.66.0.856769538072.issue16177@psf.upfronthosting.co.za> Message-ID: <1555033461.56.0.79557481135.issue16177@roundup.psfhosted.org> Tom Goddard added the comment: This Mac Tk bug was supposedly fixed in 2016 or 2017. Details are in the following Tk ticket. http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7 The previous URL to the Tk ticket no longer works. In case the above URL also goes bad, the id number for the Tk ticket is c84f660833546b1b84e7fd3aef930c2f17207461 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 22:45:44 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 12 Apr 2019 02:45:44 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555037144.69.0.854382534734.issue36602@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > I believe `rglob("*")` is eager, while `iterdir` is lazy. rglob and glob also return a generator. Slightly related, pathlib.walk was proposed in the past in python-ideas : https://mail.python.org/pipermail/python-ideas/2017-April/045398.html ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 23:14:00 2019 From: report at bugs.python.org (Eitan Adler) Date: Fri, 12 Apr 2019 03:14:00 +0000 Subject: [issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file In-Reply-To: <1554948440.07.0.28828566641.issue36596@roundup.psfhosted.org> Message-ID: <1555038840.87.0.950140946574.issue36596@roundup.psfhosted.org> Change by Eitan Adler : ---------- nosy: +eitan.adler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 11 23:27:25 2019 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 12 Apr 2019 03:27:25 +0000 Subject: [issue34652] never enable lchmod on Linux In-Reply-To: <1554982948.06.0.125450662802.issue34652@roundup.psfhosted.org> Message-ID: <0101ad10-f9df-4295-b71e-581d9351e5c7@www.fastmail.com> Benjamin Peterson added the comment: We can take a PR to fix that. On Thu, Apr 11, 2019, at 04:42, Joshua Root wrote: > > Joshua Root added the comment: > > The follow-up fix (AC_CHECK_FUNC -> AC_CHECK_FUNCS) still needs to be > backported to 2.7. Currently the lack of it causes lchmod to be > disabled on all platforms, not just Linux. > > ---------- > nosy: +jmr > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 00:43:16 2019 From: report at bugs.python.org (Tim Mitchell) Date: Fri, 12 Apr 2019 04:43:16 +0000 Subject: [issue36457] functools.singledispatchmethod interacts poorly with subclasses In-Reply-To: <1553744559.32.0.207343635807.issue36457@roundup.psfhosted.org> Message-ID: <1555044196.94.0.233741122131.issue36457@roundup.psfhosted.org> Tim Mitchell added the comment: Attached is an improved implementation that does not use a module level register() function. It makes the code in the original post work as expected: The `@BaseVisitor.visit.register()` decorator on the `AVisitor` class does not modify the base class dispatch table. This works by constructing the dispatch registry in the `__init_subclass__` method instead. ---------- Added file: https://bugs.python.org/file48261/singledispatchmethod.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 01:04:24 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 12 Apr 2019 05:04:24 +0000 Subject: [issue36604] Add recipe to itertools In-Reply-To: <1554998010.79.0.74047877309.issue36604@roundup.psfhosted.org> Message-ID: <1555045464.19.0.0247096800909.issue36604@roundup.psfhosted.org> Raymond Hettinger added the comment: Thank you for the suggestion and the nice work. I'm going to decline adding this to our docs because it isn't in the spirit of the other recipes (reasonably common task, reasonably simple, and/or showing off effective combinations of the other itertools). Though the docs aren't the right place for this, it would be nice if you published a blog post or some such to show off your work, detail the though processes, and illustrate how you measured performance). Another option is to submit this to the more-itertools project. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 01:06:53 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 12 Apr 2019 05:06:53 +0000 Subject: [issue36591] Should be a typing.UserNamedTuple In-Reply-To: <1554931173.44.0.541756182017.issue36591@roundup.psfhosted.org> Message-ID: <1555045613.89.0.960922537733.issue36591@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> levkivskyi nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 01:30:20 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 12 Apr 2019 05:30:20 +0000 Subject: [issue36599] doctest document says dict order is unstable In-Reply-To: <1554977470.77.0.948736759807.issue36599@roundup.psfhosted.org> Message-ID: <1555047020.41.0.288932282478.issue36599@roundup.psfhosted.org> Raymond Hettinger added the comment: Go ahead and change it to: "For example, when printing a set, Python doesn?t guarantee that the else will be printed in any particular order," ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 02:20:25 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 06:20:25 +0000 Subject: [issue36599] doctest document says dict order is unstable In-Reply-To: <1554977470.77.0.948736759807.issue36599@roundup.psfhosted.org> Message-ID: <1555050025.84.0.763207870654.issue36599@roundup.psfhosted.org> Inada Naoki added the comment: Oh, #34839 had fixed this already. It was not backported to 3.7 yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 02:21:25 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 06:21:25 +0000 Subject: [issue34839] doctest: Change example under warnings section In-Reply-To: <1538180284.16.0.545547206417.issue34839@psf.upfronthosting.co.za> Message-ID: <1555050085.17.0.621869927649.issue34839@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 02:21:28 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 06:21:28 +0000 Subject: [issue36599] doctest document says dict order is unstable In-Reply-To: <1554977470.77.0.948736759807.issue36599@roundup.psfhosted.org> Message-ID: <1555050088.29.0.311272745358.issue36599@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> doctest: Change example under warnings section _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 02:27:31 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 06:27:31 +0000 Subject: [issue34839] doctest: Change example under warnings section In-Reply-To: <1538180284.16.0.545547206417.issue34839@psf.upfronthosting.co.za> Message-ID: <1555050451.77.0.745436368511.issue34839@roundup.psfhosted.org> miss-islington added the comment: New changeset a910c2c6f3542b61f084de2ece0d8dab09c5a0fa by Miss Islington (bot) in branch '3.7': bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest (GH-9736) https://github.com/python/cpython/commit/a910c2c6f3542b61f084de2ece0d8dab09c5a0fa ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 02:38:17 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 06:38:17 +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: <1555051097.86.0.344395627018.issue20180@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 03:08:35 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 07:08:35 +0000 Subject: [issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows In-Reply-To: <1396262123.2.0.239412802273.issue21110@psf.upfronthosting.co.za> Message-ID: <1555052915.26.0.198783637866.issue21110@roundup.psfhosted.org> Inada Naoki added the comment: Is this issue still alive? May I close this issue as "out of date"? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 03:11:33 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 07:11:33 +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: <1555053093.61.0.38309691386.issue20180@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 9e4f2f3a6b8ee995c365e86d976937c141d867f8 by Inada Naoki in branch 'master': bpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792) https://github.com/python/cpython/commit/9e4f2f3a6b8ee995c365e86d976937c141d867f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 03:12:02 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 07:12:02 +0000 Subject: [issue35279] asyncio uses too many threads by default In-Reply-To: <1542637615.61.0.788709270274.issue35279@psf.upfronthosting.co.za> Message-ID: <1555053122.49.0.905051668376.issue35279@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:12:49 2019 From: report at bugs.python.org (Laurie Opperman) Date: Fri, 12 Apr 2019 08:12:49 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555056769.62.0.81507942145.issue36602@roundup.psfhosted.org> Laurie Opperman added the comment: > Is the behaviour you're proposing any different from using `Path.rglob('*')`? By that logic, we should remove `Path.iterdir()` in favour of `Path.glob('*')`. In addition, having `iterdir` the way it is makes it easy for subclasses to extend its functionality (for example, one of my `Path` subclasses allows a callable to be passed to the `iterdir` which can filter paths) > One thing you may need to worry about here is the fact that symlinks can have cycles, so you may need to do some cycle detection to avoid creating the dangerous possibility of infinite loops. I agree, which is the main reason the current implementation in the pull-request is to not resolve symlinks: users can subclass and implement symlink resolving if they want > There's also the question of whether you want this to be a depth-first or breadth-first traversal, and whether you would want both of these to be options. As much as I want to say that I don't see a use-case for breadth-first file listing (when I list files, I expect the next file provided to be 'next to' the current file), users currently have no standard-library functionality to perform breadth-first searches as far as I know: they'd have to implement it themself or find it in a third-party library > Slightly related, pathlib.walk was proposed in the past in python-ideas... I've never really liked the interface to `walk`, personal preference ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:22:15 2019 From: report at bugs.python.org (Laurie Opperman) Date: Fri, 12 Apr 2019 08:22:15 +0000 Subject: [issue35279] asyncio uses too many threads by default In-Reply-To: <1542637615.61.0.788709270274.issue35279@psf.upfronthosting.co.za> Message-ID: <1555057335.43.0.605459108126.issue35279@roundup.psfhosted.org> Laurie Opperman added the comment: What about making it dependant on memory as well as logical processor count: `n_workers = min(RAM_GB / some_number, N_CORES * 5)` ---------- nosy: +Epic_Wink _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:27:01 2019 From: report at bugs.python.org (=?utf-8?b?7KCV7ZWc7IaU?=) Date: Fri, 12 Apr 2019 08:27:01 +0000 Subject: [issue36609] activate.ps1 in venv for Windows should encoded with BOM Message-ID: <1555057621.3.0.569629165063.issue36609@roundup.psfhosted.org> New submission from ??? : "activate.ps1" (venv) is currently encoded as UTF8 without BOM. But this cause an error if path of an environment contains non-ASCII characters. It seems Powershell can't recognize UTF8 without BOM. If I changed encoding of activate.ps1 to UTF8-BOM, it works well. So I think activate.ps1 should be encoded as UTF8-BOM. https://stackoverflow.com/questions/14482253/utf8-script-in-powershell-outputs-incorrect-characters ---------- messages: 340014 nosy: ??? priority: normal severity: normal status: open title: activate.ps1 in venv for Windows should encoded with BOM type: crash versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:28:12 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 08:28:12 +0000 Subject: [issue35279] asyncio uses too many threads by default In-Reply-To: <1542637615.61.0.788709270274.issue35279@psf.upfronthosting.co.za> Message-ID: <1555057692.14.0.758439285244.issue35279@roundup.psfhosted.org> Inada Naoki added the comment: node.js default threadpool size is 4 regardless number of cores. https://nodejs.org/api/cli.html#cli_uv_threadpool_size_size Since we has GIL, I think fixed-size pool is better idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:28:32 2019 From: report at bugs.python.org (Michael Felt) Date: Fri, 12 Apr 2019 08:28:32 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x In-Reply-To: <1554914943.12.0.570465891658.issue36579@roundup.psfhosted.org> Message-ID: <65979085-a569-95d0-77b9-68e6baa76436@felt.demon.nl> Michael Felt added the comment: On 10/04/2019 18:49, STINNER Victor wrote: > STINNER Victor added the comment: > > "I am looking into this - but as it seems to have gone away again - is > there a simple way to get that code back, and/or see what the diff is, > before/badrun/after?" > > Maybe it's just a flacky test. It's hard to guess. > > You can get the Git revision of a build by looking at details: > > https://buildbot.python.org/all/#/builders/10/builds/2389 > => Properties: "got_revision: 8702b67dad62a9084f6c1823dce10653743667c8" > > See also "Changes" tab. > > Sometimes when a bug disappears, I just close it as "outdated" after a few weeks. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > I'll try a manual build on the gccfarm. Not exactly the same environment, but as close as I can get. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:33:33 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 12 Apr 2019 08:33:33 +0000 Subject: [issue36609] activate.ps1 in venv for Windows should encoded with BOM In-Reply-To: <1555057621.3.0.569629165063.issue36609@roundup.psfhosted.org> Message-ID: <1555058013.46.0.963408531618.issue36609@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:39:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 12 Apr 2019 08:39:56 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1555058395.99.0.929288457805.issue17267@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 04:56:34 2019 From: report at bugs.python.org (Jakub Kulik) Date: Fri, 12 Apr 2019 08:56:34 +0000 Subject: [issue36610] os.sendfile can return EINVAL on Solaris Message-ID: <1555059394.06.0.893471228224.issue36610@roundup.psfhosted.org> New submission from Jakub Kulik : Hi, We have several tests failing on Solaris due to the slightly different behavior of os.sendfile function. Sendfile on Solaris can raise EINVAL if offset is equal or bigger than the size of the file (Python expects that it will return 0 bytes sent in that case). I managed to patch `socked.py` with additional checks on two places (patch attached), Python 3.8 introduced sendfile in shutil.py module, where I don't have fsize variable so easily accessible and so I am unsure what to do with it. Also, I am not even sure if this is a correct way to handle this. Maybe this should be patched somewhere in the .c file? Or there might be other systems with the same behavior and all I need to do is adjust some define guards there... EINVAL can also mean other things and so I guess I cannot just catch that errno and continue as with returned 0. Thanks ---------- components: Library (Lib) files: sendfile.patch keywords: patch messages: 340017 nosy: kulikjak priority: normal severity: normal status: open title: os.sendfile can return EINVAL on Solaris type: crash versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file48262/sendfile.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:09:13 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 12 Apr 2019 10:09:13 +0000 Subject: [issue36598] mock side_effect should be checked for iterable not callable In-Reply-To: <1554955978.5.0.68760722366.issue36598@roundup.psfhosted.org> Message-ID: <1555063753.39.0.484511148859.issue36598@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks, I am closing this as not a bug. Feel free to reopen this if I have missed any. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:16:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:16:34 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint Message-ID: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> New submission from STINNER Victor : When PYTHONMALLOC=debug environment variable or -X dev command line option is used, Python installs debug hooks on memory allocators which add 2 size_t before and 2 size_t after each memory block: it adds 32 bytes to every memory allocation. I'm debugging crashes and memory leaks in CPython for 10 years, and I simply never had to use "serialno". So I simply propose attached pull request to remove it to reduce the memory footprint: I measured a reduction around -5% (ex: 1.2 MiB on 33.0 MiB when running test_asyncio). A smaller memory footprint allows to use this feature on devices with small memory, like embedded devices. The change also fix race condition in debug memory allocators: bpo-31473, "Debug hooks on memory allocators are not thread safe (serialno variable)". Using tracemalloc, it is already possible (since Python 3.6) to find where a memory block has been allocated, and so decide where to put a breakpoint when debugging. If someone cares about the "serialno" field, maybe we can keep code using a compilation flag, like a C #define. "serialno" is documented as: "an excellent way to set a breakpoint on the next run, to capture the instant at which this block was passed out." But again, I never used it... -- Some examples of the *peak* memory usage without => with the change: * -c pass: 2321.8 kB => 2437.1 kB (-115.3 kiB, -5%) * -m test test_os test_sys: 14252.3 kB => 13598.6 kB (-653.7 kiB, -5%) * -m test test_asyncio: 34194.2 kB => 32963.1 kB (-1231.1 kiB, -4%) Command used to measure the memory consumption: $ ./python -i -X tracemalloc -c pass >>> import tracemalloc; print("%.1f kB" % (tracemalloc.get_traced_memory()[1] / 1024.)) With the patch: diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index c5d5671032..e010c2ef84 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -582,6 +582,8 @@ tracemalloc_add_trace(unsigned int domain, uintptr_t ptr, _Py_hashtable_entry_t* entry; int res; + size += 4 * sizeof(size_t); + assert(_Py_tracemalloc_config.tracing); traceback = traceback_new(); Replace 4 with 3 to measure memory used with the change. -- Since Python 3.6, when the debug memory allocator detects a bug (ex: buffer overflow), it now also displays the Python traceback where the memory block has been allocated if tracemalloc is tracing Python memory allocations. Example with buffer_overflow.py: --- import _testcapi def func(): _testcapi.pymem_buffer_overflow() def main(): func() if __name__ == "__main__": main() --- Output: --- $ ./python -X tracemalloc=10 -X dev bug.py Debug memory block at address p=0x7f45e85c3270: API 'm' 16 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x7f45e85c3280 are not all FORBIDDENBYTE (0xfd): at tail+0: 0x78 *** OUCH at tail+1: 0xfd at tail+2: 0xfd at tail+3: 0xfd at tail+4: 0xfd at tail+5: 0xfd at tail+6: 0xfd at tail+7: 0xfd Data at p: cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd Memory block allocated at (most recent call first): File "bug.py", line 4 File "bug.py", line 7 File "bug.py", line 10 Fatal Python error: bad trailing pad byte Current thread 0x00007f45f5660740 (most recent call first): File "bug.py", line 4 in func File "bug.py", line 7 in main File "bug.py", line 10 in Aborted (core dumped) --- The interesting part is "Memory block allocated at (most recent call first):". Traceback reconstructed manually: --- Memory block allocated at (most recent call first): File "bug.py", line 4 _testcapi.pymem_buffer_overflow() File "bug.py", line 7 func() File "bug.py", line 10 main() --- You can see exactly where the memory block has been allocated. Note: Internally, the _PyTraceMalloc_GetTraceback() function is used to get the traceback where a memory block has been allocated. -- Extract of _PyMem_DebugRawAlloc() in Objects/obmalloc.c: /* Let S = sizeof(size_t). The debug malloc asks for 4*S extra bytes and fills them with useful stuff, here calling the underlying malloc's result p: p[0: S] Number of bytes originally asked for. This is a size_t, big-endian (easier to read in a memory dump). p[S] API ID. See PEP 445. This is a character, but seems undocumented. p[S+1: 2*S] Copies of FORBIDDENBYTE. Used to catch under- writes and reads. p[2*S: 2*S+n] The requested memory, filled with copies of CLEANBYTE. Used to catch reference to uninitialized memory. &p[2*S] is returned. Note that this is 8-byte aligned if pymalloc handled the request itself. p[2*S+n: 2*S+n+S] Copies of FORBIDDENBYTE. Used to catch over- writes and reads. p[2*S+n+S: 2*S+n+2*S] A serial number, incremented by 1 on each call to _PyMem_DebugMalloc and _PyMem_DebugRealloc. This is a big-endian size_t. If "bad memory" is detected later, the serial number gives an excellent way to set a breakpoint on the next run, to capture the instant at which this block was passed out. */ /* Layout: [SSSS IFFF CCCC...CCCC FFFF NNNN] * ^--- p ^--- data ^--- tail S: nbytes stored as size_t I: API identifier (1 byte) F: Forbidden bytes (size_t - 1 bytes before, size_t bytes after) C: Clean bytes used later to store actual data N: Serial number stored as size_t */ The last size_t written at the end of each memory block is "serialno". It is documented as: "an excellent way to set a breakpoint on the next run, to capture the instant at which this block was passed out." ---------- components: Interpreter Core messages: 340019 nosy: vstinner priority: normal severity: normal status: open title: Debug memory allocators: remove useless "serialno" field to reduce memory footprint versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:20:02 2019 From: report at bugs.python.org (Jakub Kulik) Date: Fri, 12 Apr 2019 10:20:02 +0000 Subject: [issue35520] Python won't build with dtrace enabled on some systems. In-Reply-To: <1545047330.52.0.788709270274.issue35520@psf.upfronthosting.co.za> Message-ID: <1555064402.23.0.737040483381.issue35520@roundup.psfhosted.org> Jakub Kulik added the comment: Can this also be backported to 3.7? I just installed 3.8a3 (where it already is) and it works as expected. Also we are using this patch ourselves in 3.7 and it works but I guess it would be nicer to have it in upstream as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:30:33 2019 From: report at bugs.python.org (Martin Panter) Date: Fri, 12 Apr 2019 10:30:33 +0000 Subject: [issue36600] re-enable test in nntplib In-Reply-To: <1554978898.45.0.176655214392.issue36600@roundup.psfhosted.org> Message-ID: <1555065033.24.0.213945558137.issue36600@roundup.psfhosted.org> Martin Panter added the comment: Does the test still depend on real-world posts? If so, see Issue 19613. I don?t think the problem has been fixed. ---------- nosy: +martin.panter superseder: -> test_nntplib: sporadic failures, test_article_head_body() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:36:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:36:33 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555065393.59.0.345714437776.issue36611@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12722 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:39:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:39:15 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555065555.08.0.473326952884.issue36611@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12723 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:40:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:40:24 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555065624.03.0.410638073013.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: I wrote 2 pull requests for the two options: * PR 12795 removes serialno field * PR 12796 adds PYMEM_DEBUG_SERIALNO define which is unset by default ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:42:52 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:42:52 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555065772.9.0.158271551623.issue36611@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12724 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:43:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:43:49 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555065829.98.0.14753986687.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: While testing my changes, I found a bug in test_sys: ./python -X tracemalloc -m test test_sys -v -m test_getallocatedblocks ====================================================================== ERROR: test_getallocatedblocks (test.test_sys.SysModuleTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_sys.py", line 770, in test_getallocatedblocks alloc_name = _testcapi.pymem_getallocatorsname() RuntimeError: cannot get allocators name Attached PR 12797 fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:49:47 2019 From: report at bugs.python.org (Michael Felt) Date: Fri, 12 Apr 2019 10:49:47 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x In-Reply-To: <65979085-a569-95d0-77b9-68e6baa76436@felt.demon.nl> Message-ID: <26f4d1ef-fc51-0ea9-27cc-0704d54a7379@felt.demon.nl> Michael Felt added the comment: On 12/04/2019 10:28, Michael Felt wrote: > Michael Felt added the comment: > > On 10/04/2019 18:49, STINNER Victor wrote: >> STINNER Victor added the comment: >> >> "I am looking into this - but as it seems to have gone away again - is >> there a simple way to get that code back, and/or see what the diff is, >> before/badrun/after?" >> >> Maybe it's just a flacky test. It's hard to guess. >> >> You can get the Git revision of a build by looking at details: >> >> https://buildbot.python.org/all/#/builders/10/builds/2389 >> => Properties: "got_revision: 8702b67dad62a9084f6c1823dce10653743667c8" >> >> See also "Changes" tab. >> >> Sometimes when a bug disappears, I just close it as "outdated" after a few weeks. >> >> ---------- >> >> _______________________________________ >> Python tracker >> >> _______________________________________ >> > I'll try a manual build on the gccfarm. Not exactly the same > environment, but as close as I can get. > > ---------- The single test passes: $ ./python -m test -v test_venv == CPython 3.8.0a3+ (v3.8.0a3-109-g8702b67:8702b67, Apr 12 2019, 04:35:08) [GCC 7.2.0] == AIX-2-00FA74164C00-powerpc-32bit big-endian == cwd: /home/aixtools/python/test_venv/build/test_python_27132304 == CPU count: 64 == encodings: locale=ISO8859-1, FS=iso8859-1 Run tests sequentially 0:00:00 [1/1] test_venv test_defaults (test.test_venv.BasicTest) ... ok test_executable (test.test_venv.BasicTest) ... ok test_executable_symlinks (test.test_venv.BasicTest) ... ok test_isolation (test.test_venv.BasicTest) ... ok test_multiprocessing (test.test_venv.BasicTest) ... ok test_overwrite_existing (test.test_venv.BasicTest) ... ok test_prefixes (test.test_venv.BasicTest) ... ok test_prompt (test.test_venv.BasicTest) ... ok test_symlinking (test.test_venv.BasicTest) ... ok test_unicode_in_batch_file (test.test_venv.BasicTest) ... skipped 'only relevant on Windows' test_unoverwritable_fails (test.test_venv.BasicTest) ... ok test_upgrade (test.test_venv.BasicTest) ... ok test_devnull (test.test_venv.EnsurePipTest) ... ok test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok test_with_pip (test.test_venv.EnsurePipTest) ... ok ---------------------------------------------------------------------- Ran 16 tests in 172.244s OK (skipped=1) test_venv passed in 2 min 52 sec == Tests result: SUCCESS == With "make test" - they also all pass (make buildbottest did not run as expected, only one thread, make test runs with CPU: 64) ... 0:05:50 [420/420/1] test_venv passed (5 min 43 sec) == Tests result: SUCCESS == 401 tests OK. 1 test altered the execution environment: ??? test_concurrent_futures 18 tests skipped: ??? test_curses test_devpoll test_epoll test_gdb test_kqueue ??? test_msilib test_ossaudiodev test_spwd test_startfile test_tix ??? test_tk test_ttk_guionly test_unicode_file ??? test_unicode_file_functions test_winconsoleio test_winreg ??? test_winsound test_zipfile64 Total duration: 5 min 50 sec Tests result: SUCCESS So, I guess "flacky". Cannot reproduce in any case. > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:52:01 2019 From: report at bugs.python.org (Inada Naoki) Date: Fri, 12 Apr 2019 10:52:01 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555066321.01.0.20749953739.issue36611@roundup.psfhosted.org> Inada Naoki added the comment: I never used the serialno too. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 06:59:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 10:59:06 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555066746.53.0.41050435931.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: This issue is related to the following thread on python-dev which discuss disabling Py_TRACE_REFS by default, bpo-36465, to reduce the memory footprint in debug mode: https://mail.python.org/pipermail/python-dev/2019-April/157015.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 07:01:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 11:01:10 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555066870.18.0.585550806914.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: The serialno has been added at the same time than the whole debug hooks on Python memory allocated by Tim Peters in 2002, 17 years ago: commit ddea208be9e2a8fa281e25ebbc890378dd2aa286 Author: Tim Peters Date: Sat Mar 23 10:03:50 2002 +0000 Give Python a debug-mode pymalloc, much as sketched on Python-Dev. When WITH_PYMALLOC is defined, define PYMALLOC_DEBUG to enable the debug allocator. This can be done independent of build type (release or debug). A debug build automatically defines PYMALLOC_DEBUG when pymalloc is enabled. It's a detected error to define PYMALLOC_DEBUG when pymalloc isn't enabled. Two debugging entry points defined only under PYMALLOC_DEBUG: + _PyMalloc_DebugCheckAddress(const void *p) can be used (e.g., from gdb) to sanity-check a memory block obtained from pymalloc. It sprays info to stderr (see next) and dies via Py_FatalError if the block is detectably damaged. + _PyMalloc_DebugDumpAddress(const void *p) can be used to spray info about a debug memory block to stderr. A tiny start at implementing "API family" checks isn't good for anything yet. _PyMalloc_DebugRealloc() has been optimized to do little when the new size is <= old size. However, if the new size is larger, it really can't call the underlying realloc() routine without either violating its contract, or knowing something non-trivial about how the underlying realloc() works. A memcpy is always done in this case. This was a disaster for (and only) one of the std tests: test_bufio creates single text file lines up to a million characters long. On Windows, fileobject.c's get_line() uses the horridly funky getline_via_fgets(), which keeps growing and growing a string object hoping to find a newline. It grew the string object 1000 bytes each time, so for a million-character string it took approximately forever (I gave up after a few minutes). So, also: fileobject.c, getline_via_fgets(): When a single line is outrageously long, grow the string object at a mildly exponential rate, instead of just 1000 bytes at a time. That's enough so that a debug-build test_bufio finishes in about 5 seconds on my Win98SE box. I'm curious to try this on Win2K, because it has very different memory behavior than Win9X, and test_bufio always took a factor of 10 longer to complete on Win2K. It *could* be that the endless reallocs were simply killing it on Win2K even in the release build. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 07:03:29 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 11:03:29 +0000 Subject: [issue34144] venv activate.bat reset codepage fails on windows 10 In-Reply-To: <1531901922.72.0.56676864532.issue34144@psf.upfronthosting.co.za> Message-ID: <1555067009.45.0.978446973237.issue34144@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:09:53 2019 From: report at bugs.python.org (Vratko Polak) Date: Fri, 12 Apr 2019 12:09:53 +0000 Subject: [issue36612] Unittest document is not clear on SetUpClass calls Message-ID: <1555070993.71.0.91547720267.issue36612@roundup.psfhosted.org> New submission from Vratko Polak : One particular paragraph from unittest.rst is not clear enough: "If you want the setUpClass and tearDownClass on base classes called then you must call up to them yourself. The implementations in TestCase are empty." It has sparkled a debate here [0]. Example: A class SuperTestCase, which inherits from unittest.TestCase, defines some non-trivial setUpClass class method. Then a class SubTestCase, which inherits from SuperTestCase, wants to have SuperTestCase.setUpClass executed as its setUpClass. Does SubTestCase need to override setUpClass just to call SuperTestCase.setUpClass (as the paragraphs might suggest), or can it rely in inheritance to have it executed without overriding? I will create GitHub PR soon. [0] https://gerrit.fd.io/r/#/c/18579/1/test/test_sparse_vec.py at 14 ---------- assignee: docs at python components: Documentation messages: 340028 nosy: docs at python, vrpolakatcisco priority: normal severity: normal status: open title: Unittest document is not clear on SetUpClass calls type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:15:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 12:15:24 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x In-Reply-To: <1554828700.04.0.163813636834.issue36579@roundup.psfhosted.org> Message-ID: <1555071324.15.0.482523626113.issue36579@roundup.psfhosted.org> STINNER Victor added the comment: Since build 2389 which failed, 21 builds succeeded. The failure looks random, so I success to close the issue. I leave it open since it seems like Michael Felt is interested to investigate ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:18:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 12:18:30 +0000 Subject: [issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows In-Reply-To: <1396262123.2.0.239412802273.issue21110@psf.upfronthosting.co.za> Message-ID: <1555071510.7.0.711275898115.issue21110@roundup.psfhosted.org> STINNER Victor added the comment: Steve: Are you aware of this issue? "Apparently, you need to add this to your C program: #define HAVE_SSIZE_T" ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:19:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 12:19:50 +0000 Subject: [issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x In-Reply-To: <1554828700.04.0.163813636834.issue36579@roundup.psfhosted.org> Message-ID: <1555071590.5.0.498927320831.issue36579@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I missed your second message: "So, I guess "flacky". Cannot reproduce in any case." So well, I close the issue. It's ok, sometimes things break randomly :-) The important thing is that the current status is that tests pass ;-) ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:23:16 2019 From: report at bugs.python.org (Vratko Polak) Date: Fri, 12 Apr 2019 12:23:16 +0000 Subject: [issue36612] Unittest document is not clear on SetUpClass calls In-Reply-To: <1555070993.71.0.91547720267.issue36612@roundup.psfhosted.org> Message-ID: <1555071796.21.0.112919583604.issue36612@roundup.psfhosted.org> Change by Vratko Polak : ---------- keywords: +patch pull_requests: +12725 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:35:33 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 12 Apr 2019 12:35:33 +0000 Subject: [issue36612] Unittest document is not clear on SetUpClass calls In-Reply-To: <1555070993.71.0.91547720267.issue36612@roundup.psfhosted.org> Message-ID: <1555072533.72.0.57423524499.issue36612@roundup.psfhosted.org> SilentGhost added the comment: Normal inheritance rules apply to TestCase and its subclasses, as can be demonstrated by a trivial example. ---------- nosy: +SilentGhost versions: +Python 3.7, Python 3.8 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:37:22 2019 From: report at bugs.python.org (Saim Raza) Date: Fri, 12 Apr 2019 12:37:22 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1555072642.25.0.039244361606.issue36537@roundup.psfhosted.org> Saim Raza added the comment: This is pretty unintuitive from a user's stand point. Now, I need to *inconveniently* put some dummy code after the ser_trace call every time I want to access the exception inside the except block. Also, this is a change in behavior from Python 2.7. Is this documented somewhere? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:38:08 2019 From: report at bugs.python.org (Aleksandr Balezin) Date: Fri, 12 Apr 2019 12:38:08 +0000 Subject: [issue36613] asyncio._wait() don't remove callback in case of exception Message-ID: <1555072688.4.0.270726893934.issue36613@roundup.psfhosted.org> New submission from Aleksandr Balezin : Attached script shows unexpected behavior of the wait() function. The wait_ function adds done callback on every call and removes it only if a waiter is successfully awaited. In case of CancelledError exception during "await waiter", callbacks are being accumulated infinitely in task._callbacks. ---------- components: asyncio files: asyncio_wait_callbacks_leak.py messages: 340034 nosy: asvetlov, gescheit, yselivanov priority: normal severity: normal status: open title: asyncio._wait() don't remove callback in case of exception type: resource usage versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file48263/asyncio_wait_callbacks_leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:39:11 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 12 Apr 2019 12:39:11 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1555072751.06.0.831858984103.issue36537@roundup.psfhosted.org> SilentGhost added the comment: Saim, a .post_mortem could be used instead. As I noted, it works just fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:50:56 2019 From: report at bugs.python.org (Roundup Robot) Date: Fri, 12 Apr 2019 12:50:56 +0000 Subject: [issue34652] never enable lchmod on Linux In-Reply-To: <1536788618.14.0.956365154283.issue34652@psf.upfronthosting.co.za> Message-ID: <1555073456.0.0.917211416996.issue34652@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +12727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 08:52:46 2019 From: report at bugs.python.org (Aleksandr Balezin) Date: Fri, 12 Apr 2019 12:52:46 +0000 Subject: [issue36613] asyncio._wait() don't remove callback in case of exception In-Reply-To: <1555072688.4.0.270726893934.issue36613@roundup.psfhosted.org> Message-ID: <1555073566.02.0.600367091781.issue36613@roundup.psfhosted.org> Change by Aleksandr Balezin : ---------- keywords: +patch pull_requests: +12728 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:04:23 2019 From: report at bugs.python.org (Saim Raza) Date: Fri, 12 Apr 2019 13:04:23 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1555074263.67.0.960383176828.issue36537@roundup.psfhosted.org> Saim Raza added the comment: Thanks, SilentGhost! However, should we try to fix set_trace as well to avoid hassles to other users? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:15:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 13:15:09 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555074909.87.0.601296291519.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9b8314cfe29ca532fc335277f6c36b72e6132922 by Victor Stinner in branch 'master': bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797) https://github.com/python/cpython/commit/9b8314cfe29ca532fc335277f6c36b72e6132922 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:15:18 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 13:15:18 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555074918.42.0.308406019435.issue36611@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:16:47 2019 From: report at bugs.python.org (Eryk Sun) Date: Fri, 12 Apr 2019 13:16:47 +0000 Subject: [issue32451] python -m venv activation issue when using cygwin on windows In-Reply-To: <1514607229.33.0.213398074469.issue32451@psf.upfronthosting.co.za> Message-ID: <1555075007.52.0.730276325356.issue32451@roundup.psfhosted.org> Eryk Sun added the comment: Why is the bash/zsh "activate" script getting distributed with CRLF line endings? Apparently Windows builds of bash (e.g. git-bash) can handle CRLF line endings, but Cygwin bash cannot. As to Linux bash in WSL, the activate script from a virtual environment created by Windows Python can't be used anyway. It modifies $PATH using a DOS path like "C:\taco" as opposed to a WSL path like "/mnt/c/taco". > when running "pip freeze" in number 3 it returns the system > packages despite the "include-system-site-packages = False" > in pyvenv.cfg The 3rd attempt is just running activate.bat from a CMD shell. That should work, unless you `exit` out of CMD back to bash. Anyway, check `where.exe pip` after activating. It should find "C:\taco\Scripts\pip.exe" first. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:32:52 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 12 Apr 2019 13:32:52 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module In-Reply-To: <1555020782.09.0.948988048159.issue36608@roundup.psfhosted.org> Message-ID: <1555075972.78.0.787370773699.issue36608@roundup.psfhosted.org> Eric V. Smith added the comment: ensurepip does not access the network, by design. We do not want it to start access the network without a lot of discussion. And if it does access the network, it will need to be able to use alternate URLs. For example: where I deploy Python, it would not have access to the URLs in your PR, but instead would need to specify a different (internal) location. This is the same reason that pip install has --find-links, --no-index, --extra-index-url, etc. I think this would need a lot of discussion (probably on distutils-sig), and probably a PEP. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:33:22 2019 From: report at bugs.python.org (=?utf-8?q?Anders_Hovm=C3=B6ller?=) Date: Fri, 12 Apr 2019 13:33:22 +0000 Subject: [issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub() In-Reply-To: <1513189718.03.0.213398074469.issue32308@psf.upfronthosting.co.za> Message-ID: <1555076002.35.0.426857478772.issue32308@roundup.psfhosted.org> Anders Hovm?ller added the comment: That might be true, but that seems like a weak argument. If anything, it means those others are broken. What is the logic behind "(.*)" returning the entire string (which is what you asked for) and exactly one empty string? Why not two empty strings? 3? 4? 5? Why not an empty string at the beginning? It makes no practical sense. We will have to spend considerable effort to work around this change and adapt our code to 3.7. The lack of a discussion about backwards compatibility in this, and the other, thread before making this change is also a problem I think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:33:34 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 13:33:34 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555076014.16.0.292164344143.issue36611@roundup.psfhosted.org> miss-islington added the comment: New changeset 7182e653fb5c6f78f05892b6ed302fc8db8978d3 by Miss Islington (bot) in branch '3.7': bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797) https://github.com/python/cpython/commit/7182e653fb5c6f78f05892b6ed302fc8db8978d3 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:35:19 2019 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 12 Apr 2019 13:35:19 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555076119.03.0.214722016898.issue36602@roundup.psfhosted.org> Paul Ganssle added the comment: > rglob and glob also return a generator. My mistake, I didn't notice the `sorted` in the `rglob` documentation and thought it was emitting a list. > By that logic, we should remove `Path.iterdir()` in favour of `Path.glob('*')`. What *is* the case for why iterdir() is justified when `Path.glob('*')` exists? Is it just discoverability? Is there some efficiency reason to do it? Of course, removing things (which can break existing code) and failing to add them (which cannot) have two different thresholds for when they can take place, so even if we decide "iterdir() is to glob('*') as iterdir(recursive=True) is to rglob('*')", that doesn't mean that we should remove iterdir() entirely if recursive=True is not added. > I agree, which is the main reason the current implementation in the pull-request is to not resolve symlinks: users can subclass and implement symlink resolving if they want I don't see that on the implementation here, but we can discuss this on the PR itself. I do think that skipping *all* symlinks automatically with no option to follow them will be counter-intuitive for people. > I've never really liked the interface to `walk`, personal preference I kinda agree about the interface to `walk`, but it is worth noting that as we've seen in this thread, there are a bunch of plausible and slightly different ways to walk a directory: breadth-first or depth-first? following symlinks, following symlinks with cycle detection, or not following symlinks at all? emit the directory itself, or only emit its contents? It's worth taking into account that having two completely different complicated interfaces for recursively walking directories would be a usability challenge. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:41:10 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 12 Apr 2019 13:41:10 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1555076470.69.0.753308390048.issue36537@roundup.psfhosted.org> SilentGhost added the comment: I cannot imagine that the fix would be straightforward or that there is much use of this particular pattern. Perhaps, a note in the docs suggesting post_mortem() for except clauses over set_trace() would be more appropriate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 09:51:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 13:51:42 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1555077102.44.0.897153508459.issue36389@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:01:35 2019 From: report at bugs.python.org (weispinc) Date: Fri, 12 Apr 2019 14:01:35 +0000 Subject: [issue36614] Popen Message-ID: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> New submission from weispinc : Popen, when run on Windows server 2019 does not output binary by default. Tried Python 3.5 3.6 3.7. OK on Windows server 2016 and 1012. ---------- messages: 340044 nosy: weispinc priority: normal severity: normal status: open title: Popen type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:04:54 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 12 Apr 2019 14:04:54 +0000 Subject: [issue36614] Popen output on windows server 2019 In-Reply-To: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> Message-ID: <1555077894.7.0.347774556785.issue36614@roundup.psfhosted.org> SilentGhost added the comment: Could you add the code that you're running. ---------- components: +Library (Lib), Windows nosy: +SilentGhost, paul.moore, steve.dower, tim.golden, zach.ware title: Popen -> Popen output on windows server 2019 versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:06:01 2019 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 12 Apr 2019 14:06:01 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1555077961.03.0.972896963504.issue17267@roundup.psfhosted.org> Paul Ganssle added the comment: I am pretty neutral on this. I don't think it will be terribly difficult to implement or maintain this, and while there are a few possible behaviors, if you think about it for a bit, addition with overflow behavior *does* seem like the natural way to implement it. That said, I don't see an amazingly compelling use case for this. It's fairly rare to need to represent abstract times *at all*, and it's even more rare for performing arithmetic on those abstract times to be meaningful. I think the most dangerous aspect of this is that we might make it easier to do something that, for most people, would be the wrong thing to do. Does anyone have some examples of real-world use cases for this, so that we're not designing in a vacuum? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:07:20 2019 From: report at bugs.python.org (Kingsley McDonald) Date: Fri, 12 Apr 2019 14:07:20 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1555078040.37.0.1620967102.issue36549@roundup.psfhosted.org> Change by Kingsley McDonald : ---------- keywords: +patch pull_requests: +12731 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:08:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 14:08:38 +0000 Subject: [issue36614] Popen output on windows server 2019 In-Reply-To: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> Message-ID: <1555078118.05.0.284252290084.issue36614@roundup.psfhosted.org> STINNER Victor added the comment: > Popen, when run on Windows server 2019 does not output binary by default. What do you mean by "binary"? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:15:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 14:15:35 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1555078535.77.0.841571063842.issue36588@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9d949f7796da612f1b588d18c6f041376992a9fc by Victor Stinner (Michael Felt) in branch 'master': bpo-36588: On AIX, remove major version from sys.platform (GH-12787) https://github.com/python/cpython/commit/9d949f7796da612f1b588d18c6f041376992a9fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:16:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 14:16:10 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1555078570.78.0.0436152534953.issue36588@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:16:41 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 14:16:41 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1555078601.68.0.797030666194.issue36588@roundup.psfhosted.org> STINNER Victor added the comment: Do you want to work on a change to replace sys.platform.startswith("aix") to cleanup the stdlib and tests? Not sure if it's needed :-) It's up to you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:21:37 2019 From: report at bugs.python.org (weispinc) Date: Fri, 12 Apr 2019 14:21:37 +0000 Subject: [issue36614] Popen output on windows server 2019 In-Reply-To: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> Message-ID: <1555078897.15.0.94107124812.issue36614@roundup.psfhosted.org> Change by weispinc : Added file: https://bugs.python.org/file48264/popen.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:46:33 2019 From: report at bugs.python.org (cagney) Date: Fri, 12 Apr 2019 14:46:33 +0000 Subject: [issue36615] why call _Py_set_inheritable(0) from os.open() when O_CLOEXEC? Message-ID: <1555080393.29.0.115799834889.issue36615@roundup.psfhosted.org> New submission from cagney : When O_CLOEXEC is defined the file is opened with that flag (YA! - this means that the operation is atomic and, by default, the FD will be closed across os.posix_spawn()). However the code then goes on an executes: #ifndef MS_WINDOWS if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) { close(fd); return -1; } #endif should this also be #ifndef O_CLOEXEC? ---------- messages: 340050 nosy: cagney priority: normal severity: normal status: open title: why call _Py_set_inheritable(0) from os.open() when O_CLOEXEC? versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:50:18 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 14:50:18 +0000 Subject: [issue36615] why call _Py_set_inheritable(0) from os.open() when O_CLOEXEC? In-Reply-To: <1555080393.29.0.115799834889.issue36615@roundup.psfhosted.org> Message-ID: <1555080618.31.0.708346881956.issue36615@roundup.psfhosted.org> STINNER Victor added the comment: The Linux kernel has a bad habit of ignoring unknown flags. If your libc is recent and contains O_CLOEXEC but your Linux kernel is old and doesn't know O_CLOEXEC, the flag will be simply ignored. It can happen when a Linux distribution builds a package with a recent kernel / libc, but you run an older kernel / libc. More info in the PEP 446: https://www.python.org/dev/peps/pep-0446/#atomic-creation-of-non-inheritable-file-descriptors > if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) { Look for the atomic_flag_works: if it's 1, the function does nothing. I don't think that this issue is a bug, so I suggest to close it. The bug tracker is not the right place to ask questions ;-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:55:14 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 14:55:14 +0000 Subject: [issue32451] python -m venv activation issue when using cygwin on windows In-Reply-To: <1514607229.33.0.213398074469.issue32451@psf.upfronthosting.co.za> Message-ID: <1555080914.74.0.633289824782.issue32451@roundup.psfhosted.org> Steve Dower added the comment: It probably just needs a gitattributes fix so it doesn't get converted when cloned to make the release build. This is assuming that in all these cases people are installing Python for Windows and trying to use it from a non-Windows shell (both WSL and Cygwin have their own "native" Python builds that presumably work). I can't tell if there's something else going on here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 10:57:50 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 14:57:50 +0000 Subject: [issue36614] Popen output on windows server 2019 In-Reply-To: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> Message-ID: <1555081070.33.0.448859695641.issue36614@roundup.psfhosted.org> Steve Dower added the comment: As we haven't done anything special for WS2019 yet, this is a change in Windows (or whatever tool is outputting the text). You could report it to Microsoft. I don't know the best way to report bugs in Windows Server though, but most people with it have support contacts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:00:21 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 12 Apr 2019 15:00:21 +0000 Subject: [issue36591] Should be a typing.UserNamedTuple In-Reply-To: <1554931173.44.0.541756182017.issue36591@roundup.psfhosted.org> Message-ID: <1555081221.06.0.798196165075.issue36591@roundup.psfhosted.org> Ivan Levkivskyi added the comment: This is a duplicate of https://github.com/python/typing/issues/431 We can of course close the other issue and keep this one open, but the other one has much more discussion. So I am closing this one. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:07:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:07:08 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555081628.17.0.779795256243.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 44235041f3b957abd36d3792450c3540aa09e120 by Victor Stinner in branch 'master': bpo-18748: io.IOBase destructor now logs close() errors in dev mode (GH-12786) https://github.com/python/cpython/commit/44235041f3b957abd36d3792450c3540aa09e120 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:10:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:10:01 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555081801.11.0.280641858759.issue18748@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:17:26 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:17:26 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555082246.12.0.179027905927.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: To debug remaining "Exception ignored in:" issues, I'm using the following patch: diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 972a4658b1..be38af3daa 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -710,6 +710,7 @@ class TestCase(object): # clear the outcome, no more needed self._outcome = None + import gc; gc.collect() def doCleanups(self): """Execute all cleanup functions. Normally called for you after And I run: ./python -X dev -u -m test test_io -v 2>&1|tee log ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:18:20 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 12 Apr 2019 15:18:20 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555082300.23.0.925817542559.issue33608@roundup.psfhosted.org> Eric Snow added the comment: New changeset f13c5c8b9401a9dc19e95d8b420ee100ac022208 by Eric Snow in branch 'master': bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (gh-12360) https://github.com/python/cpython/commit/f13c5c8b9401a9dc19e95d8b420ee100ac022208 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:19:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:19:15 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555082355.79.0.22899434385.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 12805 to silence IOBase destructor exceptions in test_io. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:20:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:20:06 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555082406.11.0.576530997558.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: Is there someone interested to debug remaining "Exception ignored:" logs in test_urllib? test_invalid_redirect (test.test_urllib.urlopen_HttpTests) ... Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. ok test_read_bogus (test.test_urllib.urlopen_HttpTests) ... Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. ok test_redirect_limit_independent (test.test_urllib.urlopen_HttpTests) ... Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. Exception ignored in: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in close super().close() # set "closed" flag File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in flush self.fp.flush() ValueError: I/O operation on closed file. ok It's unclear to be if it's a bug in http.client, a bug in the test... or something else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:24:29 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 12 Apr 2019 15:24:29 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module In-Reply-To: <1555020782.09.0.948988048159.issue36608@roundup.psfhosted.org> Message-ID: <1555082669.41.0.72121645453.issue36608@roundup.psfhosted.org> Eric V. Smith added the comment: And I don't mean to sound like a total downer. I just think it's important that we recognize all of the use cases. Thanks for your work on this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:28:04 2019 From: report at bugs.python.org (Michael Felt) Date: Fri, 12 Apr 2019 15:28:04 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1555078601.68.0.797030666194.issue36588@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: On 12/04/2019 16:16, STINNER Victor wrote: > STINNER Victor added the comment: > > Do you want to work on a change to replace sys.platform.startswith("aix") to cleanup the stdlib and tests? Not sure if it's needed :-) It's up to you. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > Sure. I'll do that. I shoul open an issue along the lines of "AIX: cleanup stdlib and tests and how sys.platform is utilized". But, should I just continue standard practice (sys.platform), or would this be a moment to move towards platform.system() (i.e., set the example to be to use "run-time" rather than "build-time"). Michael ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:30:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:30:09 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555083009.77.0.371459893714.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: Maybe the fact that close() exceptions are ignored silently in io.IOBase constructor should be better documented, but I'm not sure where it should be documented. If someone has an idea, please go ahead and write a pull request :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:30:31 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 12 Apr 2019 15:30:31 +0000 Subject: [issue36610] os.sendfile can return EINVAL on Solaris In-Reply-To: <1555059394.06.0.893471228224.issue36610@roundup.psfhosted.org> Message-ID: <1555083031.51.0.366449823715.issue36610@roundup.psfhosted.org> Giampaolo Rodola' added the comment: Can you paste the traceback or are you able to reproduce the bug via a script? sendfile implementation is supposed to giveup if no data was sent on first call, so I suppose this happen later? If for any reason it turns out sendfile() is broken on Solaris or behave differently than on Linux I think I prefer to be safe than sorry and support it on Linux only. ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:34:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:34:27 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1554908690.57.0.898884397677.issue36588@roundup.psfhosted.org> Message-ID: <1555083267.95.0.233880230697.issue36588@roundup.psfhosted.org> STINNER Victor added the comment: > But, should I just continue standard practice (sys.platform), or would > this be a moment to move towards platform.system() (i.e., set the > example to be to use "run-time" rather than "build-time"). Oh, now I'm confused :-) I checked the Python test suite: some tests use sys.platform == "linux" or sys.platform in ("linux", ...), some tests uses sys.platform.startswith("linux"). In case of doubt, I suggest to do nothing :-) Leave the code unchanged :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:35:08 2019 From: report at bugs.python.org (Eryk Sun) Date: Fri, 12 Apr 2019 15:35:08 +0000 Subject: [issue32451] python -m venv activation issue when using cygwin on windows In-Reply-To: <1514607229.33.0.213398074469.issue32451@psf.upfronthosting.co.za> Message-ID: <1555083308.69.0.631949351907.issue32451@roundup.psfhosted.org> Eryk Sun added the comment: > This is assuming that in all these cases people are installing Python > for Windows and trying to use it from a non-Windows shell (both WSL > and Cygwin have their own "native" Python builds that presumably > work). It should work from Cygwin and MSYS2 since they support DOS paths in $PATH. I don't have Cygwin installed, but I tried MSYS2 bash and Git bash, and it worked fine, even with CRLF line endings. Apparently only Cygwin bash has a problem with CRLF line endings. The issue with using Windows Python in this case is that the terminals for these environments emulate Unix PTYs with named pipes (e.g. "msys-0123456789abcdef-pty0-from-master" for stdin and "msys-0123456789abcdef-pty0-to-master" for stdout and stderr). Thus isatty() is false, and interactive mode has to be forced with the `-i` command-line option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:35:48 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 15:35:48 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1555083348.83.0.867281876983.issue36549@roundup.psfhosted.org> Steve Dower added the comment: New changeset b015fc86f7b1f35283804bfee788cce0a5495df7 by Steve Dower (Kingsley M) in branch 'master': bpo-36549: str.capitalize now titlecases the first character instead of uppercasing it (GH-12804) https://github.com/python/cpython/commit/b015fc86f7b1f35283804bfee788cce0a5495df7 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:36:11 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 15:36:11 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1555083371.75.0.200412452599.issue36549@roundup.psfhosted.org> Steve Dower added the comment: Thanks! I'm a big fan of this change :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:40:10 2019 From: report at bugs.python.org (weispinc) Date: Fri, 12 Apr 2019 15:40:10 +0000 Subject: [issue36614] Popen output on windows server 2019 In-Reply-To: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> Message-ID: <1555083610.84.0.916217337225.issue36614@roundup.psfhosted.org> weispinc added the comment: The tool is outputing exactly the same file on both WS2019 and WS2016. I guess Popen is using some OS library or environment that has changed in WS2019. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:41:31 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:41:31 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555083691.06.0.480396554548.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: I have a bad news for you Eric: I'm able again to reproduce the crash at commit f13c5c8b9401a9dc19e95d8b420ee100ac022208. vstinner at freebsd$ ./python -m test --matchfile=bisect5 test_multiprocessing_spawn --fail-env-changed -F Run tests sequentially 0:00:00 load avg: 0.69 [ 1] test_multiprocessing_spawn 0:00:06 load avg: 0.80 [ 2] test_multiprocessing_spawn 0:00:12 load avg: 1.19 [ 3] test_multiprocessing_spawn ... 0:01:55 load avg: 1.48 [ 21] test_multiprocessing_spawn 0:02:01 load avg: 1.53 [ 22] test_multiprocessing_spawn 0:02:08 load avg: 1.29 [ 23] test_multiprocessing_spawn 0:02:17 load avg: 1.51 [ 24] test_multiprocessing_spawn 0:02:27 load avg: 2.27 [ 25] test_multiprocessing_spawn 0:02:38 load avg: 3.14 [ 26] test_multiprocessing_spawn 0:02:48 load avg: 3.51 [ 27] test_multiprocessing_spawn Warning -- files was modified by test_multiprocessing_spawn Before: [] After: ['python.core'] test_multiprocessing_spawn failed (env changed) == Tests result: ENV CHANGED == All 26 tests OK. 1 test altered the execution environment: test_multiprocessing_spawn Total duration: 2 min 59 sec Tests result: ENV CHANGED Note: Sorry for not testing before, after one long week, I didn't succeed to catch up with my very long list of unread emails. I don't know what should be done. Revert? I don't have the bandwidth to investigate this crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:42:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 15:42:56 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555083776.57.0.291166399548.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: I ran "./python -m test --matchfile=bisect5 test_multiprocessing_spawn --fail-env-changed -F" 4 times in parallel: in less than 5 minutes (in fact, I didn't look carefully at the terminal, maybe it was faster), I got 3 core dumps :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:49:02 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 12 Apr 2019 15:49:02 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555084142.42.0.960824097508.issue33608@roundup.psfhosted.org> Eric Snow added the comment: Thanks for checking, Victor. Don't feel bad about your results, nor about not checking sooner. :) We'll get this sorted out. For now I'll revert. This is not code that changes very often, so there isn't much benefit to keeping it merged. Testing against a separate branch is just as easy. Could you point me at an immage for that VM or instructions on how to reproduce it? I hate having to bother you to test my changes! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:51:21 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 15:51:21 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555084281.79.0.690581962085.issue36602@roundup.psfhosted.org> Steve Dower added the comment: Having spent more time than I'm proud of recursing through directories, I'd be happy enough with a convenience function that has sensible defaults. If I want breadth-first recursion (and I often do), I'll write it myself. I have a slight preference for getting all files in a directory before going deeper (which is not what the PR does), and I think that's most consistent with the current behaviour. I don't spend enough time dealing with symlinks to have strong opinions there, but given we have ways to resolve symlinks but not to get back to the original name (and I *have* had to deal with issues where I've needed to find the original name from the target :roll-eyes:) I'd say don't resolve anything eagerly. If there's an easy and well-known algorithm for detecting infinite symlink recursion (e.g. resolve and check if it's a parent of itself) then do that and skip it, but don't return the targets. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:51:37 2019 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 12 Apr 2019 15:51:37 +0000 Subject: [issue34652] never enable lchmod on Linux In-Reply-To: <1536788618.14.0.956365154283.issue34652@psf.upfronthosting.co.za> Message-ID: <1555084297.88.0.201527170335.issue34652@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9 by Benjamin Peterson (Joshua Root) in branch '2.7': bpo-34652: Use AC_CHECK_FUNCS for lchmod. (GH-12799) https://github.com/python/cpython/commit/0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:57:51 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 12 Apr 2019 15:57:51 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555084671.89.0.206908144132.issue33608@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +12733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 11:59:11 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 15:59:11 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1555084751.62.0.225039596345.issue36601@roundup.psfhosted.org> Steve Dower added the comment: Looks like Guido added the original code about 25 years ago. Since he removed himself from the other thread during that discussion, I'm going to assume he's not interested in thinking about it any more. As the original comment says, it's a hack, but I guess there may have been an OS around at the time that would deliver signals across processes? Maybe after fork? It might be worth pinging python-dev briefly just to check if anyone there knows of an OS that might do this. That said, the comment change in the PR looks totally fine to me. I'm just hesitant to remove something that's apparently been working for a quarter of a century ;) ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:02:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 16:02:40 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555084960.43.0.753952453483.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: Eric Snow: > For now I'll revert. This is not code that changes very often, so there isn't much benefit to keeping it merged. Testing against a separate branch is just as easy. Again, Python shutdown is *really* fragile. Last time I tried to "enhance" it, I also introduced random regressions and so I had to revert my changes. Old info about the crash, should still be relevant: https://bugs.python.org/issue36114#msg337090 > Could you point me at an immage for that VM or instructions on how to reproduce it? I hate having to bother you to test my changes! :) *In theory*, you should be able to reproduce the crash on any platform. But in my experience, bugs which involve multiple threads are simply "more likely" on FreeBSD because FreeBSD manages threads very differently than Linux. Sometimes, a bug can only be reproduce on one specific FreeBSD computer, but once the root issue has been identified, we start to be able to trigger the crash reliably on other platforms (like Linux). My procedure to reproduce the crash on FreeBSD: https://bugs.python.org/issue36114#msg337092 I'm using FreeBSD 12.0 RELEASE VM hosted on Linux. My FreeBSD is not customized in any way. On modern Linux distributions, coredumps are no longer written in the current directory but handled by a system service like ABRT on Fedora. For this reason, Python test runner can "miss" crashes, especially in child processes run by tests (not directly in the process used to run the test). To get a coredump in the current directory on Linux, you can use: sudo bash -c 'echo "%e.%p" > /proc/sys/kernel/core_pattern' Manual test: $ ./python -c 'import ctypes; ctypes.string_at(0)' Segmentation fault (core dumped) vstinner at apu$ git status ... Untracked files: python.18343 ... Say hello to python.18343 coredump! Usually, running the command which trigger the crash multiple times in parallel (in different terminals, using screen and multiple terminals, etc.) makes the crash more likely since it does stress the system. Sometimes, I run the Python test suite in parallel to stress the system even more. The goal of the game is to trigger a race condition which depends on time. Stressing the system helps to "randomize" timings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:06:23 2019 From: report at bugs.python.org (Sam Dunster) Date: Fri, 12 Apr 2019 16:06:23 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555085183.08.0.970785980048.issue36607@roundup.psfhosted.org> Change by Sam Dunster : ---------- nosy: +sdunster _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:11:35 2019 From: report at bugs.python.org (Giampaolo Rodola') Date: Fri, 12 Apr 2019 16:11:35 +0000 Subject: [issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR In-Reply-To: <1553964458.43.0.741059488448.issue36488@roundup.psfhosted.org> Message-ID: <1555085495.33.0.15870645669.issue36488@roundup.psfhosted.org> Change by Giampaolo Rodola' : ---------- keywords: +patch pull_requests: +12734 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:14:06 2019 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 12 Apr 2019 16:14:06 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1555085646.99.0.311854704828.issue36549@roundup.psfhosted.org> Zackery Spytz added the comment: I think that the PR may have been merged too quickly. Serhiy had made a list, and I think that the PR was missing some necessary changes. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:20:15 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 12 Apr 2019 16:20:15 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555086015.71.0.394152178354.issue33608@roundup.psfhosted.org> Eric Snow added the comment: New changeset b75b1a3504a0cea6fac6ecba44c10b2629577025 by Eric Snow in branch 'master': bpo-33608: Revert "Factor out a private, per-interpreter _Py_AddPendingCall()." (gh-12806) https://github.com/python/cpython/commit/b75b1a3504a0cea6fac6ecba44c10b2629577025 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:21:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 16:21:06 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1555086066.03.0.271028678798.issue36601@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:25:26 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 12 Apr 2019 16:25:26 +0000 Subject: [issue36616] Optimize thread state handling in function call code Message-ID: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> New submission from Jeroen Demeyer : The bytecode interpreter uses an inline function call_function() to handle most function calls. To check for profiling, call_function() needs to call to PyThreadState_GET(). In the reference implementation of PEP 590, I saw that we can remove these PyThreadState_GET() calls by passing the thread state from the main eval loop to call_function(). I suggest to apply this optimization now, because they make sense independently of PEP 580 and PEP 590 and to give a better baseline for performance comparisons. ---------- components: Interpreter Core messages: 340078 nosy: Mark.Shannon, jdemeyer, petr.viktorin priority: normal severity: normal status: open title: Optimize thread state handling in function call code versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:25:47 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 12 Apr 2019 16:25:47 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555086347.92.0.8566577354.issue36616@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:26:23 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 16:26:23 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555086383.87.0.245353480448.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: I tried but failed to reproduce the crash on Linux!? $ sudo bash -c 'echo "%e.%p" > /proc/sys/kernel/core_pattern' $ ./python -m test --matchfile=bisect5 test_multiprocessing_spawn --fail-env-changed -F # wait 5 min ^C $ ./python -m test --matchfile=bisect5 -j0 test_multiprocessing_spawn --fail-env-changed -F # I added -j0 # wait 5 min ^C $ ./python -m test --matchfile=bisect5 -j0 test_multiprocessing_spawn --fail-env-changed -F # I added -j0 # wait 5 min ^C No coredump seen... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:27:15 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 16:27:15 +0000 Subject: [issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX In-Reply-To: <1554698296.6.0.519379747153.issue36552@roundup.psfhosted.org> Message-ID: <1555086435.28.0.0419214339433.issue36552@roundup.psfhosted.org> Steve Dower added the comment: We should at least have consistent error messages: >>> class O: ... def __len__(self): ... return 2**100 ... >>> o=O() >>> len(o) Traceback (most recent call last): File "", line 1, in OverflowError: cannot fit 'int' into an index-sized integer I'd argue for replacing 'int' here with the rendered value, but I think OverflowError is the right type. Mentioning "C ssize_t" is the problem. As for the list constructor, I'd be okay with chaining a MemoryError here, provided the OverflowError sticks around. But in this context a MemoryError is "recoverable" while an OverflowError very likely indicates a programming error, so we shouldn't hide it from the user. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:35:03 2019 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 12 Apr 2019 16:35:03 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1555086903.65.0.164637708494.issue36601@roundup.psfhosted.org> Guido van Rossum added the comment: IIRC in SGI, getpid() would return the thread ID. They had a syscall that could create a new subprocess that would share or not share various resources (e.g. memory, signals, file descriptors) so by setting or clearing bits you could implement a continuum of variations between fork and thread creation (for thread creation you'd share everything). Maybe a similar thing exists in Linux? But IRIX is dead so I think it's safe to kill. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:37:15 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 16:37:15 +0000 Subject: [issue36513] Add support for building arm32 nuget package Message-ID: <1555087035.63.0.406094156846.issue36513@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:43:07 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 16:43:07 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555087387.89.0.0929904602943.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: FYI AMD64 FreeBSD CURRENT Shared 3.x failed at commit f13c5c8b9401a9dc19e95d8b420ee100ac022208: https://buildbot.python.org/all/#/builders/168/builds/913 But this issue has already been fixed: Eric reverted his change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 12:56:00 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 16:56:00 +0000 Subject: [issue36509] Add iot layout for windows iot containers In-Reply-To: <1554224379.78.0.511205388496.issue36509@roundup.psfhosted.org> Message-ID: <1555088160.44.0.860868389172.issue36509@roundup.psfhosted.org> Steve Dower added the comment: New changeset f4e5661e85ac41c987165246d2b33f363cd01e34 by Steve Dower (Paul Monson) in branch 'master': bpo-36509: Add iot layout for Windows IoT containers (GH-12663) https://github.com/python/cpython/commit/f4e5661e85ac41c987165246d2b33f363cd01e34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:07:05 2019 From: report at bugs.python.org (Dan Snider) Date: Fri, 12 Apr 2019 17:07:05 +0000 Subject: [issue36617] The rich comparison operators are second class citizens Message-ID: <1555088825.83.0.858105919161.issue36617@roundup.psfhosted.org> New submission from Dan Snider : The rich comparison operators have an (far as I can tell, unnecessary) limitation compared to the other binary operators, being that the result of an unparenthesized comparison expression cannot be unpacked using the *iterable "unpack" operator (does that thing have an official name?) Here's a silly demonstration of what I'm talking about: >>> if 1: ... parser.expr("[*+-~d< Traceback (most recent call last): File "", line 3, in File "", line 1 [*+-~d<=b-~+_] ^ SyntaxError: invalid syntax >>> if 1: ... parser.expr("f(*+d<<-b)") ... parser.expr("f(*+d<=-b)") ... Because the limitation is not present for function calls, I suspect this is simply a "typo" that's gone unnoticed for years, due to nobody ever trying it. I'm hardly an expert on the parser and can barely read the grammar file so i might be totally wrong here. But then, what would be the difference between the expressions: [*a+b+c+d, *e-f] and [*a>> class S(list): __lt__ = list.__add__ ---------- messages: 340084 nosy: bup priority: normal severity: normal status: open title: The rich comparison operators are second class citizens _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:17:09 2019 From: report at bugs.python.org (Eryk Sun) Date: Fri, 12 Apr 2019 17:17:09 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1555089429.74.0.103933201967.issue36601@roundup.psfhosted.org> Eryk Sun added the comment: > Maybe a similar thing exists in Linux? Back in the late 90s, Linux implemented threads as 'processes' (LinuxThreads), but with shared resources such as virtual memory and file descriptors. (The Linux kernel's clone system call is highly composable in this regard.) Thus getpid() was different for each thread in a process and kill() could target a particular thread-process. I guess it was a problem if Ctrl+C in a terminal would send SIGINT to every thread-process associated with the terminal. Eventually, for scalability and POSIX compliance, Linux abandoned the LinuxThreads implementation. It evolved kernel process IDs into thread IDs and a new concept called a thread group emerged. Nowadays all threads in a process are in the same thread group, and the PID returned by getpid() is the thread-group ID (TGID), which is the thread ID (TID) of the first thread in the process. clone() defaults to creating a new process (thread group), unless CLONE_THREAD is specified. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:23:05 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 17:23:05 +0000 Subject: [issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a) In-Reply-To: <1549503926.32.0.191493141556.issue35925@roundup.psfhosted.org> Message-ID: <1555089785.02.0.927806465064.issue35925@roundup.psfhosted.org> Steve Dower added the comment: This is still failing regularly - any progress? Do we need to skip tests? ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:36:22 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 17:36:22 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes Message-ID: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> New submission from STINNER Victor : On x86-64, clang -O3 compiles the following function: PyCArgObject * PyCArgObject_new(void) { PyCArgObject *p; p = PyObject_New(PyCArgObject, &PyCArg_Type); if (p == NULL) return NULL; p->pffi_type = NULL; p->tag = '\0'; p->obj = NULL; memset(&p->value, 0, sizeof(p->value)); return p; } like that: 0x00007fffe9c6acb0 <+0>: push rax 0x00007fffe9c6acb1 <+1>: mov rdi,QWORD PTR [rip+0xe308] # 0x7fffe9c78fc0 0x00007fffe9c6acb8 <+8>: call 0x7fffe9c5e8a0 <_PyObject_New at plt> 0x00007fffe9c6acbd <+13>: test rax,rax 0x00007fffe9c6acc0 <+16>: je 0x7fffe9c6acdf 0x00007fffe9c6acc2 <+18>: mov QWORD PTR [rax+0x20],0x0 0x00007fffe9c6acca <+26>: mov BYTE PTR [rax+0x28],0x0 0x00007fffe9c6acce <+30>: xorps xmm0,xmm0 0x00007fffe9c6acd1 <+33>: movaps XMMWORD PTR [rax+0x30],xmm0 0x00007fffe9c6acd5 <+37>: mov QWORD PTR [rax+0x40],0x0 0x00007fffe9c6acdd <+45>: pop rcx 0x00007fffe9c6acde <+46>: ret 0x00007fffe9c6acdf <+47>: xor eax,eax 0x00007fffe9c6ace1 <+49>: pop rcx 0x00007fffe9c6ace2 <+50>: ret The problem is that movaps requires the memory address to be aligned on 16 bytes, whereas PyObject_New() uses pymalloc allocator (the requested size is 80 bytes, pymalloc supports allocations up to 512 bytes) and pymalloc only provides alignment on 8 bytes. If PyObject_New() returns an address not aligned on 16 bytes, PyCArgObject_new() crash immediately with a segmentation fault (SIGSEGV). CPython must be compiled using -fmax-type-align=8 to avoid such alignment crash. Using this compiler flag, clag emits expected machine code: 0x00007fffe9caacb0 <+0>: push rax 0x00007fffe9caacb1 <+1>: mov rdi,QWORD PTR [rip+0xe308] # 0x7fffe9cb8fc0 0x00007fffe9caacb8 <+8>: call 0x7fffe9c9e8a0 <_PyObject_New at plt> 0x00007fffe9caacbd <+13>: test rax,rax 0x00007fffe9caacc0 <+16>: je 0x7fffe9caacdf 0x00007fffe9caacc2 <+18>: mov QWORD PTR [rax+0x20],0x0 0x00007fffe9caacca <+26>: mov BYTE PTR [rax+0x28],0x0 0x00007fffe9caacce <+30>: xorps xmm0,xmm0 0x00007fffe9caacd1 <+33>: movups XMMWORD PTR [rax+0x30],xmm0 0x00007fffe9caacd5 <+37>: mov QWORD PTR [rax+0x40],0x0 0x00007fffe9caacdd <+45>: pop rcx 0x00007fffe9caacde <+46>: ret 0x00007fffe9caacdf <+47>: xor eax,eax 0x00007fffe9caace1 <+49>: pop rcx 0x00007fffe9caace2 <+50>: ret "movaps" instruction becomes "movups" instruction: "a" stands for "aligned" in movaps, whereas "u" stands for "unaligned" in movups. ---------- components: Build messages: 340087 nosy: vstinner priority: normal severity: normal status: open title: clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:37:31 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 12 Apr 2019 17:37:31 +0000 Subject: [issue36617] The rich comparison operators are second class citizens In-Reply-To: <1555088825.83.0.858105919161.issue36617@roundup.psfhosted.org> Message-ID: <1555090651.59.0.0681425982239.issue36617@roundup.psfhosted.org> Steven D'Aprano added the comment: Sorry, I don't understand your demonstration. What's the mystery ``parser`` object with an ``expr`` method? What is it doing? Your comment says "all binary/unary number ops work" but I don't know what you mean by "work". Could you show some plain, vanilla Python code that demonstrates the problem? >From your description here: > an unparenthesized comparison expression cannot be unpacked using > the *iterable "unpack" operator it sounds like you are talking about an operator precedence issue. Am I close? But I think you are wrong: py> print(*[] < [1, 2]) Traceback (most recent call last): File "", line 1, in TypeError: print() argument after * must be an iterable, not bool suggests that the < operator is evaluated before trying to unpack. Let's try with something else: class X: def __lt__(self, other): return [1, 2, 3] py> print(*X() < None) 1 2 3 Perhaps I have misunderstood something. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:41:55 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 12 Apr 2019 17:41:55 +0000 Subject: [issue36617] The rich comparison operators are second class citizens In-Reply-To: <1555088825.83.0.858105919161.issue36617@roundup.psfhosted.org> Message-ID: <1555090915.36.0.833108997801.issue36617@roundup.psfhosted.org> SilentGhost added the comment: It seems to be parser module. https://docs.python.org/3/library/parser.html#creating-st-objects ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:42:18 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 17:42:18 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555090938.48.0.443964742712.issue36618@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:46:24 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 12 Apr 2019 17:46:24 +0000 Subject: [issue19417] Bdb: add a unittest file (test.test_bdb) In-Reply-To: <1382896308.72.0.45441786626.issue19417@psf.upfronthosting.co.za> Message-ID: <1555091184.4.0.780788297618.issue19417@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- dependencies: -Bdb: add docstrings resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:52:43 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 17:52:43 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555091563.87.0.547025276729.issue36618@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12735 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:53:46 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 12 Apr 2019 17:53:46 +0000 Subject: [issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a) In-Reply-To: <1549503926.32.0.191493141556.issue35925@roundup.psfhosted.org> Message-ID: <1555091626.14.0.65350667165.issue35925@roundup.psfhosted.org> Gregory P. Smith added the comment: While altering the environment to not use the system default openssl config is an option to make this green again today very easily. That'd "solve" the red bot problem and nothing else. :/ Doing that just kicks the can down the road as all of us Linux users are going to face this problem when we start using modern OS distros to build and test CPython. A skipped test is an ignored test. Ideally I'd like to see the tests updated to comply with modern higher security openssl config constraints. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 13:58:10 2019 From: report at bugs.python.org (cagney) Date: Fri, 12 Apr 2019 17:58:10 +0000 Subject: [issue36619] when is os.posix_spawn(setsid=True) safe? Message-ID: <1555091890.2.0.391429247327.issue36619@roundup.psfhosted.org> New submission from cagney : How can I detect that os.posix_spawn(setsid=True) is available at runtime? I'd like to use os.posix_spawn(setsid=True) when it is available, and (assuming I'm getting this right) os.posix_spawn(setpgroup=0) as a poor fallback. ---------- components: IO messages: 340091 nosy: cagney priority: normal severity: normal status: open title: when is os.posix_spawn(setsid=True) safe? type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:06:53 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 18:06:53 +0000 Subject: [issue36609] activate.ps1 in venv for Windows should encoded with BOM In-Reply-To: <1555057621.3.0.569629165063.issue36609@roundup.psfhosted.org> Message-ID: <1555092413.16.0.693775259235.issue36609@roundup.psfhosted.org> Steve Dower added the comment: Seems reasonable. The most reliable way to do this will be to override the copy function for this file in venv and write it out with "utf-8-sig" encoding. There are many ways that git will break things like this, so I wouldn't trust it to simply accept a modified file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:08:58 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 18:08:58 +0000 Subject: [issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows In-Reply-To: <1396262123.2.0.239412802273.issue21110@psf.upfronthosting.co.za> Message-ID: <1555092538.13.0.168190224713.issue21110@roundup.psfhosted.org> Steve Dower added the comment: Never heard of it, but perhaps there are some preprocessor checks for Windows that assume you are using MSVC and not gcc? We don't support compilers other than MSVC on Windows, but if someone has a fix for this I'm happy to consider it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:13:17 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 18:13:17 +0000 Subject: [issue25361] Is python-3-5-0.exe compiled with SSE2 instrutions? If so should we mention this? In-Reply-To: <1444473804.35.0.126289501902.issue25361@psf.upfronthosting.co.za> Message-ID: <1555092797.65.0.899660340564.issue25361@roundup.psfhosted.org> Steve Dower added the comment: For 3.8 we support as far back as Win7 SP1 with the update for secure DLL loading, neither of which require SSE2. So we should hold this for 3.9 when we drop Win7 completely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:42:11 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 18:42:11 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1555094531.14.0.908515293102.issue36549@roundup.psfhosted.org> Steve Dower added the comment: What is missing? It looks like everything on Serhiy's list was done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:43:26 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 18:43:26 +0000 Subject: [issue36549] str.capitalize should titlecase the first character not uppercase In-Reply-To: <1554633651.74.0.204071668882.issue36549@roundup.psfhosted.org> Message-ID: <1555094606.65.0.325943499305.issue36549@roundup.psfhosted.org> Steve Dower added the comment: Oh, apart from the What's New section. But this looks enough like a bugfix (previous behaviour "wasn't capitalizing my name correctly" - new behaviour "now capitalizes my name correctly") that it's hardly critical to advertise it on that page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:46:32 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 18:46:32 +0000 Subject: [issue36614] Popen output on windows server 2019 In-Reply-To: <1555077694.98.0.0934543483823.issue36614@roundup.psfhosted.org> Message-ID: <1555094792.14.0.220889301883.issue36614@roundup.psfhosted.org> Steve Dower added the comment: > I guess Popen is using some OS library or environment that has changed in WS2019. Yep, which is why the report should go to those responsible for WS2019. If they say it's an intentional change and users are supposed to work around it themselves, then we can do a workaround, but if it's unintentional then they should fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 14:52:29 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 12 Apr 2019 18:52:29 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1555095149.76.0.169345389657.issue36601@roundup.psfhosted.org> Gregory P. Smith added the comment: We can remove ancient Irix and LinuxThreads hacks from our codebase. The best way to shake issues of this sort out is to remove it and watch for issues on supported buildbots and during beta releases. I don't expect any fallout from this one. Other places this check _could_ have come up without us realizing it... if a signal handler setup persisted into a quasi-forked process (vfork) this check would prevent that oddball dangerous state of a child process from doing signal processing until after _PySignal_AfterFork was called to reset main_pid. but trip_signal() is already safe in crazy async signal safe contexts so I don't see a problem there. if it happened to write to a wakeup.fd that was shared by the parent and child even that shouldn't be an issue. A vfork()ed process is about to exec or die anyways (no other actions are supported) - never go back to running Python code. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 15:15:40 2019 From: report at bugs.python.org (Dmitrii Pasechnik) Date: Fri, 12 Apr 2019 19:15:40 +0000 Subject: [issue36106] resolve sinpi() name clash with libm In-Reply-To: <1551102423.19.0.037549170544.issue36106@roundup.psfhosted.org> Message-ID: <1555096540.57.0.75532596485.issue36106@roundup.psfhosted.org> Dmitrii Pasechnik added the comment: Can this also be backported to 3.5. and 3.6, as requested by FreeBSD maintainers? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 15:27:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 19:27:49 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555097269.27.0.390853917423.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 23a683adf803eef405d248cc9c2a7eb08a7300e2 by Victor Stinner in branch 'master': bpo-36618: Add -fmax-type-align=8 flag for clang (GH-12809) https://github.com/python/cpython/commit/23a683adf803eef405d248cc9c2a7eb08a7300e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 15:51:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 19:51:37 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1555098697.97.0.92547130441.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0fc91eef34a1d9194904fa093c9fbd711af0f26c by Victor Stinner in branch 'master': bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803) https://github.com/python/cpython/commit/0fc91eef34a1d9194904fa093c9fbd711af0f26c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 15:53:42 2019 From: report at bugs.python.org (Matthew Barnett) Date: Fri, 12 Apr 2019 19:53:42 +0000 Subject: [issue32308] Replace empty matches adjacent to a previous non-empty match in re.sub() In-Reply-To: <1513189718.03.0.213398074469.issue32308@psf.upfronthosting.co.za> Message-ID: <1555098822.5.0.173925374861.issue32308@roundup.psfhosted.org> Matthew Barnett added the comment: Consider re.findall(r'.{0,2}', 'abcde'). It finds 'ab', then continues where it left off to find 'cd', then 'e'. It can also find ''; re.match(r'.*', '') does match, after all. It could, in fact, an infinite number of ''. And what about re.match(r'()*', '')? What should it do? Run forever? Raise an exception? At some point you have to make a decision as to what should happen, and the general consensus has been to match once. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 15:54:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 19:54:10 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555098850.03.0.256866856732.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e8f9acf03484c6c3f163f04a76321419369c28aa by Victor Stinner in branch 'master': bpo-36611: Disable serialno field of debug memory allocators (#12796) https://github.com/python/cpython/commit/e8f9acf03484c6c3f163f04a76321419369c28aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 15:58:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 19:58:27 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1555099107.63.0.807196507023.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 472f794a33221ea835a2fbf6c9f12aa2bd66d1b0 by Victor Stinner in branch 'master': bpo-18748: test_io: silence destructor errors (GH-12805) https://github.com/python/cpython/commit/472f794a33221ea835a2fbf6c9f12aa2bd66d1b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:01:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 20:01:03 +0000 Subject: [issue36611] Debug memory allocators: remove useless "serialno" field to reduce memory footprint In-Reply-To: <1555064194.89.0.870992246861.issue36611@roundup.psfhosted.org> Message-ID: <1555099263.9.0.228846816153.issue36611@roundup.psfhosted.org> STINNER Victor added the comment: We decided to only disable the code by default, but the code stays until we are sure that nobody uses it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:07:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 20:07:12 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555099632.25.0.449555647538.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: I merged a "workaround" in the master branch. Python 2.7 and 3.7 are also affected, but I prefer to wait to see if the change goes through buildbots. The real fix would be to modify pymalloc to use 16-byte alignement, but that's a more complex issue :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:09:17 2019 From: report at bugs.python.org (Charles Merriam) Date: Fri, 12 Apr 2019 20:09:17 +0000 Subject: [issue36620] Documentation missing parameter for Itertools.zip_longest Message-ID: <1555099757.43.0.201440165942.issue36620@roundup.psfhosted.org> New submission from Charles Merriam : On page: https://docs.python.org/3.8/library/itertools.html In the heading summary, in the "Iterators terminating on the shortest input sequence:" section, in the "zip_longest()" table row, in the "Arguments" column, the text "p, q, ..." should be "p, q, ... [, fillvalue=None]" ---------- assignee: docs at python components: Documentation messages: 340107 nosy: CharlesMerriam, docs at python priority: normal severity: normal status: open title: Documentation missing parameter for Itertools.zip_longest type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:10:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 20:10:58 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555099858.73.0.656939690596.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: Note to myself: "Sadly, the flag must be expected to CFLAGS and not just CFLAGS_NODIST, ..." It should be "Sadly, the flag must be *set* to CFLAGS and not just CFLAGS_NODIST, ..." :-( I should fix the NEWS entry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:13:14 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 12 Apr 2019 20:13:14 +0000 Subject: [issue36620] Documentation missing parameter for Itertools.zip_longest In-Reply-To: <1555099757.43.0.201440165942.issue36620@roundup.psfhosted.org> Message-ID: <1555099994.95.0.0146819766886.issue36620@roundup.psfhosted.org> Change by SilentGhost : ---------- stage: -> needs patch versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:27:58 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 20:27:58 +0000 Subject: [issue28809] mention asyncio.gather non-deterministic task starting order In-Reply-To: <1480183522.09.0.687431688906.issue28809@psf.upfronthosting.co.za> Message-ID: <1555100878.2.0.0406821840225.issue28809@roundup.psfhosted.org> Cheryl Sabella added the comment: I believe the issue mentioned here was addressed by the doc rewrite in issue 33649. I'm going to mark this as a duplicate of that issue, but if the concern here still exists, then please re-open this issue. ---------- nosy: +cheryl.sabella resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio docs overhaul _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:33:52 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 20:33:52 +0000 Subject: [issue36106] resolve sinpi() name clash with libm In-Reply-To: <1551102423.19.0.037549170544.issue36106@roundup.psfhosted.org> Message-ID: <1555101232.56.0.292773222191.issue36106@roundup.psfhosted.org> Cheryl Sabella added the comment: I'll nosy Ned as the release manager about the request to 3.6. ---------- nosy: +cheryl.sabella, ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 16:35:45 2019 From: report at bugs.python.org (Jordan Hueckstaedt) Date: Fri, 12 Apr 2019 20:35:45 +0000 Subject: [issue36621] shutil.rmtree follows junctions on windows Message-ID: <1555101345.3.0.431387403068.issue36621@roundup.psfhosted.org> New submission from Jordan Hueckstaedt : shutil.rmtree follows junctions / reparse points on windows and will delete files in the target link directory. ---------- components: IO, Windows messages: 340111 nosy: Jordan Hueckstaedt, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: shutil.rmtree follows junctions on windows versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 17:16:21 2019 From: report at bugs.python.org (Michael Felt) Date: Fri, 12 Apr 2019 21:16:21 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <1555083267.95.0.233880230697.issue36588@roundup.psfhosted.org> Message-ID: <3c5bf290-35a7-4a5c-8620-6a2f047393a4@felt.demon.nl> Michael Felt added the comment: On 12/04/2019 17:34, STINNER Victor wrote: > STINNER Victor added the comment: > >> But, should I just continue standard practice (sys.platform), or would >> this be a moment to move towards platform.system() (i.e., set the >> example to be to use "run-time" rather than "build-time"). > Oh, now I'm confused :-) I checked the Python test suite: some tests use sys.platform == "linux" or sys.platform in ("linux", ...), some tests uses sys.platform.startswith("linux"). > > In case of doubt, I suggest to do nothing :-) Leave the code unchanged :-) Agreed, in case of doubt - leave alone (never change a winning team). And, to make it a short reply - I'll get started, and we see where it leads us. Michael > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 17:27:16 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 21:27:16 +0000 Subject: [issue36620] Documentation missing parameter for Itertools.zip_longest In-Reply-To: <1555099757.43.0.201440165942.issue36620@roundup.psfhosted.org> Message-ID: <1555104436.13.0.755841693909.issue36620@roundup.psfhosted.org> Cheryl Sabella added the comment: Good catch! In the same section, accumulate() is missing the `initial` argument. Would you be interested in submitting a pull request for this? ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 17:32:55 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 12 Apr 2019 21:32:55 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1555104775.19.0.405521672247.issue36537@roundup.psfhosted.org> Xavier de Gaye added the comment: > Now, I need to *inconveniently* put some dummy code after the ser_trace call every time I want to access the exception inside the except block Knowing that pdb stops just before the interpreter executes the line after pdb.set_trace(), what prevents you from writing the pdb.set_trace() statement before the last line of the except clause ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 17:57:16 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 12 Apr 2019 21:57:16 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1555106236.25.0.487264896365.issue19113@roundup.psfhosted.org> Xavier de Gaye added the comment: Still fails on Python 3.8.0a3+. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:01:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:01:30 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555106490.29.0.865447024169.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: Oh, it seems like the change broke the FreeBSD 10 buildbot :-( https://buildbot.python.org/all/#/builders/167/builds/769 ... checking for makedev... no checking for le64toh... no checking for mode_t... no checking for off_t... no checking for pid_t... no checking for size_t... no checking for uid_t in sys/types.h... yes checking for ssize_t... no checking for __uint128_t... no checking size of int... 0 checking size of long... 0 checking size of long long... 0 checking size of void *... 0 checking size of short... 0 checking size of float... 0 checking size of double... 0 checking size of fpos_t... 0 checking size of size_t... 0 checking size of pid_t... 0 checking size of uintptr_t... 0 checking for long double... yes configure: error: in `/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build': configure: error: cannot compute sizeof (long double) See `config.log' for more details -- On the previous build, the output looked fine: https://buildbot.python.org/all/#/builders/167/builds/768 ... checking size of int... 4 checking size of long... 8 checking size of long long... 8 checking size of void *... 8 checking size of short... 2 checking size of float... 4 checking size of double... 8 checking size of fpos_t... 8 checking size of size_t... 8 checking size of pid_t... 4 checking size of uintptr_t... 8 checking for long double... yes checking size of long double... 16 pythoninfo: CC.version: FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 os.uname: posix.uname_result(sysname='FreeBSD', nodename='10-STABLE-amd64.elysium', release='10.4-STABLE', version='FreeBSD 10.4-STABLE #1 r337021: Wed Aug 1 15:12:48 AEST 2018 root at 10-STABLE-amd64.elysium:/usr/obj/usr/src/sys/GENERIC', machine='amd64') platform.platform: FreeBSD-10.4-STABLE-amd64-64bit-ELF ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:11:55 2019 From: report at bugs.python.org (Skip Montanaro) Date: Fri, 12 Apr 2019 22:11:55 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1555107115.69.0.126441508362.issue17267@roundup.psfhosted.org> Change by Skip Montanaro : ---------- nosy: -skip.montanaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:20:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:20:10 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555107610.66.0.408154768797.issue36618@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:24:17 2019 From: report at bugs.python.org (Saim Raza) Date: Fri, 12 Apr 2019 22:24:17 +0000 Subject: [issue36537] except statement block incorrectly assumes end of scope(?). In-Reply-To: <1554489816.2.0.715067150447.issue36537@roundup.psfhosted.org> Message-ID: <1555107857.17.0.151783097248.issue36537@roundup.psfhosted.org> Saim Raza added the comment: > Knowing that pdb stops just before the interpreter executes the line after pdb.set_trace(), what prevents you from writing the pdb.set_trace() statement before the last line of the except clause ? Of course, that can be done. The issue here is to get the correct and expected behavior from pdb/ipdb. On a similar note, users might want to put just the set_trace() call and no other code in the block while writing the code or during debugging the exception caught. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:26:52 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 22:26:52 +0000 Subject: [issue33922] [Windows] Document the launcher's -64 suffix In-Reply-To: <1529538222.45.0.56676864532.issue33922@psf.upfronthosting.co.za> Message-ID: <1555108012.09.0.894939944645.issue33922@roundup.psfhosted.org> Steve Dower added the comment: New changeset 1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 by Steve Dower (mrh1997) in branch 'master': bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849) https://github.com/python/cpython/commit/1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:26:52 2019 From: report at bugs.python.org (Steve Dower) Date: Fri, 12 Apr 2019 22:26:52 +0000 Subject: [issue30291] Allow windows launcher to specify bit lengths with & without minor version In-Reply-To: <1494064652.52.0.930357680293.issue30291@psf.upfronthosting.co.za> Message-ID: <1555108012.18.0.598130432805.issue30291@roundup.psfhosted.org> Steve Dower added the comment: New changeset 1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 by Steve Dower (mrh1997) in branch 'master': bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849) https://github.com/python/cpython/commit/1e2ad6c275d2b09e76b7cbba7281d5a125a593c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:26:59 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 22:26:59 +0000 Subject: [issue33922] [Windows] Document the launcher's -64 suffix In-Reply-To: <1529538222.45.0.56676864532.issue33922@psf.upfronthosting.co.za> Message-ID: <1555108019.13.0.0233166594411.issue33922@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch pull_requests: +12737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:26:59 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 22:26:59 +0000 Subject: [issue30291] Allow windows launcher to specify bit lengths with & without minor version In-Reply-To: <1494064652.52.0.930357680293.issue30291@psf.upfronthosting.co.za> Message-ID: <1555108019.19.0.596091070804.issue30291@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:32:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:32:05 +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: <1555108325.63.0.497153388612.issue27987@roundup.psfhosted.org> STINNER Victor added the comment: While this issue looked purely theorical to me 3 years ago, it is now very concrete: bpo-36618 "clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:32:37 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 22:32:37 +0000 Subject: [issue33922] [Windows] Document the launcher's -64 suffix In-Reply-To: <1529538222.45.0.56676864532.issue33922@psf.upfronthosting.co.za> Message-ID: <1555108357.26.0.85174915162.issue33922@roundup.psfhosted.org> miss-islington added the comment: New changeset 395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee by Miss Islington (bot) in branch '3.7': bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849) https://github.com/python/cpython/commit/395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:32:37 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 22:32:37 +0000 Subject: [issue30291] Allow windows launcher to specify bit lengths with & without minor version In-Reply-To: <1494064652.52.0.930357680293.issue30291@psf.upfronthosting.co.za> Message-ID: <1555108357.33.0.14932821173.issue30291@roundup.psfhosted.org> miss-islington added the comment: New changeset 395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee by Miss Islington (bot) in branch '3.7': bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849) https://github.com/python/cpython/commit/395bb94a7f1c3ec9c29976738dfc6cb5d31f9aee ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:33:43 2019 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 12 Apr 2019 22:33:43 +0000 Subject: [issue35581] Document @typing.type_check_only In-Reply-To: <1545742357.2.0.712150888896.issue35581@roundup.psfhosted.org> Message-ID: <1555108423.76.0.620744952868.issue35581@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 1e8295402bf5e81d327ed2b5eb88a6b6de449d63 by Guido van Rossum (Sebastian Rittau) in branch 'master': bpo-35581: Document @typing.type_check_only (GH-11312) https://github.com/python/cpython/commit/1e8295402bf5e81d327ed2b5eb88a6b6de449d63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:34:24 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 22:34:24 +0000 Subject: [issue35581] Document @typing.type_check_only In-Reply-To: <1545742357.2.0.712150888896.issue35581@roundup.psfhosted.org> Message-ID: <1555108464.5.0.314809973495.issue35581@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:36:12 2019 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 12 Apr 2019 22:36:12 +0000 Subject: [issue35581] Document @typing.type_check_only In-Reply-To: <1545742357.2.0.712150888896.issue35581@roundup.psfhosted.org> Message-ID: <1555108572.96.0.0567245924189.issue35581@roundup.psfhosted.org> Guido van Rossum added the comment: Now waiting for the backport to 3.7. Once that's done I'll close this as fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:36:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:36:32 +0000 Subject: [issue28055] pyhash's siphash24 assumes alignment of the data pointer In-Reply-To: <1473463742.19.0.416387824738.issue28055@psf.upfronthosting.co.za> Message-ID: <1555108592.79.0.234141594279.issue28055@roundup.psfhosted.org> STINNER Victor added the comment: I see that a fix has been pushed. I'm not sure why this issue is still open, so I close it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:37:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:37:48 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555108668.18.0.667140004343.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: See also: * bpo-27987: obmalloc's 8-byte alignment causes undefined behavior * bpo-18835: Add PyMem_AlignedAlloc() * bpo-31912: PyMem_Malloc() should guarantee alignof(max_align_t) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:40:53 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 12 Apr 2019 22:40:53 +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: <1555108853.69.0.157472228772.issue27987@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:48:01 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 12 Apr 2019 22:48:01 +0000 Subject: [issue35581] Document @typing.type_check_only In-Reply-To: <1545742357.2.0.712150888896.issue35581@roundup.psfhosted.org> Message-ID: <1555109281.88.0.0673920901937.issue35581@roundup.psfhosted.org> miss-islington added the comment: New changeset b759a2c5b9612a03c8b30514aa93444268931e5e by Miss Islington (bot) in branch '3.7': bpo-35581: Document @typing.type_check_only (GH-11312) https://github.com/python/cpython/commit/b759a2c5b9612a03c8b30514aa93444268931e5e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:49:20 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 12 Apr 2019 22:49:20 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555109360.79.0.509703723042.issue36618@roundup.psfhosted.org> Gregory P. Smith added the comment: Even if you check for -fmax-type-align compiler support at configure time, there is a potential problem: Nothing guarantees that extension modules are built by the same compiler that CPython is. If CPython used an old clang without support for that flag and the extension module compiled by that CPython via pip and setup.py, etc. uses a more recent version of clang - it wouldn't specify that flag and the extension module code could be broken. I suppose this issue of conditional compiler flags is nothing new. It should not block us from going forward with a workaround like your PRs for now. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:50:25 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 12 Apr 2019 22:50:25 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555109425.26.0.753685648453.issue36618@roundup.psfhosted.org> Gregory P. Smith added the comment: I believe -fno-max-type-align is also an option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:51:09 2019 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 12 Apr 2019 22:51:09 +0000 Subject: [issue35581] Document @typing.type_check_only In-Reply-To: <1545742357.2.0.712150888896.issue35581@roundup.psfhosted.org> Message-ID: <1555109469.19.0.868723236397.issue35581@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:51:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:51:09 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555109469.98.0.832791819868.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a304b136adda3575898d8b5debedcd48d5072272 by Victor Stinner in branch 'master': bpo-36618: Don't add -fmax-type-align flag to old clang (GH-12811) https://github.com/python/cpython/commit/a304b136adda3575898d8b5debedcd48d5072272 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 18:55:11 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 22:55:11 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555109711.62.0.534990592518.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: > It should not block us from going forward with a workaround like your PRs for now. I pushed a fix quickly to unblock my PR 12796, but also because I was very scared by what I saw :-D I see my change as a "quick fix", but we really have to sit down to think about the "correct fix". Especially since we will have to do something for Python 2.7 and 3.7, and adding -fmax-type-align=8 to exported CFLAGS can cause *new* issues, as you explained. That's why I mentioned bpo-27987 and other issues, to try to see what has already been said, and try to find to identify and fix the root issue, rather than working around the issue with compiler flags. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:11:50 2019 From: report at bugs.python.org (Charles Merriam) Date: Fri, 12 Apr 2019 23:11:50 +0000 Subject: [issue36620] Documentation missing parameter for Itertools.zip_longest In-Reply-To: <1555104436.13.0.755841693909.issue36620@roundup.psfhosted.org> Message-ID: Charles Merriam added the comment: Hi Cheryl, No. I've dealt with the Team Python long cycles for random pull requests before. Charles On Fri, Apr 12, 2019 at 2:27 PM Cheryl Sabella wrote: > > Cheryl Sabella added the comment: > > Good catch! In the same section, accumulate() is missing the `initial` > argument. > > Would you be interested in submitting a pull request for this? > > ---------- > nosy: +cheryl.sabella > > _______________________________________ > Python tracker > > _______________________________________ > ---------- nosy: +Charles.Merriam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:15:09 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 12 Apr 2019 23:15:09 +0000 Subject: [issue36620] Documentation missing parameter for Itertools.zip_longest In-Reply-To: <1555099757.43.0.201440165942.issue36620@roundup.psfhosted.org> Message-ID: <1555110909.15.0.642047410974.issue36620@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:26:20 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 23:26:20 +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: <1555111580.59.0.147821345912.issue31954@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:26:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 23:26:44 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555111604.12.0.671680543414.issue36605@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:28:31 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 23:28:31 +0000 Subject: [issue32299] unittest.mock.patch.dict.__enter__ should return the dict In-Reply-To: <1513148900.41.0.213398074469.issue32299@psf.upfronthosting.co.za> Message-ID: <1555111711.44.0.748935744375.issue32299@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +xtreak versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:28:45 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 12 Apr 2019 23:28:45 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555111725.2.0.735980514273.issue36605@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:41:40 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 12 Apr 2019 23:41:40 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555112500.16.0.616412292007.issue33608@roundup.psfhosted.org> Eric Snow added the comment: @Victor, I set up a FreeBSD 12.0 VM (in Hyper-v) and made sure core files were getting generated for segfaults. Then I cloned the cpython repo, built it (using GCC), and ran regrtest as you recommended. It generated no core files after half an hour. I adjusted the VM down to 1 CPU from 4 and there were no segfaults over an hour and a half of running those 4 test loops. So I've set the VM to 10% of a CPU and still have gotten no core files after over half an hour. The load average has been hovering between 5 and 6. I guess I'm not starving the VM enough. :) Any ideas of how far I need to throttle the VM? Is there more than just CPU that I need to limit? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 19:59:21 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 12 Apr 2019 23:59:21 +0000 Subject: [issue36620] Documentation missing parameter for Itertools.zip_longest In-Reply-To: <1555099757.43.0.201440165942.issue36620@roundup.psfhosted.org> Message-ID: <1555113561.77.0.43104738122.issue36620@roundup.psfhosted.org> Cheryl Sabella added the comment: Thanks, Charles. I'm going to assign this to @Mariatta for the sprints. ---------- assignee: docs at python -> Mariatta nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 20:13:09 2019 From: report at bugs.python.org (Paul Ganssle) Date: Sat, 13 Apr 2019 00:13:09 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555114389.64.0.969219216591.issue36602@roundup.psfhosted.org> Paul Ganssle added the comment: > I don't spend enough time dealing with symlinks to have strong opinions there, but given we have ways to resolve symlinks but not to get back to the original name (and I *have* had to deal with issues where I've needed to find the original name from the target :roll-eyes:) I'd say don't resolve anything eagerly. You mean treating symlinks to directories like files? I suppose that's a possibility, but I do think it will end up being a source of bugs around symlinking. Admittedly, it *is* apparently what rglob('*') does (just tested it - apparently it won't follow symlinks to directories), though I think it might be a better interface to try to break cycles rather than not follow symlinks (particularly since `iterdir` currently treats symlinks to directories as directories). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 20:36:55 2019 From: report at bugs.python.org (Sep Dehpour) Date: Sat, 13 Apr 2019 00:36:55 +0000 Subject: [issue36622] Inconsistent exponent notation formatting Message-ID: <1555115815.06.0.0326129419561.issue36622@roundup.psfhosted.org> New submission from Sep Dehpour : Floats and Decimals have inconsistent exponent notation formatting: >>> '{:.5e}'.format(Decimal('2.0001')) '2.00010e+0' >>> '{:.5e}'.format(2.0001) '2.00010e+00' This is causing issues for us since we use the scientific notation formatted string of numbers to compare them. Between decimals and floats, one produces '+0' while the other one produces '+00' ---------- messages: 340136 nosy: seperman priority: normal severity: normal status: open title: Inconsistent exponent notation formatting type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 20:50:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 13 Apr 2019 00:50:27 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555116627.01.0.457349192861.issue36605@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 44a2c4aaf2d0c03c70646eb16fbc6c1ba1689e69 by Victor Stinner in branch '2.7': bpo-36605: make tags: parse Modules/_io directory (GH-12789) (GH-12815) https://github.com/python/cpython/commit/44a2c4aaf2d0c03c70646eb16fbc6c1ba1689e69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 20:50:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 13 Apr 2019 00:50:33 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555116633.9.0.660865673245.issue36605@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5403006c5c371649b92ab8a2cde742412c765640 by Victor Stinner in branch '3.7': bpo-36605: make tags: parse Modules/_io directory (GH-12789) (GH-12814) https://github.com/python/cpython/commit/5403006c5c371649b92ab8a2cde742412c765640 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 20:50:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 13 Apr 2019 00:50:51 +0000 Subject: [issue36605] make tags should also parse Modules/_io/*.c and Modules/_io/*.h In-Reply-To: <1555001406.69.0.640978574567.issue36605@roundup.psfhosted.org> Message-ID: <1555116651.26.0.892792874238.issue36605@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 20:54:41 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 13 Apr 2019 00:54:41 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555116881.35.0.0335206903515.issue33608@roundup.psfhosted.org> STINNER Victor added the comment: > Any ideas of how far I need to throttle the VM? Is there more than just CPU that I need to limit? I don't know how to make the race condition more likely. I'm not sure that starving the CPU helps. Maybe try the opposite: add more CPUs and reduce the number of tests run in parallel. Did you test commit f13c5c8b9401a9dc19e95d8b420ee100ac022208? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 21:01:38 2019 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 13 Apr 2019 01:01:38 +0000 Subject: [issue36622] Inconsistent exponent notation formatting In-Reply-To: <1555115815.06.0.0326129419561.issue36622@roundup.psfhosted.org> Message-ID: <1555117298.11.0.752127122422.issue36622@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith, mark.dickinson, skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 21:05:24 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 01:05:24 +0000 Subject: [issue36623] Clean unused parser headers Message-ID: <1555117524.95.0.888153929323.issue36623@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : After the removal of pgen, there are multiple parser headers that are not used anymore or ar lacking implementations. ---------- components: Interpreter Core messages: 340140 nosy: pablogsal priority: normal severity: normal status: open title: Clean unused parser headers versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 21:05:40 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 01:05:40 +0000 Subject: [issue36623] Clean unused parser headers In-Reply-To: <1555117524.95.0.888153929323.issue36623@roundup.psfhosted.org> Message-ID: <1555117540.32.0.193723110286.issue36623@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +12742 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 21:08:48 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 01:08:48 +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: <1555117728.71.0.500132103768.issue27987@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 21:22:22 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 01:22:22 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1555118542.58.0.846513911818.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will separate the work in two Pull Request (maybe more). The implementation of the PEP will be done in PR12701 and the documentation and other additions will be done in future Pull Requests to keep things more manageable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 21:36:00 2019 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 13 Apr 2019 01:36:00 +0000 Subject: [issue36601] signals can be caught by any thread In-Reply-To: <1554979213.03.0.286656005091.issue36601@roundup.psfhosted.org> Message-ID: <1555119360.15.0.116620470397.issue36601@roundup.psfhosted.org> Nathaniel Smith added the comment: Yeah, the check makes sense on a system like the comment says IRIX used to be, where getpid() actually returns a thread id *and* signals are delivered to all threads (wtf). But any modern system should do the POSIX thing, where getpid() returns the same value in all threads, and signals are only delivered to one thread anyway. So I agree with everyone else that the original motivation doesn't make sense any more. The place where this would change things is in fork/vfork context. For fork it seems unhelpful... like Greg notes, we already reset main_pid in the AfterFork handler, so the only effect is that there's a brief moment where signals can be lost. If we removed the (getpid() == main_thread) check, then fork() would work slightly better. For vfork, man, I don't even know. Here I do disagree with Greg a little ? according to POSIX, trip_signal is *not* safe to call in a vfork'ed process. POSIX says: "behavior is undefined if the process created by vfork() either modifies any data [...] or calls any other function". Yes this is really as extreme as it sounds ? you're not allowed to mutate data or use any syscalls. And they explicitly note that this applies to signal handlers too: "If signal handlers are invoked in the child process after vfork(), they must follow the same rules as other code in the child process." trip_signals sets a flag -> it mutates data -> it technically can invoke undefined behavior if it's called in a child process after a vfork. And it can call write(), which again, undefined behavior. Of course this is so restrictive that vfork() is almost unusable in Python anyway, because you can't do anything in Python without modifying memory. And worse: according to a strict reading of POSIX, vfork() should call pthread_atfork() handlers, and our pthread_atfork() handlers mutate memory. So from the POSIX-rules-lawyer perspective, there's absolutely no way any Python process can ever call vfork() without invoking undefined behavior, no matter what we do here. Do we care? It looks like subprocess.py was recently modified to call posix_spawn in some cases: https://github.com/python/cpython/blob/a304b136adda3575898d8b5debedcd48d5072272/Lib/subprocess.py#L610-L654 If we believe the comments in that function, it only does this on macOS ? where posix_spawn is a native syscall, so no vfork is involved ? or on systems using glibc (i.e., Linux), where posix_spawn *does* invoke vfork(). So in this one case, currently, CPython does use vfork(). Also, users might call os.posix_spawn directly on any system. However, checking the glibc source, their implementation of posix_spawn actually takes care of this ? it doesn't use vfork() directly, but rather clone(), and it takes care to make sure that no signal handlers run in the child (see sysdeps/unix/sysv/linux/spawni.c for details). AFAICT, the only ways that someone could potentially get themselves into trouble with vfork() on CPython are: - by explicitly wrapping it themselves, in which case, good luck to them I guess. On Linux they aren't instantly doomed, because Linux intentionally deviates from POSIX and *doesn't* invoke pthread_atfork handlers after vfork(), but they still have their work cut out for them. Not really our problem. - by explicitly calling os.posix_spawn on some system where this is implemented using vfork internally, but with a broken libc that doesn't handle signals or pthread_atfork correctly. Currently we don't know of any such systems, and if they do exist they have to be pretty rare. So: I think we shouldn't worry about vfork(), and it's fine to remove the (getpid() == main_pid) check. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 22:02:22 2019 From: report at bugs.python.org (David Bolen) Date: Sat, 13 Apr 2019 02:02:22 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555120942.66.0.76690090947.issue33608@roundup.psfhosted.org> David Bolen added the comment: Eric, I'm also seeing the same Win7 and Win10 worker failures with commit b75b1a350 as last time (test_multiprocessing_spawn on both, and test_io on Win7). For test_multiprocessing_spawn, it fails differently than Victor since no core file is generated, but I assume it's related in terms of child process termination. See for example https://buildbot.python.org/all/#/builders/3/builds/2390 for Win10, where test_mymanager_context fails with: ====================================================================== FAIL: test_mymanager_context (test.test_multiprocessing_spawn.WithManagerTestMyManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\test\_test_multiprocessing.py", line 2747, in test_mymanager_context self.assertIn(manager._process.exitcode, (0, -signal.SIGTERM)) AssertionError: 3221225477 not found in (0, -15) ---------------------------------------------------------------------- (3221225477 is C0000005 which I believe is an access violation) For some reason, the Windows 7 worker didn't get a test run while your commit was live, but I can reproduce the same error manually. For test_io, as before, its a shutdown lock failure: ====================================================================== FAIL: test_daemon_threads_shutdown_stdout_deadlock (test.test_io.CMiscIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\python.test\lib\test\test_io.py", line 4157, in test_daemon_threads_shutdown_stdout_deadlock self.check_daemon_threads_shutdown_deadlock('stdout') File "D:\cygwin\home\db3l\python.test\lib\test\test_io.py", line 4148, in check_daemon_threads_shutdown_deadlock self.assertIn("Fatal Python error: could not acquire lock " AssertionError: "Fatal Python error: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads" not found in '' ---------------------------------------------------------------------- In manual attempts I have yet to be able to recreate the test_multiprocessing_spawn failure under Win10 but can usually manage a 25-50% failure rate under Win7 (which is much slower). The test_io failure on Win7 however, appears to be more easily reproducible. It's possible I/O is more critical than CPU, or perhaps its impact on latency; I seem to more easily exacerbate the test_multiprocessing_spawn failure rate by loading down the host disk than its CPU. I also noticed that the Win10 failure was when test_io and test_multiprocessing_spawn overlapped. While I'm guessing this should happen on any low powered Windows VM, if it would help, I could arrange remote access to the Win7 worker for you. Or just test a change on your behalf. In fairness, it's unlikely to be useful for any significant remote debugging but perhaps at least having somewhere you could test a change, even if just with print-based debugging, might help. And while it might be an independent issue, the test_io failure rate appears to occur more reliably than test_multiprocessing_spawn. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 12 23:10:34 2019 From: report at bugs.python.org (Laurie Opperman) Date: Sat, 13 Apr 2019 03:10:34 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1555125034.54.0.0542768522838.issue36602@roundup.psfhosted.org> Laurie Opperman added the comment: Having `iterdir(recursive=True)` recurse into symlinks to directories would mean we would either not yield those symlinks, or we yield those symlinks and all other directories. I feel like not yielding directories is the way to go, but it's easy enough to check if a yielded path is a directory in application code. The current implementation of using recursion to list subdirectory contents doesn't seem to allow for the obvious implementation of symlink cycle-detection: keeping track of which (real) directories have been listed. PS: I've updated the pull-request to not follow symlinks to directories. This is not a final decision, but just updating to be in line with what I've implied up to this point ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 00:35:17 2019 From: report at bugs.python.org (David Bolen) Date: Sat, 13 Apr 2019 04:35:17 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555130117.96.0.772180768159.issue33608@roundup.psfhosted.org> David Bolen added the comment: I just noticed that my last message referenced the wrong commit. My test failures were against commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (the same as Victor). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 01:21:07 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 13 Apr 2019 05:21:07 +0000 Subject: [issue36593] isinstance check fails for Mock objects with spec executed under tracing function In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555132867.75.0.977877603077.issue36593@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- title: Trace function interferes with MagicMock isinstance? -> isinstance check fails for Mock objects with spec executed under tracing function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 03:03:54 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 13 Apr 2019 07:03:54 +0000 Subject: [issue17013] Allow waiting on a mock In-Reply-To: <1358856947.82.0.71016271567.issue17013@psf.upfronthosting.co.za> Message-ID: <1555139034.9.0.598192064042.issue17013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Is there still sufficient interest in this? I gave an initial try at this based on my limited knowledge of mock and Antoine's idea. I created a new class WaitableMock that inherits from Mock and accepts an event_class with threading.Event as default and stores an event object. When call is made then via CallableMixin _mock_call is called which I have overridden to set the event object. I have wait_until_called that waits on this event object for a given timeout to return whether it's called or not. I am not sure of implementing wait_until_called_with since I set the event object for any call in _mock_call irrespective of argument and since the call params for which the event has to be set are passed to wait_until_called_with. Perhaps allow passing a call object to wait_until_called_with and and during _mock_call set event object only if the call is the same as one passed to wait_until_called_with ? See also issue26467 to support asyncio with mock Initial implementation class WaitableMock(Mock): def __init__(self, *args, **kwargs): event_class = kwargs.pop('event_class', threading.Event) _safe_super(WaitableMock, self).__init__(*args, **kwargs) self.event = event_class() def _mock_call(self, *args, **kwargs): _safe_super(WaitableMock, self)._mock_call(*args, **kwargs) self.event.set() def wait_until_called(self, timeout=1): return self.event.wait(timeout=timeout) Sample program : import multiprocessing import threading import time from unittest.mock import WaitableMock, patch def call_after_sometime(func, delay=1): time.sleep(delay) func() def foo(): pass def bar(): pass with patch('__main__.foo', WaitableMock(event_class=threading.Event)): with patch('__main__.bar', WaitableMock(event_class=threading.Event)): threading.Thread(target=call_after_sometime, args=(foo, 1)).start() threading.Thread(target=call_after_sometime, args=(bar, 5)).start() print("foo called ", foo.wait_until_called(timeout=2)) # successful print("bar called ", bar.wait_until_called(timeout=2)) # times out foo.assert_called_once() bar.assert_not_called() # Wait for the bar's thread to complete to verify call is registered time.sleep(5) bar.assert_called_once() # foo is called but waiting for call to bar times out and hence no calls to bar are registered though bar is eventually called in the end and the call is registered at the end of the program. ? cpython git:(master) ? time ./python.exe ../backups/bpo17013_mock.py foo called True bar called False ./python.exe ../backups/bpo17013_mock.py 0.40s user 0.05s system 7% cpu 5.765 total ---------- nosy: +cjw296, mariocj89, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 03:32:49 2019 From: report at bugs.python.org (=?utf-8?q?Andreas_=C3=85kerlund?=) Date: Sat, 13 Apr 2019 07:32:49 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1555140769.47.0.86119984311.issue17267@roundup.psfhosted.org> Change by Andreas ?kerlund : ---------- nosy: -thezulk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 03:58:52 2019 From: report at bugs.python.org (Mark Lawrence) Date: Sat, 13 Apr 2019 07:58:52 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1555142332.16.0.364157501949.issue19113@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 04:44:08 2019 From: report at bugs.python.org (Aymeric Augustin) Date: Sat, 13 Apr 2019 08:44:08 +0000 Subject: [issue29980] OSError: multiple exceptions should preserve the exception type if it is common In-Reply-To: <1491325941.34.0.941861469291.issue29980@psf.upfronthosting.co.za> Message-ID: <1555145048.04.0.16567674925.issue29980@roundup.psfhosted.org> Aymeric Augustin added the comment: A very similar issue came up here: https://github.com/aaugustin/websockets/issues/593 When raising an exception that gathers multiple sub-exceptions, it would be nice to be able to iterate the exception to access the sub-exceptions. ---------- nosy: +aymeric.augustin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 04:49:56 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 08:49:56 +0000 Subject: [issue35734] Remove unused _BaseV4._is_valid_netmask in ipaddress In-Reply-To: <1547437878.33.0.689203196624.issue35734@roundup.psfhosted.org> Message-ID: <1555145396.11.0.614685227599.issue35734@roundup.psfhosted.org> Inada Naoki added the comment: New changeset e59ec1b05d3e1487ca7754530d3748446c9b7dfd by Inada Naoki (R?mi Lapeyre) in branch 'master': bpo-35734: ipaddress: remove unused methods (GH-11591) https://github.com/python/cpython/commit/e59ec1b05d3e1487ca7754530d3748446c9b7dfd ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 05:44:16 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 09:44:16 +0000 Subject: [issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows In-Reply-To: <1396262123.2.0.239412802273.issue21110@psf.upfronthosting.co.za> Message-ID: <1555148656.79.0.18963258626.issue21110@roundup.psfhosted.org> Inada Naoki added the comment: * rubenvb is not maintained. * https://forums.embarcadero.com/message.jspa?messageID=581594 is dead link. * When PY_SSIZE_T is not defined, we use intptr_t, not int. Original issue report doesn't make sense to me. But we can't confirm it for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 06:05:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 10:05:38 +0000 Subject: [issue2007] cookielib lacks FileCookieJar class for Internet Explorer In-Reply-To: <1202153753.42.0.88577975251.issue2007@psf.upfronthosting.co.za> Message-ID: <1555149938.15.0.829899225071.issue2007@roundup.psfhosted.org> Inada Naoki added the comment: I don't think adding MSIE support is not worth enough for now. ---------- nosy: +inada.naoki resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 06:55:55 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 10:55:55 +0000 Subject: [issue33922] [Windows] Document the launcher's -64 suffix In-Reply-To: <1529538222.45.0.56676864532.issue33922@psf.upfronthosting.co.za> Message-ID: <1555152955.35.0.170361846543.issue33922@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 06:57:50 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 13 Apr 2019 10:57:50 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings In-Reply-To: <1554941666.55.0.100758767166.issue36594@roundup.psfhosted.org> Message-ID: <1555153070.39.0.8993730041.issue36594@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:00:03 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 11:00:03 +0000 Subject: [issue31743] Proportional Width Font on Generated Python Docs PDFs In-Reply-To: <1507633217.5.0.213398074469.issue31743@psf.upfronthosting.co.za> Message-ID: <1555153203.89.0.693194424821.issue31743@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +eric.araujo, ezio.melotti, mdk, willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:01:43 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 13 Apr 2019 11:01:43 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings In-Reply-To: <1554941666.55.0.100758767166.issue36594@roundup.psfhosted.org> Message-ID: <1555153303.51.0.249761669408.issue36594@roundup.psfhosted.org> Serhiy Storchaka added the comment: Are not all pointer types (except pointers to functions) automatically converted to/from void*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:17:25 2019 From: report at bugs.python.org (Stefan Krah) Date: Sat, 13 Apr 2019 11:17:25 +0000 Subject: [issue36594] Undefined behavior due to incorrect usage of %p in format strings In-Reply-To: <1554941666.55.0.100758767166.issue36594@roundup.psfhosted.org> Message-ID: <1555154245.55.0.478893539391.issue36594@roundup.psfhosted.org> Stefan Krah added the comment: gcc warns with -pedantic: ptr.c: In function ?main?: ptr.c:5:13: warning: format ?%p? expects argument of type ?void *?, but argument 2 has type ?int *? [-Wformat=] printf ("%p", &i); It is pedantic indeed, I wonder if machines with different pointer sizes still exist. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:27:33 2019 From: report at bugs.python.org (Mario Corchero) Date: Sat, 13 Apr 2019 11:27:33 +0000 Subject: [issue17013] Allow waiting on a mock In-Reply-To: <1358856947.82.0.71016271567.issue17013@psf.upfronthosting.co.za> Message-ID: <1555154853.09.0.405329383076.issue17013@roundup.psfhosted.org> Mario Corchero added the comment: I think this is REALLY interesting!, there are many situations where this has been useful, it would greatly improve multithreading testing in Python. Q? I see you inherit from Mock, should it inherit from MagicMock? I'd say send the PR and the discussion can happen there about the implementation, seems there is consensus in this thread. I would find it OK to start with `wait_until_called` if you want and can be discussed in another issue/PR if you don't have the time/think it might not be worth. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:34:20 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 11:34:20 +0000 Subject: [issue17068] peephole optimization for constant strings In-Reply-To: <1359411544.64.0.96683095685.issue17068@psf.upfronthosting.co.za> Message-ID: <1555155260.26.0.631917189286.issue17068@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:39:51 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 11:39:51 +0000 Subject: [issue15917] hg hook to detect unmerged changesets In-Reply-To: <1347340391.86.0.248701031918.issue15917@psf.upfronthosting.co.za> Message-ID: <1555155591.53.0.725217566581.issue15917@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 07:46:41 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 11:46:41 +0000 Subject: [issue15035] array.array of UCS2 values In-Reply-To: <1339147370.98.0.5823346157.issue15035@psf.upfronthosting.co.za> Message-ID: <1555156001.37.0.206017781182.issue15035@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 08:01:19 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 12:01:19 +0000 Subject: [issue18610] wsgiref.validate expects wsgi.input read to give exactly one arg In-Reply-To: <1375310901.82.0.276465395742.issue18610@psf.upfronthosting.co.za> Message-ID: <1555156879.72.0.589540881189.issue18610@roundup.psfhosted.org> Cheryl Sabella added the comment: New changeset f8716c88f13f035c126fc1db499ae0ea309c7ece by Cheryl Sabella in branch 'master': bpo-18610: Update wsgiref.validate docstring for wsgi.input read() (GH-11663) https://github.com/python/cpython/commit/f8716c88f13f035c126fc1db499ae0ea309c7ece ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 08:04:58 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 12:04:58 +0000 Subject: [issue18610] wsgiref.validate expects wsgi.input read to give exactly one arg In-Reply-To: <1375310901.82.0.276465395742.issue18610@psf.upfronthosting.co.za> Message-ID: <1555157098.25.0.109365854198.issue18610@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 08:25:43 2019 From: report at bugs.python.org (Michael Felt) Date: Sat, 13 Apr 2019 12:25:43 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage Message-ID: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> New submission from Michael Felt : Back in 2012 (issue12326 and issue12795), and just recently (issue36588) sys.platform has been modified (and documented) to not return the platform version. Additionally, the recommendation is to use the form sys.platform.startswith() - to continue to be backwards compatible. IMHO - looking forward - Python3.8 and later - we should not be using the recommendation for 'backwards-compatibility' in our code (so this PR will not be considered for back-porting) - in our stdlib, tests, and - should it occur - in "core" code. We should be testing for equality. Further, imho, the change should not be sys.platform == but should be platform.system() == , or platform.system() in ('AIX', 'Darwin', 'Linux') -- and adjust the list so that the most frequently used platform is tested first (e.g., performance-wise ('Linux', 'Darwin', 'AIX') would better reflect platform importance. OR - should the change just continue to use sys.platform - even though this is a build-time value, not a run-time value. I propose to do this in separate PR - one for each platform of AIX, Darwin and Linux. (I would also add Windows, but that would be to replace the equivalence of sys.platform == 'win32' with platform.system() == 'Windows', and perhaps, os.name == 'nt' with platform.system() == 'Windows'. Reaction from other platforms dependent on os.name == 'nt' (cygwin?) would be helpful.) Finally, while I do not want to rush this - I would like to try and target getting this complete in time for Python3.8 ---------- components: Library (Lib), Tests messages: 340155 nosy: Michael.Felt priority: normal severity: normal status: open title: cleanup the stdlib and tests with regard to sys.platform usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 08:28:44 2019 From: report at bugs.python.org (Michael Felt) Date: Sat, 13 Apr 2019 12:28:44 +0000 Subject: [issue36588] change sys.platform() to just "aix" for AIX In-Reply-To: <3c5bf290-35a7-4a5c-8620-6a2f047393a4@felt.demon.nl> Message-ID: <7c800a92-89f4-df2d-7979-aa87c06e9f18@felt.demon.nl> Michael Felt added the comment: On 12/04/2019 23:16, Michael Felt wrote: > Agreed, in case of doubt - leave alone (never change a winning team). > > And, to make it a short reply - I'll get started, and we see where it > leads us. I opened issue36624 (https://bugs.python.org/issue36624) - before I "take off", some comments/discussion on what is desirable and achievable would be welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 08:29:46 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 12:29:46 +0000 Subject: [issue17259] Document round half to even rule for floats In-Reply-To: <1361395314.25.0.489128727343.issue17259@psf.upfronthosting.co.za> Message-ID: <1555158586.41.0.797300250856.issue17259@roundup.psfhosted.org> Cheryl Sabella added the comment: It doesn't seem there have been other bugs reported related to this. However, if it's still agreed that the documentation should be clarified, I think a link from `locale.format_string()` (note, format() has been deprecated, hence the change in the name) to the Format Specification Mini-Language might helpful. Also, Terry's suggestion in msg182706 specific to %f rounding could be added. ---------- nosy: +cheryl.sabella versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 09:10:37 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 13:10:37 +0000 Subject: [issue16254] Make PyUnicode_AsWideCharString() increase temporary In-Reply-To: <1350418448.6.0.265249549125.issue16254@psf.upfronthosting.co.za> Message-ID: <1555161037.1.0.576465200838.issue16254@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 09:35:30 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 13 Apr 2019 13:35:30 +0000 Subject: [issue17013] Allow waiting on a mock In-Reply-To: <1358856947.82.0.71016271567.issue17013@psf.upfronthosting.co.za> Message-ID: <1555162530.33.0.425601937505.issue17013@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks Mario for the feedback. > I see you inherit from Mock, should it inherit from MagicMock? yes, it can inherit from MagicMock to mock magic methods and to wait on their call. I thought some more about waiting for function call with arguments. One idea would be to have a dictionary with args to function as key mapping to an event object and to set and wait on that event object. To have wait_until_called that is always listening on a per mock object and to have wait_until_called_with listening on event object specific to that argument. Below is a sample implementation and an example to show it working with wait_until_called and wait_until_called_with. wait_until_called_with is something difficult to model since it needs per call event object and also need to store relevant key mapping to event object that is currently args and doesn't support keyword arguments. But wait_until_called is little simpler waiting on a per mock event object. I will open up a PR with some tests. class WaitableMock(MagicMock): def __init__(self, *args, **kwargs): _safe_super(WaitableMock, self).__init__(*args, **kwargs) self.event_class = kwargs.pop('event_class', threading.Event) self.event = self.event_class() self.expected_calls = {} def _mock_call(self, *args, **kwargs): ret_value = _safe_super(WaitableMock, self)._mock_call(*args, **kwargs) for call in self._mock_mock_calls: event = self.expected_calls.get(call.args) if event and not event.is_set(): event.set() # Always set per mock event object to ensure the function is called for wait_until_called. self.event.set() return ret_value def wait_until_called(self, timeout=1): return self.event.wait(timeout=timeout) def wait_until_called_with(self, *args, timeout=1): # If there are args create a per argument list event object and if not wait for per mock event object. if args: if args not in self.expected_calls: event = self.event_class() self.expected_calls[args] = event else: event = self.expected_calls[args] else: event = self.event return event.is_set() or event.wait(timeout=timeout) # Sample program to wait on arguments, magic methods and validating wraps import multiprocessing import threading import time from unittest.mock import WaitableMock, patch, call def call_after_sometime(func, *args, delay=1): time.sleep(delay) func(*args) def wraps(*args): return 1 def foo(*args): pass def bar(*args): pass with patch('__main__.foo', WaitableMock(event_class=threading.Event, wraps=wraps)): with patch('__main__.bar', WaitableMock(event_class=threading.Event)): # Test normal call threading.Thread(target=call_after_sometime, args=(foo, 1), kwargs={'delay': 1}).start() threading.Thread(target=call_after_sometime, args=(bar, 1), kwargs={'delay': 5}).start() print("foo called ", foo.wait_until_called(timeout=2)) print("bar called ", bar.wait_until_called(timeout=2)) foo.assert_called_once() bar.assert_not_called() # Test wraps works assert foo() == 1 # Test magic method threading.Thread(target=call_after_sometime, args=(foo.__str__, ), kwargs={'delay': 1}).start() print("foo.__str__ called ", foo.__str__.wait_until_called(timeout=2)) print("bar.__str__ called ", bar.__str__.wait_until_called(timeout=2)) foo.reset_mock() bar.reset_mock() # Test waiting for arguments threading.Thread(target=call_after_sometime, args=(bar, 1), kwargs={'delay': 1}).start() threading.Thread(target=call_after_sometime, args=(bar, 2), kwargs={'delay': 5}).start() print("bar called with 1 ", bar.wait_until_called_with(1, timeout=2)) print("bar called with 2 ", bar.wait_until_called_with(2, timeout=2)) time.sleep(5) print("bar called with 2 ", bar.wait_until_called_with(2)) $ ./python.exe ../backups/bpo17013_mock.py foo called True bar called False foo.__str__ called True bar.__str__ called False bar called with 1 True bar called with 2 False bar called with 2 True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 10:03:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 13 Apr 2019 14:03:38 +0000 Subject: [issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows In-Reply-To: <1555148656.79.0.18963258626.issue21110@roundup.psfhosted.org> Message-ID: STINNER Victor added the comment: In case of doubt, I suggest to close the issue. If the issue strikes back, it is trivial to reopen the issue or open a new one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 10:05:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 13 Apr 2019 14:05:57 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555164357.89.0.979814759814.issue36624@roundup.psfhosted.org> STINNER Victor added the comment: I tried to add constants to test.support once to identify operating systems, nbut I had to revert the change. I am not sure that there is any problem here. Leaving the code unchanged is also fine :-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 10:39:08 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 13 Apr 2019 14:39:08 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555166348.15.0.236069718499.issue36616@roundup.psfhosted.org> Jeroen Demeyer added the comment: Mark, Petr, do you agree? I like the way how the reference implementation of PEP 590 improves the handling of profiling. However, that change really has little to do with PEP 590, it's something that we can do independently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 10:55:02 2019 From: report at bugs.python.org (MrValdez) Date: Sat, 13 Apr 2019 14:55:02 +0000 Subject: [issue21110] Slowdown and high memory usage when adding a new module in embedded Python 3.4 on 64bit Windows In-Reply-To: <1396262123.2.0.239412802273.issue21110@psf.upfronthosting.co.za> Message-ID: <1555167302.99.0.733527093752.issue21110@roundup.psfhosted.org> MrValdez added the comment: Its a shame the link is now gone. Its also been a long time that I don't remember all the details. I still have my code from back when I found this bug. I can try to replicate it. > We don't support compilers other than MSVC on Windows > [...] > rubenvb is not maintained. I don't remember why I used rubenvb back then. I'll see if I can get MSVC working. Maybe this is the cause for the slow down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 11:03:24 2019 From: report at bugs.python.org (Ramsey Kant) Date: Sat, 13 Apr 2019 15:03:24 +0000 Subject: [issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator In-Reply-To: <1406670130.27.0.606950005482.issue22102@psf.upfronthosting.co.za> Message-ID: <1555167804.02.0.229350357547.issue22102@roundup.psfhosted.org> Ramsey Kant added the comment: I would second this PR. The Win32 API that creates ZIP64 files produces ZIP64 files with the "diskno" as 0 and "disks" as 0 (instead of "1" as indicated by the spec). ---------- nosy: +Ramsey Kant versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 11:30:52 2019 From: report at bugs.python.org (Mario Corchero) Date: Sat, 13 Apr 2019 15:30:52 +0000 Subject: [issue17013] Allow waiting on a mock In-Reply-To: <1358856947.82.0.71016271567.issue17013@psf.upfronthosting.co.za> Message-ID: <1555169452.14.0.0778190639807.issue17013@roundup.psfhosted.org> Mario Corchero added the comment: Kooning great! I would Add a test for the following (I think both fails with the proposed impl): - The mock is called BEFORE calling wait_until_called_with - I call the mock with arguments and then I call wait for call without arguments. - using keyword arguments Also, I don?t have a great solution for it but it might be worth prefixing time-out with something in the wait_untill_called_with. In situations where the mocked object has a timeout parameter (which is a common argument for multithreaded apps). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 11:34:39 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 13 Apr 2019 15:34:39 +0000 Subject: [issue16254] Make PyUnicode_AsWideCharString() increase temporary In-Reply-To: <1350418448.6.0.265249549125.issue16254@psf.upfronthosting.co.za> Message-ID: <1555169679.69.0.629638794503.issue16254@roundup.psfhosted.org> Inada Naoki added the comment: fixed by #30863 ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 11:36:00 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 13 Apr 2019 15:36:00 +0000 Subject: [issue17013] Allow waiting on a mock In-Reply-To: <1358856947.82.0.71016271567.issue17013@psf.upfronthosting.co.za> Message-ID: <1555169760.51.0.00648460832644.issue17013@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +12743 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:05:19 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 16:05:19 +0000 Subject: [issue36623] Clean unused parser headers In-Reply-To: <1555117524.95.0.888153929323.issue36623@roundup.psfhosted.org> Message-ID: <1555171519.68.0.112787859465.issue36623@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f2cf1e3e2892a6326949c2570f1bb6d6c95715fb by Pablo Galindo in branch 'master': bpo-36623: Clean parser headers and include files (GH-12253) https://github.com/python/cpython/commit/f2cf1e3e2892a6326949c2570f1bb6d6c95715fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:05:27 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 16:05:27 +0000 Subject: [issue36623] Clean unused parser headers In-Reply-To: <1555117524.95.0.888153929323.issue36623@roundup.psfhosted.org> Message-ID: <1555171527.85.0.280635488603.issue36623@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:07:18 2019 From: report at bugs.python.org (miss-islington) Date: Sat, 13 Apr 2019 16:07:18 +0000 Subject: [issue36585] test_posix.py fails due to unsupported RWF_HIPRI In-Reply-To: <1554892107.72.0.359102203411.issue36585@roundup.psfhosted.org> Message-ID: <1555171638.83.0.862474232214.issue36585@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:23:27 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 16:23:27 +0000 Subject: [issue36427] Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread In-Reply-To: <1553552075.96.0.382616254369.issue36427@roundup.psfhosted.org> Message-ID: <1555172607.34.0.809671083042.issue36427@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fde9b33dfeedd4a4ed723b12d2330979dc684760 by Pablo Galindo in branch 'master': bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread (GH-12541) https://github.com/python/cpython/commit/fde9b33dfeedd4a4ed723b12d2330979dc684760 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:28:33 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 16:28:33 +0000 Subject: [issue36585] test_posix.py fails due to unsupported RWF_HIPRI In-Reply-To: <1554892107.72.0.359102203411.issue36585@roundup.psfhosted.org> Message-ID: <1555172913.35.0.796669135742.issue36585@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:30:49 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 16:30:49 +0000 Subject: [issue36427] Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread In-Reply-To: <1553552075.96.0.382616254369.issue36427@roundup.psfhosted.org> Message-ID: <1555173049.98.0.46692949967.issue36427@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +12745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 12:34:40 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 13 Apr 2019 16:34:40 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555173280.11.0.702829257058.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: Upgrading the script to account for Python changes. This is now duplicate_code_names_3.py $ ./python ./duplicate_code_names_3.py --ignore ignored_duplicates Lib/test Duplicate method names: Lib/test/test_dataclasses.py:1406 TestCase.test_helper_asdict_builtin_containers Lib/test/test_dataclasses.py:1579 TestCase.test_helper_astuple_builtin_containers Lib/test/test_dataclasses.py:700 TestCase.test_not_tuple Lib/test/test_dataclasses.py:3245 TestReplace.test_recursive_repr_two_attrs Lib/test/test_genericclass.py:161 TestClassGetitem.test_class_getitem Lib/test/test_gzip.py:764 TestCommandLine.test_compress_infile_outfile Lib/test/test_heapq.py:376 TestErrorHandling.test_get_only Lib/test/test_importlib/test_util.py:755 PEP3147Tests.test_source_from_cache_path_like_arg Lib/test/test_logging.py:328 BuiltinLevelsTest.test_regression_29220 Lib/test/test_sys_setprofile.py:363 ProfileSimulatorTestCase.test_unbound_method_invalid_args Lib/test/test_sys_setprofile.py:354 ProfileSimulatorTestCase.test_unbound_method_no_args Lib/test/test_utf8_mode.py:198 UTF8ModeTests.test_io_encoding False positives have been removed from the output of the above command and so, all the above methods are effectively duplicates that must be fixed. ---------- Added file: https://bugs.python.org/file48265/duplicate_code_names_3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 14:39:13 2019 From: report at bugs.python.org (Pradyun Gedam) Date: Sat, 13 Apr 2019 18:39:13 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module In-Reply-To: <1555082669.41.0.72121645453.issue36608@roundup.psfhosted.org> Message-ID: Pradyun Gedam added the comment: (Not sure how the Roundup handles email replies but I'm hoping this goes to the right place) I think it would be better if the downloading got invoked during the interpreter build process -- to download the wheels and add them to the final distribution. This lets us remove the wheels from the source tree/version control and prevents needing to change the PEP for this change. Functionally, I imagine having all the download logic in some sort of ensurepip._bootstrap which has all the download logic and that getting invoked in the build process. `python -m ensurepip` not hitting the internet is a good invariant to keep. On Fri, 12 Apr 2019 at 8:54 PM, Eric V. Smith wrote: > > Eric V. Smith added the comment: > > And I don't mean to sound like a total downer. I just think it's important > that we recognize all of the use cases. > > Thanks for your work on this. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 14:50:29 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 13 Apr 2019 18:50:29 +0000 Subject: [issue22991] test_gdb leaves the terminal in raw mode with gdb 7.8.1 In-Reply-To: <1417650633.0.0.0644519046784.issue22991@psf.upfronthosting.co.za> Message-ID: <1555181429.73.0.643988997451.issue22991@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 14:52:57 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 13 Apr 2019 18:52:57 +0000 Subject: [issue23768] assert on getting the representation of a thread in atexit function In-Reply-To: <1427228409.82.0.424611775358.issue23768@psf.upfronthosting.co.za> Message-ID: <1555181577.5.0.103993579048.issue23768@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 15:12:38 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 13 Apr 2019 19:12:38 +0000 Subject: [issue36593] isinstance check fails for Mock objects with spec executed under tracing function In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555182758.26.0.968483318357.issue36593@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 830b43d03cc47a27a22a50d777f23c8e60820867 by Pablo Galindo (Xtreak) in branch 'master': bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing (GH-12790) https://github.com/python/cpython/commit/830b43d03cc47a27a22a50d777f23c8e60820867 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 15:13:09 2019 From: report at bugs.python.org (miss-islington) Date: Sat, 13 Apr 2019 19:13:09 +0000 Subject: [issue36593] isinstance check fails for Mock objects with spec executed under tracing function In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555182789.15.0.807841264439.issue36593@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch pull_requests: +12746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 15:32:00 2019 From: report at bugs.python.org (miss-islington) Date: Sat, 13 Apr 2019 19:32:00 +0000 Subject: [issue36593] isinstance check fails for Mock objects with spec executed under tracing function In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555183920.89.0.460436457159.issue36593@roundup.psfhosted.org> miss-islington added the comment: New changeset f3a9d722d77753f5110e35f46bd61732c0cb81c1 by Miss Islington (bot) in branch '3.7': bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing (GH-12790) https://github.com/python/cpython/commit/f3a9d722d77753f5110e35f46bd61732c0cb81c1 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 15:33:22 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 13 Apr 2019 19:33:22 +0000 Subject: [issue36593] isinstance check fails for Mock objects with spec executed under tracing function In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555184002.29.0.800776102715.issue36593@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: An interesting thing is that there is GCC in CI that runs under coverage which also passed since this requires a Python tracing function before importing mock to trigger this as in the original report. Adding a simple tracer at the top of testmock.py file does cause an instance check failure without patch and passes with the merged patch. $ ./python.exe Lib/unittest/test/testmock/testmock.py .......................................F.................s..............................................F....... ====================================================================== FAIL: test_class_assignable (__main__.MockTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/unittest/test/testmock/testmock.py", line 1828, in test_class_assignable self.assertIsInstance(mock, int) AssertionError: is not an instance of ====================================================================== FAIL: test_spec_class (__main__.MockTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/unittest/test/testmock/testmock.py", line 775, in test_spec_class self.assertIsInstance(mock, X) AssertionError: is not an instance of .X'> ---------------------------------------------------------------------- Ran 112 tests in 3.834s FAILED (failures=2, skipped=1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 16:22:42 2019 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 13 Apr 2019 20:22:42 +0000 Subject: [issue34850] Emit a syntax warning for "is" with a literal In-Reply-To: <1538295319.77.0.545547206417.issue34850@psf.upfronthosting.co.za> Message-ID: <1555186962.76.0.839900373944.issue34850@roundup.psfhosted.org> Anthony Sottile added the comment: Should this also produce warnings for `list` / `dict` / `set` literals? ``` $ python3.8 Python 3.8.0a3 (default, Mar 27 2019, 03:46:44) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> x is [] False >>> x is {} False >>> x is {1, 2} False ``` ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 17:30:20 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 21:30:20 +0000 Subject: [issue30519] Add daemon argument to Timer In-Reply-To: <1496199253.36.0.456621970472.issue30519@psf.upfronthosting.co.za> Message-ID: <1555191020.72.0.324759385928.issue30519@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +pitrou versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 17:31:48 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 21:31:48 +0000 Subject: [issue30519] [threading] Add daemon argument to Timer In-Reply-To: <1496199253.36.0.456621970472.issue30519@psf.upfronthosting.co.za> Message-ID: <1555191108.31.0.630040286394.issue30519@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- title: Add daemon argument to Timer -> [threading] Add daemon argument to Timer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 18:58:43 2019 From: report at bugs.python.org (=?utf-8?q?Jakub_Moli=C5=84ski?=) Date: Sat, 13 Apr 2019 22:58:43 +0000 Subject: [issue36625] Obsolete comments in docstrings in fractions module Message-ID: <1555196323.81.0.314132124963.issue36625@roundup.psfhosted.org> New submission from Jakub Moli?ski : 3 docstrings in fractions.Fraction contain comments referring to python 3.0. def __floor__(a): """Will be math.floor(a) in 3.0.""" def __ceil__(a): """Will be math.ceil(a) in 3.0.""" def __round__(self, ndigits=None): """Will be round(self, ndigits) in 3.0. Rounds half toward even. """ To make it consistent with other docstrings in the module these should be changed to """math.floor(a)""", """math.ceil(a)""", and """round(self, ndigits) Rounds half toward even. """ ---------- assignee: docs at python components: Documentation messages: 340174 nosy: docs at python, jakub.molinski priority: normal severity: normal status: open title: Obsolete comments in docstrings in fractions module type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 19:08:55 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 23:08:55 +0000 Subject: [issue36625] Obsolete comments in docstrings in fractions module In-Reply-To: <1555196323.81.0.314132124963.issue36625@roundup.psfhosted.org> Message-ID: <1555196935.39.0.441326268484.issue36625@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 19:14:47 2019 From: report at bugs.python.org (=?utf-8?q?Jakub_Moli=C5=84ski?=) Date: Sat, 13 Apr 2019 23:14:47 +0000 Subject: [issue36625] Obsolete comments in docstrings in fractions module In-Reply-To: <1555196323.81.0.314132124963.issue36625@roundup.psfhosted.org> Message-ID: <1555197287.43.0.280771705498.issue36625@roundup.psfhosted.org> Change by Jakub Moli?ski : ---------- keywords: +patch pull_requests: +12747 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 19:24:21 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 23:24:21 +0000 Subject: [issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...) Message-ID: <1555197861.61.0.868013453859.issue1402289@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- keywords: -after moratorium nosy: +inada.naoki versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 19:26:34 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 13 Apr 2019 23:26:34 +0000 Subject: [issue24417] Type-specific documentation for __format__ methods In-Reply-To: <1433857085.94.0.53514781812.issue24417@psf.upfronthosting.co.za> Message-ID: <1555197994.44.0.722944459176.issue24417@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 20:33:03 2019 From: report at bugs.python.org (Martin Panter) Date: Sun, 14 Apr 2019 00:33:03 +0000 Subject: [issue17267] datetime.time support for '+' and '-' In-Reply-To: <1361450879.34.0.390010426075.issue17267@psf.upfronthosting.co.za> Message-ID: <1555201983.97.0.224866896153.issue17267@roundup.psfhosted.org> Martin Panter added the comment: A real use case that I have had was with a protocol to activate a device with a daily schedule. The protocol takes start and end hours and minutes of the day. To test the device by activating it over the next few minutes, my ideal way would have taken the current time (according to the device controller) as a ?time? object, and added a couple of minutes using ?timedelta?. In the end I think I made my protocol API accept both ?time? and ?timedelta" objects, because I found ?timedelta? more flexible for calculations, but the ?time? class more natural in other cases. The start and end times are local times, and daylight saving could come into play, but in reality I won?t be testing the device at 3 a.m. on a Sunday morning. If I did care, I would have to add my own logic with knowledge of the date and daylight saving, to raise an exception. I agree with Alexander about supporting the difference between two ?time? instances. The result should be a non-negative ?timedelta?, at least zero, and strictly less than 24 h. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 20:46:10 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 14 Apr 2019 00:46:10 +0000 Subject: [issue35967] Better platform.processor support In-Reply-To: <1549895363.53.0.252912531241.issue35967@roundup.psfhosted.org> Message-ID: <1555202770.24.0.873743144639.issue35967@roundup.psfhosted.org> Jason R. Coombs added the comment: > I don't quite follow: since you are the author of the tool, you can of course have your uname.py import platform and then apply one of the above tricks. I thought I'd tried that, but failed [ref](https://github.com/jaraco/cmdix/issues/1#issuecomment-462207845), which is why I committed [this change](https://github.com/jaraco/cmdix/commit/c53908b4b39771eed9f64fff5bed8af51baae4d0). The problem is that, if `pkg_resources` is used to implement the entry point for the `uname` console script, or if any other library happens to call platform.*, such as in site.py, before the patch has been allowed to run, the invocation of `uname` itself ends up invoking `uname`, causing unlimited recursion. No amount of patching in the `uname` command implementation can help that. > Your PR is missing tests, though, to support that it actually returns the same values are before for a set of common platforms. Yes, that sounds like a good plan. I'll add some tests that assert the values and then update the tests to match the current output, establish a baseline. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 21:18:25 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 14 Apr 2019 01:18:25 +0000 Subject: [issue35967] Better platform.processor support In-Reply-To: <1549895363.53.0.252912531241.issue35967@roundup.psfhosted.org> Message-ID: <1555204705.0.0.585985930028.issue35967@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +12749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 22:48:46 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 14 Apr 2019 02:48:46 +0000 Subject: [issue36593] isinstance check fails for Mock objects with spec executed under tracing function In-Reply-To: <1554941056.81.0.519333265817.issue36593@roundup.psfhosted.org> Message-ID: <1555210126.93.0.860033350014.issue36593@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks @xtreak for the analysis and the quick fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 22:49:32 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 14 Apr 2019 02:49:32 +0000 Subject: [issue36427] Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread In-Reply-To: <1553552075.96.0.382616254369.issue36427@roundup.psfhosted.org> Message-ID: <1555210172.36.0.817283630762.issue36427@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7723d0545c3369e1b2601b207c250c70ce90b75e by Pablo Galindo in branch '3.7': [3.7] bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread (GH-12541) (GH-12820) https://github.com/python/cpython/commit/7723d0545c3369e1b2601b207c250c70ce90b75e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 22:49:46 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 14 Apr 2019 02:49:46 +0000 Subject: [issue36427] Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread In-Reply-To: <1553552075.96.0.382616254369.issue36427@roundup.psfhosted.org> Message-ID: <1555210186.99.0.859987341657.issue36427@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 23:15:46 2019 From: report at bugs.python.org (Inada Naoki) Date: Sun, 14 Apr 2019 03:15:46 +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: <1555211746.35.0.619445315282.issue27987@roundup.psfhosted.org> Inada Naoki added the comment: Now PyGC_Head is 16byte on 64bit platform. Maybe, should we just change obmalloc in Python 3.8? How about 32bit platforms? What can we do for Python 3.7 and 2.7? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 13 23:51:58 2019 From: report at bugs.python.org (Inada Naoki) Date: Sun, 14 Apr 2019 03:51:58 +0000 Subject: [issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...) Message-ID: <1555213918.58.0.59549041225.issue1402289@roundup.psfhosted.org> Inada Naoki added the comment: 13 years past from this proposed. Is this still good feature for Python? Personally, I dislike adding more dynamic flexibility to Python name space. Python is very dynamic language, and it made difficult to make Python faster. For example, PHP is not so dynamic as Python, and it is one of reasons why PHP VM is now much faster than Python VM. They can easily do more optimization like function inlining statically. I'm interested in optimizing Python. But I'm not interested in adding more "slow path" we need to maintain forever. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 00:39:24 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 04:39:24 +0000 Subject: [issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator In-Reply-To: <1406670130.27.0.606950005482.issue22102@psf.upfronthosting.co.za> Message-ID: <1555216764.83.0.755466372558.issue22102@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +alanmcintyre, serhiy.storchaka, twouters versions: -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 01:55:10 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 05:55:10 +0000 Subject: [issue36622] Inconsistent exponent notation formatting In-Reply-To: <1555115815.06.0.0326129419561.issue36622@roundup.psfhosted.org> Message-ID: <1555221310.14.0.566743167038.issue36622@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Seems this has tests at https://github.com/python/cpython/blob/830b43d03cc47a27a22a50d777f23c8e60820867/Lib/test/test_decimal.py#L941 . I also noticed the below. Considering this is the behavior from 2.7 is it a conscious design decision? >>> '{:.5e}'.format(1.23457e+8) '1.23457e+08' >>> '{:.5e}'.format(decimal.Decimal(1.23457e+8)) '1.23457e+8' ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 01:57:31 2019 From: report at bugs.python.org (Dan Timofte) Date: Sun, 14 Apr 2019 05:57:31 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely Message-ID: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> New submission from Dan Timofte : after starting run_forever if all scheduled tasks are consumed run_once will issue a KqueueSelector.select(None) which will block indefinitely : https://www.freebsd.org/cgi/man.cgi?query=select&sektion=2&apropos=0&manpath=FreeBSD+12.0-RELEASE+and+Ports#DESCRIPTION after this new tasks are not being processed, trying to stop event loop with stop() is not working. this blocks immediatly : import asyncio import sys import signal def cb_signal_handler(signum, frame): asyncio.get_event_loop().stop() def main(): signal.signal(signal.SIGINT, cb_signal_handler) # asyncio.get_event_loop().create_task(asyncio.sleep(1)) asyncio.get_event_loop().run_forever() main() With asyncio.sleep uncomment it will block after 4 cycles. ---------- components: asyncio, macOS messages: 340182 nosy: asvetlov, dantimofte, ned.deily, ronaldoussoren, yselivanov priority: normal severity: normal status: open title: asyncio run_forever blocks indefinitely versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 01:57:56 2019 From: report at bugs.python.org (Inada Naoki) Date: Sun, 14 Apr 2019 05:57:56 +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: <1555221476.75.0.394641255026.issue31954@roundup.psfhosted.org> Inada Naoki added the comment: There are some more aggressive ideas. When Eric created C version of OrderedDict, he intended to use it for PEP 468. Unlike pure Python implementation, PyDict_GetItem returns value, not node of linked list. But now, PEP 468 is implemented in regular dict. How about raising DeprecationWarning when OrderedDict is passed to PyDict_* APIs? LRU implementation of functools is much more efficient than OrderedDict. OrderedDict can be achieve same performance and efficiency when node of linked list is stored in underlaying dict. ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 02:05:46 2019 From: report at bugs.python.org (Martin Panter) Date: Sun, 14 Apr 2019 06:05:46 +0000 Subject: [issue33632] undefined behaviour: signed integer overflow in threadmodule.c In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za> Message-ID: <1555221946.23.0.845397911564.issue33632@roundup.psfhosted.org> Martin Panter added the comment: Victor, if you run the test suite, one of the test cases should trigger the overflow. I used to compile with Undefined Behaviour Sanitizer to print messages when these errors occur; see for my setup at the time. I presume Antoine did something similar. I do not remember, but suspect the test case might be the following lines of ?BaseLockTests.test_timeout? in Lib/test/lock_tests.py, testing a fraction of a second less than PY_TIMEOUT_MAX: # TIMEOUT_MAX is ok lock.acquire(timeout=TIMEOUT_MAX) Perhaps reducing PY_TIMEOUT_MAX by a few centuries would be one way to avoid the problem. In my patch I avoided the problem by rearranging the arithmetic, so that the timeout value is only compared and reduced, never added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 02:08:53 2019 From: report at bugs.python.org (Dan Timofte) Date: Sun, 14 Apr 2019 06:08:53 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555222133.55.0.431144068858.issue36626@roundup.psfhosted.org> Change by Dan Timofte : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 02:17:54 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 14 Apr 2019 06:17:54 +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: <1555222674.8.0.871470405761.issue31954@roundup.psfhosted.org> Serhiy Storchaka added the comment: It the pure Python implementation PyDict_GetItem also returns value, not node of linked list. > How about raising DeprecationWarning when OrderedDict is passed to PyDict_* APIs? This would violate the Liskov substitution principle and add an overhead for using PyDict_* APIs with regular dicts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 02:25:32 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 06:25:32 +0000 Subject: [issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...) Message-ID: <1555223132.14.0.649104987086.issue1402289@roundup.psfhosted.org> Terry J. Reedy added the comment: I am willing to close it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 02:40:20 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 06:40:20 +0000 Subject: [issue36180] mboxMessage.get_payload throws TypeError on malformed content type In-Reply-To: <1551697417.39.0.601639302301.issue36180@roundup.psfhosted.org> Message-ID: <1555224020.9.0.942002297923.issue36180@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: A simplified reproducer as below. The tuple is returned from here https://github.com/python/cpython/blob/830b43d03cc47a27a22a50d777f23c8e60820867/Lib/email/message.py#L93 and perhaps is an untested code path? The charset gets a tuple value of ('utf-8??', '', '"utf-8?\xa0"') . import mailbox import tempfile broken_message = """ >From list at murphy.debian.org Wed Sep 24 01:22:15 2003 Date: Wed, 24 Sep 2003 07:05:50 +0200 From: Test test To: debian-devel-french at lists.debian.org Subject: Re: Test Mime-Version: 1.0 Content-Type: text/plain; charset*=utf-8?''utf-8%C2%A0 tr??s int??ress?? """ with tempfile.NamedTemporaryFile() as f: f.write(broken_message.encode()) f.seek(0) msg = mailbox.mbox(f.name) for m in msg: print(m.get_payload()) $ ../cpython/python.exe bpo36180.py Traceback (most recent call last): File "bpo36180.py", line 21, in print(m.get_payload()) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/email/message.py", line 267, in get_payload payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace') TypeError: decode() argument 1 must be str, not tuple sys:1: ResourceWarning: unclosed file <_io.BufferedRandom name='/var/folders/2b/mhgtnnpx4z943t4cc9yvw4qw0000gn/T/tmp4ddavb6g'> ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 02:52:04 2019 From: report at bugs.python.org (Marcin Niemira) Date: Sun, 14 Apr 2019 06:52:04 +0000 Subject: [issue36600] re-enable test in nntplib In-Reply-To: <1554978898.45.0.176655214392.issue36600@roundup.psfhosted.org> Message-ID: <1555224724.68.0.711276365814.issue36600@roundup.psfhosted.org> Marcin Niemira added the comment: Hey, Yes, it does. Closing issue and PR. Cheers! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 03:51:26 2019 From: report at bugs.python.org (Stefan Krah) Date: Sun, 14 Apr 2019 07:51:26 +0000 Subject: [issue36622] Inconsistent exponent notation formatting In-Reply-To: <1555115815.06.0.0326129419561.issue36622@roundup.psfhosted.org> Message-ID: <1555228286.94.0.696210345254.issue36622@roundup.psfhosted.org> Stefan Krah added the comment: Yes, I'd think the decisions are deliberate. Floats follow printf(), this is from the manual for 'e': "The exponent always contains at least two digits; if the value is zero, the exponent is 00." And decimal follows the specification at http://speleotrove.com/decimal/ . Of course Python's format() could decide to override the specification, but it would lead to more code complexity. But I don't think that mixing float/decimal output is a common use case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:07:16 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 08:07:16 +0000 Subject: [issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring() In-Reply-To: <1551985034.23.0.477389977226.issue36227@roundup.psfhosted.org> Message-ID: <1555229236.27.0.768688794301.issue36227@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset ffca16e25a70fd44a87b13b379b5ec0c7a11e926 by Stefan Behnel (Bernt R?skar Brenna) in branch 'master': bpo-36227: ElementTree.tostring() default_namespace and xml_declaration arguments (GH-12225) https://github.com/python/cpython/commit/ffca16e25a70fd44a87b13b379b5ec0c7a11e926 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:09:14 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 08:09:14 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555229354.49.0.63830816956.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset e9927e1820caea01e576141d9a623ea394d43dad by Stefan Behnel in branch 'master': bpo-30485: support a default prefix mapping in ElementPath by passing None as prefix (#1823) https://github.com/python/cpython/commit/e9927e1820caea01e576141d9a623ea394d43dad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:13:47 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 08:13:47 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555229627.08.0.493175740776.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: I've merged the PR. It matches the implementation that has been released in lxml almost two years ago. ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:16:04 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 08:16:04 +0000 Subject: [issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring() In-Reply-To: <1551985034.23.0.477389977226.issue36227@roundup.psfhosted.org> Message-ID: <1555229764.09.0.356968565515.issue36227@roundup.psfhosted.org> Stefan Behnel added the comment: Thank you for you contribution. ---------- components: +XML resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:19:31 2019 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 14 Apr 2019 08:19:31 +0000 Subject: [issue36622] Inconsistent exponent notation formatting In-Reply-To: <1555115815.06.0.0326129419561.issue36622@roundup.psfhosted.org> Message-ID: <1555229971.82.0.950229052423.issue36622@roundup.psfhosted.org> Mark Dickinson added the comment: Indeed it's deliberate. When the Decimal type was introduced, the "at least two exponent digits" behaviour of float formatting was already long established. But the specification that the Decimal type was based on (and the extensive test cases from the same source) use the minimum number of exponent digits instead. If we want to make the two things consistent, that means either deliberately introducing incompatibilities with the Decimal specification, or changing long-standing behaviour for float. There's no reason in principle that we couldn't modify the float formatting to use a single digit in the exponent (assuming that exponent is smaller than 10 in absolute value). I'd expect that that would upset more people than it would help, though. My guess is that the "at least 2 digits" rule in C99 7.24.2 is there to make it easier to align tables of values formatted in scientific notation. I can't think of another reason for force at least two digits. For your use-case, could you convert all `float` objects to `Decimal` objects before comparison? The float to Decimal conversion doesn't lose any information (unlike the reverse conversion). Closing this as "not a bug". There's certainly room for proposing and discussing changes to the behaviour, but that's probably best done on the python-ideas mailing list rather than the bug tracker. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:32:26 2019 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 14 Apr 2019 08:32:26 +0000 Subject: [issue36622] Inconsistent exponent notation formatting In-Reply-To: <1555115815.06.0.0326129419561.issue36622@roundup.psfhosted.org> Message-ID: <1555230746.4.0.312254891112.issue36622@roundup.psfhosted.org> Mark Dickinson added the comment: FWIW, here's where that "at least two digits" is encoded in the CPython source: https://github.com/python/cpython/blob/bf94cc7b496a379e1f604aa2e4080bb70ca4020e/Python/pystrtod.c#L1227 *If* we wanted to, it would be an easy change to get rid of the extra leading exponent zeros. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:33:57 2019 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 14 Apr 2019 08:33:57 +0000 Subject: [issue36625] Obsolete comments in docstrings in fractions module In-Reply-To: <1555196323.81.0.314132124963.issue36625@roundup.psfhosted.org> Message-ID: <1555230837.26.0.0731943356333.issue36625@roundup.psfhosted.org> Mark Dickinson added the comment: Agreed that these should be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 04:42:59 2019 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Sun, 14 Apr 2019 08:42:59 +0000 Subject: [issue17013] Allow waiting on a mock In-Reply-To: <1358856947.82.0.71016271567.issue17013@psf.upfronthosting.co.za> Message-ID: <1555231379.57.0.382493269097.issue17013@roundup.psfhosted.org> Change by L?szl? Kiss Koll?r : ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 05:10:24 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 09:10:24 +0000 Subject: [issue31658] xml.sax.parse won't accept path objects In-Reply-To: <1506891071.57.0.213398074469.issue31658@psf.upfronthosting.co.za> Message-ID: <1555233024.51.0.142377668175.issue31658@roundup.psfhosted.org> Stefan Behnel added the comment: PR looks good to me. Doesn't look critical enough for a backport, though. ---------- nosy: +scoder versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 05:17:12 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 09:17:12 +0000 Subject: [issue31658] xml.sax.parse won't accept path objects In-Reply-To: <1506891071.57.0.213398074469.issue31658@psf.upfronthosting.co.za> Message-ID: <1555233432.5.0.698650727373.issue31658@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset 929b70473829f04dedb8e802abcbd506926886e1 by Stefan Behnel (Micka?l Schoentgen) in branch 'master': bpo-31658: Make xml.sax.parse accepting Path objects (GH-8564) https://github.com/python/cpython/commit/929b70473829f04dedb8e802abcbd506926886e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 05:18:08 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 09:18:08 +0000 Subject: [issue31658] xml.sax.parse won't accept path objects In-Reply-To: <1506891071.57.0.213398074469.issue31658@psf.upfronthosting.co.za> Message-ID: <1555233488.57.0.55815620619.issue31658@roundup.psfhosted.org> Change by Stefan Behnel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 05:18:33 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 09:18:33 +0000 Subject: [issue31658] xml.sax.parse won't accept path objects In-Reply-To: <1506891071.57.0.213398074469.issue31658@psf.upfronthosting.co.za> Message-ID: <1555233513.56.0.480248929133.issue31658@roundup.psfhosted.org> Stefan Behnel added the comment: Thanks for your contribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 05:32:03 2019 From: report at bugs.python.org (Tsvika Shapira) Date: Sun, 14 Apr 2019 09:32:03 +0000 Subject: [issue36627] composing filter() doesn't work as expected Message-ID: <1555234323.36.0.791779964301.issue36627@roundup.psfhosted.org> New submission from Tsvika Shapira : the following code: ``` lists_to_filter = [ ['a', 'exclude'], ['b'] ] # notice that when 'exclude' is the last element, the code returns the expected result for exclude_label in ['exclude', 'something']: lists_to_filter = (labels_list for labels_list in lists_to_filter if exclude_label not in labels_list) # notice that changing the line above to the commented line below (i.e. expanding the generator to a list) will make the code output the expected result, # i.e. the issue is only when using filter on another filter, and not on a list # lists_to_filter = [labels_list for labels_list in lists_to_filter if exclude_label not in labels_list] lists_to_filter = list(lists_to_filter) print(lists_to_filter) ``` as far as i understand, the code above should output "[['b']]" instead it outputs "[['a', 'exclude'], ['b']]" ---------- messages: 340200 nosy: Tsvika Shapira priority: normal severity: normal status: open title: composing filter() doesn't work as expected type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 06:07:17 2019 From: report at bugs.python.org (Dmitrii Pasechnik) Date: Sun, 14 Apr 2019 10:07:17 +0000 Subject: [issue36231] no "proper" header files on macOS 10.14 Mojave In-Reply-To: <1552039427.3.0.599611853277.issue36231@roundup.psfhosted.org> Message-ID: <1555236437.19.0.000279642005642.issue36231@roundup.psfhosted.org> Change by Dmitrii Pasechnik : ---------- pull_requests: +12750 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 06:15:16 2019 From: report at bugs.python.org (Dmitrii Pasechnik) Date: Sun, 14 Apr 2019 10:15:16 +0000 Subject: [issue36231] no "proper" header files on macOS 10.14 Mojave In-Reply-To: <1552039427.3.0.599611853277.issue36231@roundup.psfhosted.org> Message-ID: <1555236916.41.0.115509787782.issue36231@roundup.psfhosted.org> Dmitrii Pasechnik added the comment: In case,I have opened PR https://github.com/python/cpython/pull/12825 to provide our solution to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 06:15:16 2019 From: report at bugs.python.org (SilentGhost) Date: Sun, 14 Apr 2019 10:15:16 +0000 Subject: [issue36627] composing generator expression doesn't work as expected In-Reply-To: <1555234323.36.0.791779964301.issue36627@roundup.psfhosted.org> Message-ID: <1555236916.9.0.386628541613.issue36627@roundup.psfhosted.org> SilentGhost added the comment: I probably won't be able to better explain the issue then Benjamin did in the referenced issue. Just to note, that (...) in your code are called generator expressions. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed superseder: -> nested generator expression produces strange results title: composing filter() doesn't work as expected -> composing generator expression doesn't work as expected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 08:27:10 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 14 Apr 2019 12:27:10 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555244830.12.0.353504583922.issue36626@roundup.psfhosted.org> Andrew Svetlov added the comment: Callin `self._write_to_self()` from `loop.stop()` should fix your problem. Would you provide a patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 08:27:20 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 14 Apr 2019 12:27:20 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555244840.44.0.834723888797.issue36626@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 08:35:27 2019 From: report at bugs.python.org (Oliver Bestwalter) Date: Sun, 14 Apr 2019 12:35:27 +0000 Subject: [issue35278] [security] directory traversal in tempfile prefix In-Reply-To: <1542631563.19.0.788709270274.issue35278@psf.upfronthosting.co.za> Message-ID: <1555245327.77.0.0742320500359.issue35278@roundup.psfhosted.org> Oliver Bestwalter added the comment: I am not sure if this justifies a new issue so I add this here. The suffix parameter can also be used for a traversal attack. It is possible to completely clobber anything in dir and prefix (at least on Windows). e.g. calling mkdtemp or NamedTemporaryFile with these paramers ... dir=r"C:\tmp", prefix="pre", suffix="../../../../../../../../../gotcha" Will result in a directory or file being created at C:/gotcha. I also wonder if this would justify adding a warning to the documentation for all existing Python versions? Quoting from the documentation of mkstemp (https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp): > If prefix is specified, the file name will begin with that prefix; otherwise, a default prefix is used. > > If dir is specified, the file will be created in that directory [...] As both claims are rendered untrue when using suffix in the above described way I think this should be amended. ---------- nosy: +obestwalter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 09:11:34 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 14 Apr 2019 13:11:34 +0000 Subject: [issue13127] xml.dom.Attr.name is not labeled as read-only In-Reply-To: <1318047492.07.0.217686953928.issue13127@psf.upfronthosting.co.za> Message-ID: <1555247494.82.0.490009002407.issue13127@roundup.psfhosted.org> Cheryl Sabella added the comment: Stefan, Do you think this should be documented? ---------- nosy: +cheryl.sabella, scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 09:54:43 2019 From: report at bugs.python.org (Harmandeep Singh) Date: Sun, 14 Apr 2019 13:54:43 +0000 Subject: [issue13927] Document time.ctime format In-Reply-To: <1328215776.48.0.974828105123.issue13927@psf.upfronthosting.co.za> Message-ID: <1555250083.79.0.776899613628.issue13927@roundup.psfhosted.org> Harmandeep Singh added the comment: I have updated the PR, this time I have kept it really simple, and have added examples showing both the cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 09:58:27 2019 From: report at bugs.python.org (Aditya Shankar) Date: Sun, 14 Apr 2019 13:58:27 +0000 Subject: [issue36628] Enhancement: i-Strings Message-ID: <1555250307.08.0.914630498101.issue36628@roundup.psfhosted.org> New submission from Aditya Shankar : Problem: multiline strings are a pain to represent (other than of-course in docstrings), representing a multiline string inside a function looks something like this - def foo(): # some code ... ... # some code text = """abc meta alpha chronos dudes uptomes this text is nonsense""" return somethingwith(text) or def foo(): # some code ... ... # some code text = "\n".join(["abc meta alpha chronos", "dudes uptomes this text", "is nonsense"]) return somethingwith(text) an enhancement would be - def foo(): # some code ... ... # some code text = i""" abc meta alpha chronos dudes uptomes this text is nonsense """ return somethingwith(text) i.e. all initial spaces are not considered as a part of the string in each ine for example while throwing an exception - def foo(bad_param): ... try: some_function_on(bad_param) except someException: throw(fi""" you cant do that because, and I'm gonna explain this in a paragraph of text with this {variable} because it explains things more clearly, also here is the {bad_param} """) ... which is far neater than - def foo(bad_param): ... try: some_function_on(bad_param) except someException: throw(f"""you cant do that because, and I'm gonna explain this in a paragraph of text with this {variable} because it explains things more clearly, also here is the {bad_param}""") ... pros: - represented code is closer to output text - implementation should not be too hard ---------- components: Interpreter Core messages: 340208 nosy: Aditya Shankar priority: normal severity: normal status: open title: Enhancement: i-Strings type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:05:22 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 14 Apr 2019 14:05:22 +0000 Subject: [issue35967] Better platform.processor support In-Reply-To: <1549895363.53.0.252912531241.issue35967@roundup.psfhosted.org> Message-ID: <1555250722.3.0.588055402828.issue35967@roundup.psfhosted.org> Jason R. Coombs added the comment: In PR 12824 (https://github.com/python/cpython/pull/12824), I've developed a test that should assure the current output from uname().processor. I've merged those changes with PR 12239, which if the tests pass, should illustrate the values returned are unchanged. @lemburg, would you be willing to review these PRs to confirm they capture and address your concern? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:10:05 2019 From: report at bugs.python.org (SilentGhost) Date: Sun, 14 Apr 2019 14:10:05 +0000 Subject: [issue36628] Enhancement: i-Strings In-Reply-To: <1555250307.08.0.914630498101.issue36628@roundup.psfhosted.org> Message-ID: <1555251005.25.0.884936068302.issue36628@roundup.psfhosted.org> SilentGhost added the comment: This type of enhancements should be in the first place discussed on python-ideas mailing list and a PEP would probably be needed at the second stage. Not that I think it's likely this suggestion has much chance. What you're desiring can already be implemented using implicit string concatenation (with addition of some parentheses in some of your examples). ---------- nosy: +SilentGhost resolution: -> postponed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:14:24 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 14:14:24 +0000 Subject: [issue13127] xml.dom.Attr.name is not labeled as read-only In-Reply-To: <1318047492.07.0.217686953928.issue13127@psf.upfronthosting.co.za> Message-ID: <1555251264.46.0.308491119128.issue13127@roundup.psfhosted.org> Stefan Behnel added the comment: The intended interface seems to be to change .name rather than .localName, so yes, that should be documented somewhere. The implementation seems a bit funny in that a "self._localName", if set, takes precedence, but there doesn't seem to be an official way to set it. The Attr() constructor even takes a "localname" argument, which it then ignores. o_O ---------- components: +XML stage: test needed -> needs patch versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:34:01 2019 From: report at bugs.python.org (Marat Sharafutdinov) Date: Sun, 14 Apr 2019 14:34:01 +0000 Subject: [issue36629] imaplib test fails with errno 101 Message-ID: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> New submission from Marat Sharafutdinov : ====================================================================== FAIL: test_imap4_host_default_value (test.test_imaplib.TestImaplib) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/python/Lib/test/test_imaplib.py", line 94, in test_imap4_host_default_value self.assertIn(cm.exception.errno, expected_errnos) AssertionError: 101 not found in [111, 99] ---------------------------------------------------------------------- I guess `errno.ENETUNREACH` should be added to the `expected_errnos` as it done within `test_create_connection` (test.test_socket.NetworkConnectionNoServer). ---------- components: Tests messages: 340212 nosy: decaz priority: normal severity: normal status: open title: imaplib test fails with errno 101 type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:42:48 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 14:42:48 +0000 Subject: [issue36628] Enhancement: i-Strings In-Reply-To: <1555250307.08.0.914630498101.issue36628@roundup.psfhosted.org> Message-ID: <1555252968.22.0.745219548792.issue36628@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Some discussions in the past and the common suggestion/idiom is to use textwrap.dedent. I agree with @SilentGhost that it should be first brought up in python-ideas and also addressing the concerns for similar proposal in the past if they are still valid. Proposes d"" for indentation : https://mail.python.org/pipermail/python-ideas/2010-November/008589.html https://mail.python.org/pipermail/python-dev/2005-July/054649.html ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:51:33 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 14:51:33 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555253493.41.0.717712418086.issue36629@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Did you see this failure somewhere in CI or is it in local machine? The imaplib test has below comment : if hasattr(errno, 'EADDRNOTAVAIL'): # socket.create_connection() fails randomly with # EADDRNOTAVAIL on Travis CI. expected_errnos.append(errno.EADDRNOTAVAIL) As noted in initial report test_socket has ENETUNREACH added https://github.com/python/cpython/blob/929b70473829f04dedb8e802abcbd506926886e1/Lib/test/test_socket.py#L4808 so ENETUNREACH could also be added to this test too? ---------- nosy: +barry, r.david.murray, vstinner, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 10:58:46 2019 From: report at bugs.python.org (Marat Sharafutdinov) Date: Sun, 14 Apr 2019 14:58:46 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555253926.72.0.325276919885.issue36629@roundup.psfhosted.org> Marat Sharafutdinov added the comment: I see this error on my local Bamboo CI (runs on CentOS 7). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 11:45:55 2019 From: report at bugs.python.org (Dan Timofte) Date: Sun, 14 Apr 2019 15:45:55 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555256755.4.0.198533687768.issue36626@roundup.psfhosted.org> Dan Timofte added the comment: i will provide a patch, i'll make a pull request next week. a call to self._write_to_self() should also be added to create_task() before it returns . i'll make the correction for this as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 12:04:40 2019 From: report at bugs.python.org (Michael Felt) Date: Sun, 14 Apr 2019 16:04:40 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555257880.16.0.504596384662.issue36624@roundup.psfhosted.org> Michael Felt added the comment: I took a peak at test.support. a) I see that while many tests import test.support, or from test.support import - not all tests use this. b) I see that only 35 .py files in Lib/test have the string sys.platform.startswith, and there are 76 files that have sys.platform (so, there are roughly 40 files that have sys.platform without startswith). I can start by adding _AIX to test.support and adding (as needed) from test.support import _AIX (and later _Linux, _Darwin) in the "35" files. If that seems to be working - and looking - proper the other 40 files could be added to the change. Is this a good way to get started? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 12:46:49 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 14 Apr 2019 16:46:49 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module In-Reply-To: <1555020782.09.0.948988048159.issue36608@roundup.psfhosted.org> Message-ID: <1555260409.37.0.106243127453.issue36608@roundup.psfhosted.org> Serhiy Storchaka added the comment: I proposed to move bundled pip and setuptools to the external repository and download them at build time like Tcl and other dependencies on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:18:34 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 14 Apr 2019 17:18:34 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555262314.14.0.283445212174.issue16079@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +12752 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:21:29 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 14 Apr 2019 17:21:29 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555262489.2.0.846232571632.issue16079@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +easy versions: +Python 3.7, Python 3.8 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:23:31 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 14 Apr 2019 17:23:31 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555262611.5.0.123042491597.issue16079@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- components: +Tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:32:10 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 14 Apr 2019 17:32:10 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555263130.14.0.218016683338.issue16079@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset cd466559c4a312b3c1223a774ad4df19fc4f0407 by Gregory P. Smith in branch 'master': bpo-16079: fix duplicate test method name in test_gzip. (GH-12827) https://github.com/python/cpython/commit/cd466559c4a312b3c1223a774ad4df19fc4f0407 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:32:39 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 14 Apr 2019 17:32:39 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555263159.21.0.132486693351.issue16079@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:35:03 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 14 Apr 2019 17:35:03 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555263303.4.0.374637835785.issue16079@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:44:20 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 17:44:20 +0000 Subject: [issue10417] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function In-Reply-To: <1289739891.46.0.690681439003.issue10417@psf.upfronthosting.co.za> Message-ID: <1555263860.22.0.691704599221.issue10417@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +12754 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:49:53 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 17:49:53 +0000 Subject: [issue10417] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function In-Reply-To: <1289739891.46.0.690681439003.issue10417@psf.upfronthosting.co.za> Message-ID: <1555264193.64.0.20054228999.issue10417@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is still an issue with latest 2.7. I went ahead and created PR based on Victor's suggestion in msg121294. I am not sure of the correct way to test this I have used cStringIO.StringIO as the stream for a test case with a unicode description along with setting default encoding as 'ascii'. I tested the original report to make sure the patch fixes the error. $ PYTHONIOENCODING=ascii ./python.exe ../backups/bpo10417.py --verbose test_unicode_docstring (__main__.UnicodeTest) t\xe4st - docstring with unicode character ... ok ---------------------------------------------------------------------- Ran 1 test in 0.004s OK ---------- nosy: +xtreak stage: patch review -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 13:50:56 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 14 Apr 2019 17:50:56 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555264256.07.0.13547806305.issue16079@roundup.psfhosted.org> miss-islington added the comment: New changeset 9f9e029bd2223ecba46eaefecadf0ac252d891f2 by Miss Islington (bot) in branch '3.7': bpo-16079: fix duplicate test method name in test_gzip. (GH-12827) https://github.com/python/cpython/commit/9f9e029bd2223ecba46eaefecadf0ac252d891f2 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 14:10:38 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 18:10:38 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555265438.25.0.770076895288.issue30485@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I am not sure but this commit seems to have broken Azure CI on master for Windows. The build checks were green when the PR while merging. I can see the ValueError added in e9927e1820caea01e576141d9a623ea394d43dad raised in the below CI log and it's occurring consistently https://dev.azure.com/Python/cpython/_build/results?buildId=40862&view=logs&jobId=0fcf9c9b-89fc-526f-8708-363e467e119e&taskId=ae411532-3d9e-5cb2-bb36-07007cc5bb48&lineStart=37&lineEnd=38&colStart=1&colEnd=1 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 14:31:05 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 18:31:05 +0000 Subject: [issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs In-Reply-To: <1517894879.39.0.467229070634.issue32780@psf.upfronthosting.co.za> Message-ID: <1555266665.17.0.806855749449.issue32780@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 14:39:34 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 18:39:34 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555267174.72.0.703987165758.issue30485@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: +12755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 14:41:20 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 18:41:20 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555267280.54.0.605167873981.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: Interesting. Thanks for investigating this. It looks like the script "appxmanifest.py" uses an empty string as prefix for a lookup: File "D:\a\1\s\PC\layout\support\appxmanifest.py", line 407, in get_appxmanifest node = xml.find("m:Identity", NS) I don't know where that script comes from, but it suggests that strictly rejecting this kind of invalid library usage might not be the right thing to do for now. It seems to be a case where users pass an arbitrary prefix-namespace dict into .find() that they happen to have lying around, expecting unused mappings to be ignored. I pushed a PR that removes the exception for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 14:50:20 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 14 Apr 2019 18:50:20 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555267820.85.0.287458154685.issue30485@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The relevant line is at https://github.com/python/cpython/blob/cd466559c4a312b3c1223a774ad4df19fc4f0407/PC/layout/support/appxmanifest.py#L407 . I guess it's something related to build artifacts for Windows and Steve can have a better answer over the file's usage and this specific line of change. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 14:51:34 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 14 Apr 2019 18:51:34 +0000 Subject: [issue10417] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function In-Reply-To: <1289739891.46.0.690681439003.issue10417@psf.upfronthosting.co.za> Message-ID: <1555267894.74.6.98270370137e-05.issue10417@roundup.psfhosted.org> Serhiy Storchaka added the comment: Test that your fix does not break the case of 8-bit non-ascii docstring. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 15:07:17 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 19:07:17 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555268837.76.0.436665567301.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: The script seems to generally assume that "" is a good representation for "no prefix", i.e. the default namespace, although that is IMHO more correctly represented as None. It's not very likely that this is the only script out there that makes that assumption. In fact, this might not be an entirely stupid assumption, given that None doesn't sort together with strings, for example. And sorting prefixes is not an unusual thing to do. That makes it a case of "practicality beats purity", I guess ? I'll change the implementation to allow empty strings. ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 15:12:39 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 14 Apr 2019 19:12:39 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555269159.03.0.413934035884.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset 3c5a858ec6a4e5851903762770fe526a46d3c351 by Stefan Behnel in branch 'master': bpo-30485: Re-allow empty strings in ElementPath namespace mappings since they might actually be harmless and unused (and thus went undetected previously). (#12830) https://github.com/python/cpython/commit/3c5a858ec6a4e5851903762770fe526a46d3c351 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 15:32:58 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 14 Apr 2019 19:32:58 +0000 Subject: [issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1 Message-ID: <1555270378.07.0.766030130411.issue36630@roundup.psfhosted.org> New submission from Xavier de Gaye : ncurses version: 6.1 TERM: screen-256color $ ./python -m test -u curses test_curses Run tests sequentially 0:00:00 load avg: 0.55 [1/1] test_curses test test_curses failed -- Traceback (most recent call last): File "/path/to/Lib/test/test_curses.py", line 285, in test_colors_funcs curses.pair_content(curses.COLOR_PAIRS - 1) OverflowError: signed short integer is greater than maximum test_curses failed == Tests result: FAILURE == Not sure if the following is relevant. In /usr/include/ncurses.h: NCURSES_WRAPPED_VAR(int, COLOR_PAIRS); ... #define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS()) ... extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; ncurses 6.1 release notes [1] says: The TERMINAL structure in is now opaque. Doing that allowed making the structure larger, to hold the extended numeric data. ... The new data in TERMINAL holds the same information as TERMTYPE, but with larger numbers (?int? versus ?short?). It is named TERMTYPE2. [1] https://www.gnu.org/software/ncurses/ ---------- components: Tests messages: 340228 nosy: xdegaye priority: normal severity: normal status: open title: failure of test_colors_funcs in test_curses with ncurses 6.1 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 15:40:05 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 14 Apr 2019 19:40:05 +0000 Subject: [issue27326] SIGSEV in test_window_funcs of test_curses In-Reply-To: <1465986396.24.0.604076353768.issue27326@psf.upfronthosting.co.za> Message-ID: <1555270805.3.0.615720209447.issue27326@roundup.psfhosted.org> Xavier de Gaye added the comment: Cannot reproduce the crash with Python 3.7.3 on ncurses 6.1. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 15:44:55 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 14 Apr 2019 19:44:55 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1555271095.95.0.926611197385.issue30840@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12756 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 16:04:27 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 20:04:27 +0000 Subject: [issue32782] ctypes: memoryview gives incorrect PEP3118 itemsize for array of length zero In-Reply-To: <1517943201.04.0.467229070634.issue32782@psf.upfronthosting.co.za> Message-ID: <1555272267.66.0.396391978203.issue32782@roundup.psfhosted.org> Terry J. Reedy added the comment: This issue is about the itemsize attribute of instances of the built-in memoryview class. Ctypes in only involved in providing format information. Hence the nosy additions. On Win10 with 3.8, ctypes has no uint attributes. Using 'c_int32' instead, I see the same behavior (itemsize 0 for empty structure). About itemsize, https://www.python.org/dev/peps/pep-3118/ says "This is a storage for the itemsize (in bytes) of each element of the shared memory. It is technically un-necessary as it can be obtained using PyBuffer_SizeFromFormat, however an exporter may know this information without parsing the format string and it is necessary to know the itemsize for proper interpretation of striding. Therefore, storing it is more convenient and faster." The first line could be seen as implying that itemsize is undefined if there are no items (and as justifying numbytes/numitems otherwise). The 0 return could be seen as equivalent to a None return from a python-coded function. If so, it is not a bug, and there might be code that would break if it is changed. On the other hand, the next lines imply that itemsize is *usually*, though not necessarily, a cache for PyBuffer_SizeFromFormat. This could be seen as implying that in the absence of other information, the itemsize should be calculated from the format, making 0 a bug. ---------- components: +Interpreter Core -ctypes nosy: +skrah, teoliphant, terry.reedy versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 16:05:19 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 20:05:19 +0000 Subject: [issue32782] memoryview gives incorrect PEP3118 itemsize for empty array In-Reply-To: <1517943201.04.0.467229070634.issue32782@psf.upfronthosting.co.za> Message-ID: <1555272319.11.0.756327463393.issue32782@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: ctypes: memoryview gives incorrect PEP3118 itemsize for array of length zero -> memoryview gives incorrect PEP3118 itemsize for empty array _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 16:14:41 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 20:14:41 +0000 Subject: [issue32782] memoryview & ctypes: incorrect PEP3118 itemsize for empty array In-Reply-To: <1517943201.04.0.467229070634.issue32782@psf.upfronthosting.co.za> Message-ID: <1555272881.98.0.954051387931.issue32782@roundup.psfhosted.org> Terry J. Reedy added the comment: This is actually about memoryview.itemsize within ctypes. ---------- components: +ctypes title: memoryview gives incorrect PEP3118 itemsize for empty array -> memoryview & ctypes: incorrect PEP3118 itemsize for empty array _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 16:25:23 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 20:25:23 +0000 Subject: [issue32782] memoryview & ctypes: incorrect itemsize for empty array In-Reply-To: <1517943201.04.0.467229070634.issue32782@psf.upfronthosting.co.za> Message-ID: <1555273523.82.0.925482014155.issue32782@roundup.psfhosted.org> Terry J. Reedy added the comment: https://docs.python.org/3/library/stdtypes.html#typememoryview says "itemsize The size in bytes of each element of the memoryview" Revising the code example to use an empty array: >>> import array, struct >>> m = memoryview(array.array('H', [0]) >>> m.itemsize 2 I agree that itemsize should also be non-zero for ctype formats. ---------- title: memoryview & ctypes: incorrect PEP3118 itemsize for empty array -> memoryview & ctypes: incorrect itemsize for empty array _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 16:32:05 2019 From: report at bugs.python.org (Michael Felt) Date: Sun, 14 Apr 2019 20:32:05 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555257880.16.0.504596384662.issue36624@roundup.psfhosted.org> Message-ID: <7cc843d2-13c2-46e7-56b0-cdad76266743@felt.demon.nl> Michael Felt added the comment: On 14/04/2019 18:04, Michael Felt wrote: > Is this a good way to get started? So, as an example - seems to be many attributes in test/support/__init__.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 5bd15a2..e20567f 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -101,6 +101,8 @@ __all__ = [ ???? # network ???? "HOST", "IPV6_ENABLED", "find_unused_port", "bind_port", "open_urlresource", ???? "bind_unix_socket", +??? # platform +??? "is_aix", ???? # processes ???? 'temp_umask', "reap_children", ???? # logging @@ -815,6 +817,7 @@ requires_bz2 = unittest.skipUnless(bz2, 'requires bz2') ?requires_lzma = unittest.skipUnless(lzma, 'requires lzma') ?is_jython = sys.platform.startswith('java') +is_aix = platform.system() == 'AIX' ?is_android = hasattr(sys, 'getandroidapilevel') diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py index 35272b5..0685ed8 100644 --- a/Lib/test/test_c_locale_coercion.py +++ b/Lib/test/test_c_locale_coercion.py @@ -10,6 +10,7 @@ import unittest ?from collections import namedtuple ?from test import support +is_aix = support.is_aix ?from test.support.script_helper import ( ???? run_python_until_end, ???? interpreter_requires_environment, @@ -40,7 +41,7 @@ if sys.platform.startswith("linux"): ???????? # TODO: Once https://bugs.python.org/issue30672 is addressed, we'll be ???????? #?????? able to check this case unconditionally ???????? EXPECTED_C_LOCALE_EQUIVALENTS.append("POSIX") -elif sys.platform.startswith("aix"): +elif is_aix: ???? # AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII ???? EXPECTED_C_LOCALE_STREAM_ENCODING = "iso8859-1" ???? EXPECTED_C_LOCALE_FS_ENCODING = "iso8859-1" I had originally been thinking using _AIX, but the convention seems to be is_xyzsomething. Comments welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 16:38:47 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 14 Apr 2019 20:38:47 +0000 Subject: [issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs In-Reply-To: <1517894879.39.0.467229070634.issue32780@psf.upfronthosting.co.za> Message-ID: <1555274327.58.0.685695791579.issue32780@roundup.psfhosted.org> Terry J. Reedy added the comment: Fixing one case is better than fixing no cases. ---------- nosy: +skrah, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 17:12:56 2019 From: report at bugs.python.org (Stefan Krah) Date: Sun, 14 Apr 2019 21:12:56 +0000 Subject: [issue32782] memoryview & ctypes: incorrect itemsize for empty array In-Reply-To: <1517943201.04.0.467229070634.issue32782@psf.upfronthosting.co.za> Message-ID: <1555276376.65.0.488531640339.issue32782@roundup.psfhosted.org> Stefan Krah added the comment: I agree that it is a ctypes issue, itemsize should be equal to struct.calcsize(fmt), which is never 0 for normal PEP-3118 types like the one in the example. [Pedantically, I think that the grammar would allow for an empty record "T{}" that would have itemsize 0 but is of little use inside numpy.] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 17:21:38 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 14 Apr 2019 21:21:38 +0000 Subject: [issue36619] when is os.posix_spawn(setsid=True) safe? In-Reply-To: <1555091890.2.0.391429247327.issue36619@roundup.psfhosted.org> Message-ID: <1555276898.96.0.0496765838537.issue36619@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 17:29:15 2019 From: report at bugs.python.org (Eric Wieser) Date: Sun, 14 Apr 2019 21:29:15 +0000 Subject: [issue32782] memoryview & ctypes: incorrect itemsize for empty array In-Reply-To: <1517943201.04.0.467229070634.issue32782@psf.upfronthosting.co.za> Message-ID: <1555277355.13.0.844035648176.issue32782@roundup.psfhosted.org> Eric Wieser added the comment: > Revising the code example to use an empty array I think you mean >>> import array >>> memoryview(array.array('H', [])).itemsize 2 Your example is an array containing 0, not an empty array - but the conclusion is the same. > It is technically un-necessary as it can be obtained using PyBuffer_SizeFromFormat This obviously predicates on `PyBuffer_SizeFromFormat` being implemented, which according to the docs it is not. > I think that the grammar would allow for an empty record "T{}" that would have itemsize 0 but is of little use inside numpy. It also allows for records of empty arrays, "T{(0)d:data:}". While these are of little use, they _are_ supported by both ctypes and numpy, so we should support them in the PEP3118 interface used between them. ---------- nosy: +Eric Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 19:52:14 2019 From: report at bugs.python.org (ppperry) Date: Sun, 14 Apr 2019 23:52:14 +0000 Subject: [issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...) Message-ID: <1555285934.16.0.54934887447.issue1402289@roundup.psfhosted.org> ppperry added the comment: See also issue32615 ---------- nosy: +ppperry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 20:13:47 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 15 Apr 2019 00:13:47 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555287227.78.0.12312655293.issue30485@roundup.psfhosted.org> Steve Dower added the comment: I don't recall where I got the empty string from, but it's certainly what I've used there for a while. Maybe it's required in register_namespace() to set the default namespace? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 14 20:52:41 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 15 Apr 2019 00:52:41 +0000 Subject: [issue1402289] Allow mappings as globals (was: Fix dictionary subclass ...) Message-ID: <1555289561.38.0.646558771183.issue1402289@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur that this should be closed. We have a decade of evidence that no one really needs this. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 02:21:39 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 06:21:39 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1555309299.74.0.319390809134.issue27860@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 02:26:08 2019 From: report at bugs.python.org (Aditya Shankar) Date: Mon, 15 Apr 2019 06:26:08 +0000 Subject: [issue36628] Enhancement: i-Strings In-Reply-To: <1555250307.08.0.914630498101.issue36628@roundup.psfhosted.org> Message-ID: <1555309568.01.0.322945807019.issue36628@roundup.psfhosted.org> Change by Aditya Shankar : ---------- resolution: postponed -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 03:01:06 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 07:01:06 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1555311666.63.0.959588834251.issue27860@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 2430d532e240dea55f0082d1e9bf2e0f3d7505be by Inada Naoki in branch 'master': bpo-27860: use cached_property (GH-12832) https://github.com/python/cpython/commit/2430d532e240dea55f0082d1e9bf2e0f3d7505be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 03:57:29 2019 From: report at bugs.python.org (Peixing Xin) Date: Mon, 15 Apr 2019 07:57:29 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555315049.1.0.111377425239.issue31904@roundup.psfhosted.org> Change by Peixing Xin : ---------- pull_requests: +12758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 04:28:14 2019 From: report at bugs.python.org (Jakub Kulik) Date: Mon, 15 Apr 2019 08:28:14 +0000 Subject: [issue36610] os.sendfile can return EINVAL on Solaris In-Reply-To: <1555059394.06.0.893471228224.issue36610@roundup.psfhosted.org> Message-ID: <1555316894.0.0.0183206086155.issue36610@roundup.psfhosted.org> Jakub Kulik added the comment: Here is a traceback from one failed test: test test_lib2to3 failed ====================================================================== ERROR: test_refactor_file_write_unchanged_file (lib2to3.tests.test_refactor.TestRefactoringTool) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/Python-3.8.0a3/Lib/lib2to3/tests/test_refactor.py", line 228, in test_refactor_file_write_unchanged_file self.check_file_refactoring(test_file, fixers=(), File "/tmp/Python-3.8.0a3/Lib/lib2to3/tests/test_refactor.py", line 183, in check_file_refactoring test_file = self.init_test_file(test_file) File "/tmp/Python-3.8.0a3/Lib/lib2to3/tests/test_refactor.py", line 202, in init_test_file shutil.copy(test_file, tmpdir) File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 401, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 266, in copyfile _fastcopy_sendfile(fsrc, fdst) File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 165, in _fastcopy_sendfile raise err File "/tmp/Python-3.8.0a3/Lib/shutil.py", line 145, in _fastcopy_sendfile sent = os.sendfile(outfd, infd, offset, blocksize) OSError: [Errno 22] Invalid argument: '/tmp/Python-3.8.0a3/Lib/lib2to3/tests/data/fixers/parrot_example.py' -> '/tmp/2to3-test_refactoruxve6nrz/parrot_example.py' I also have a script which can reproduce this (attached). It happens to me every time my offset is bigger or equal than the size of the file, no matter whether the file is empty or offset is bigger than the size right from the start, even when in a loop, sending in several parts. The attached example works on my Linux machine (outputs 12 and 0), but breaks on Solaris (12 and exception). As I have said before, it might be just that Python (specifically sendfile implementation) is not compiled correctly on Solaris and changes to define guards might fix that. ---------- Added file: https://bugs.python.org/file48266/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 04:29:29 2019 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 15 Apr 2019 08:29:29 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555316969.5.0.972869080335.issue36616@roundup.psfhosted.org> Petr Viktorin added the comment: Indeed, this is a good idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 04:54:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 08:54:33 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555318473.64.0.221479664803.issue36616@roundup.psfhosted.org> STINNER Victor added the comment: I wanted to do that, but I never measured the overhead of PyThreadState_GET() calls. Subtle detail: using _PyThreadState_GET() ("_Py") prefix rather than PyThreadState_GET() ensures that you get the optimized macro ;-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:02:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:02:34 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555318954.72.0.00324053051669.issue31904@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 236d0b75c41449a266201c683b4b0d6acdee02df by Victor Stinner (pxinwr) in branch 'master': bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833) https://github.com/python/cpython/commit/236d0b75c41449a266201c683b4b0d6acdee02df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:06:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:06:27 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555319187.29.0.798163479437.issue31904@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f1464f4d2ecf9b809ff768c523c5eea1abd31c55 by Victor Stinner (pxinwr) in branch 'master': bpo-31904: Port the time module on VxWorks (GH-12305) https://github.com/python/cpython/commit/f1464f4d2ecf9b809ff768c523c5eea1abd31c55 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:25:20 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 15 Apr 2019 09:25:20 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1555320320.0.0.6015060942.issue36540@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 12701 makes breaking changes in the inspect module. Currently we have two sets of APIs in the inspect module: old deprecated API that do not support keyword-only arguments, and new *full* API that supports them. Even many years since 3.0 the old API still has not been removed. Adding support for positional-only arguments needs changes of the same order as adding support of keyword-only arguments. It means deprecating the current API and introducing a new (*fuller*?) API. This is a slow process for many releases. We could also take opportunity to redesign APIs completely instead of just adding new parameters and fields. I suggest to remove all breaking changes in the inspect module and defer them to the separate issue. This perhaps will need a discussion on Python-Dev, and maybe not one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:32:00 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:32:00 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1555320720.27.0.384417759405.issue36540@roundup.psfhosted.org> STINNER Victor added the comment: It seems like deprecating or removing "old" inspect functions is an issue. An option would be to raise an error if these functions is used on a function which has at least one positional argument. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:41:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:41:12 +0000 Subject: [issue36619] when is os.posix_spawn(setsid=True) safe? In-Reply-To: <1555091890.2.0.391429247327.issue36619@roundup.psfhosted.org> Message-ID: <1555321272.9.0.260136060485.issue36619@roundup.psfhosted.org> STINNER Victor added the comment: Maybe we need to expose an object in the os module to list which parameters are supported. setsid is not argument, but scheduler is another argument. There is also a discussion to add another argument to os.posix_spawn() to specify the working directly: it's not possible on all platforms neither. Currently, there are os.supports_* constants like os.supports_dir_fd (set of function names). But I would prefer to have an object just for posix_spawn. Maybe: os.supported_posix_spawn_args = ('file_actions', setpgroup', 'resetids', 'setsid', 'setsigmark', 'setsigdef', 'scheduler') The value would depend depending on the platform. ---------- nosy: +inada.naoki, pablogsal, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:42:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:42:02 +0000 Subject: [issue36619] when is os.posix_spawn(setsid=True) safe? In-Reply-To: <1555091890.2.0.391429247327.issue36619@roundup.psfhosted.org> Message-ID: <1555321322.05.0.795062082584.issue36619@roundup.psfhosted.org> STINNER Victor added the comment: Hum, os.supports_posix_spawn_args name would be more consistent with os.supports_dir_fd name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:49:04 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:49:04 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555321744.87.0.403219950408.issue36624@roundup.psfhosted.org> STINNER Victor added the comment: My previous attempt was: https://github.com/python/cpython/pull/7800 Serhiy Storchaka and Ned Deily were unable about this change: * https://github.com/python/cpython/pull/7800#issuecomment-398688441 * https://github.com/python/cpython/pull/7800#issuecomment-399614918 * https://github.com/python/cpython/pull/7800#issuecomment-400134294 *If* a change is done, I would prefer to do it for Linux, macOS and Windows as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:50:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:50:12 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555321812.32.0.744796279635.issue36624@roundup.psfhosted.org> STINNER Victor added the comment: support.is_android has two flaws: * it's a constant: it must be spelled as UPPER CASE * I dislike "is_" prefix: "MS_WINDOWS" constant is commonly used, and it doesn't start with "is_". In my PR, I used support.ANDROID. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:50:55 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:50:55 +0000 Subject: [issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function In-Reply-To: <1289739891.46.0.690681439003.issue10417@psf.upfronthosting.co.za> Message-ID: <1555321855.23.0.966761960697.issue10417@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner title: unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function -> [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:52:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 09:52:30 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555321950.9.0.625613537009.issue16079@roundup.psfhosted.org> STINNER Victor added the comment: This script should be part of Python and run in the pre-commit CI like Travis CI! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 05:55:52 2019 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Mon, 15 Apr 2019 09:55:52 +0000 Subject: [issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1 In-Reply-To: <1555270378.07.0.766030130411.issue36630@roundup.psfhosted.org> Message-ID: <1555322152.91.0.760294838917.issue36630@roundup.psfhosted.org> Chih-Hsuan Yen added the comment: I asked on bug-ncurses mailing list and Thomas Dickey suggests "improving the python curses binding to handle the newer terminal descriptions". Looks like that requires non-trivial efforts. On the other hand, I've also found a workaround: $ TERM=xterm python -m test -u curses -v test_curses (or anything without -256color suffix for $TERM) How about setting TERM=xterm in tests and documenting that CPython does not support new terminal descriptions for now? [1] http://lists.gnu.org/archive/html/bug-ncurses/2019-04/msg00003.html ---------- nosy: +yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:07:31 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 10:07:31 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555322851.76.0.719068654552.issue36629@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12759 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:17:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 10:17:06 +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: <1555323426.53.0.528261669455.issue27987@roundup.psfhosted.org> STINNER Victor added the comment: PyGC_Head structure size depends on the Python version, sizes of 64-bit: * 2.7: 32 bytes * 3.6, 3.7: 24 bytes * 3.8 (master): 16 bytes bpo-36618 "clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes" should be even worse on 3.7: 24 is not aligned on 16. I don't understand why nobody saw this alignment issue previously. Maybe clang only became stricer about 16 bytes alignment recently? 2.7: typedef union _gc_head { struct { union _gc_head *gc_next; union _gc_head *gc_prev; Py_ssize_t gc_refs; } gc; double dummy; /* Force at least 8-byte alignment. */ char dummy_padding[sizeof(union _gc_head_old)]; } PyGC_Head; 3.7: typedef union _gc_head { struct { union _gc_head *gc_next; union _gc_head *gc_prev; Py_ssize_t gc_refs; } gc; double dummy; /* force worst-case alignment */ } PyGC_Head; 3.8: typedef struct { // Pointer to next object in the list. // 0 means the object is not tracked uintptr_t _gc_next; // Pointer to previous object in the list. // Lowest two bits are used for flags documented later. uintptr_t _gc_prev; } PyGC_Head; In 3.8, the union used to ensure alignment on a C double is gone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:28:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 10:28:13 +0000 Subject: [issue33632] undefined behaviour: signed integer overflow in threadmodule.c In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za> Message-ID: <1555324093.06.0.467647968153.issue33632@roundup.psfhosted.org> STINNER Victor added the comment: In short, a+b can overflow, but a-b cannot? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:35:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 10:35:06 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555324506.87.0.32190677412.issue36629@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3c7931e514faf509a39c218c2c9f55efb434628f by Victor Stinner in branch 'master': bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834) https://github.com/python/cpython/commit/3c7931e514faf509a39c218c2c9f55efb434628f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:35:14 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 15 Apr 2019 10:35:14 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555324514.95.0.510057712907.issue36629@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:39:11 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 10:39:11 +0000 Subject: [issue36631] test_urllib2net: test_ftp_no_timeout() killed after a timeout of 15 min Message-ID: <1555324751.9.0.575658866792.issue36631@roundup.psfhosted.org> New submission from STINNER Victor : It seems like test_urllib2net.test_ftp_no_timeout() has no timeout: it should use a timeout to not block the whole test suite if the FTP server is down. x86 Gentoo Non-Debug with X 3.7: https://buildbot.python.org/all/#/builders/115/builds/1044 0:26:50 load avg: 1.68 [413/416] test_genericpath passed -- running: test_urllib2net (11 min 59 sec) 0:26:52 load avg: 1.68 [414/416] test_tempfile passed -- running: test_urllib2net (12 min 1 sec) 0:26:52 load avg: 1.68 [415/416] test_pipes passed -- running: test_urllib2net (12 min 1 sec) running: test_urllib2net (12 min 31 sec) running: test_urllib2net (13 min 1 sec) running: test_urllib2net (13 min 31 sec) running: test_urllib2net (14 min 1 sec) running: test_urllib2net (14 min 31 sec) 0:29:51 load avg: 1.49 [416/416/1] test_urllib2net crashed (Exit code 1) Timeout (0:15:00)! Thread 0xb7be2700 (most recent call first): File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/socket.py", line 716 in create_connection File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/ftplib.py", line 152 in connect File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 2384 in init File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 2375 in __init__ File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 1555 in connect_ftp File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 1533 in ftp_open File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 503 in _call_chain File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 543 in _open File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 525 in open File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/urllib/request.py", line 222 in urlopen File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/test/test_urllib2net.py", line 19 in _retry_thrice File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/test/test_urllib2net.py", line 27 in wrapped File "/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.nondebug/build/Lib/test/test_urllib2net.py", line 327 in test_ftp_no_timeout ---------- components: Tests messages: 340257 nosy: vstinner priority: normal severity: normal status: open title: test_urllib2net: test_ftp_no_timeout() killed after a timeout of 15 min versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:47:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 10:47:38 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1555325258.59.0.740662142622.issue27860@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:49:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 10:49:42 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555325382.66.0.0497859925904.issue36629@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 28ed39e83e4c545fa1da89fd7691cace280296f7 by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834) (GH-12835) https://github.com/python/cpython/commit/28ed39e83e4c545fa1da89fd7691cace280296f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:50:11 2019 From: report at bugs.python.org (Florian Weimer) Date: Mon, 15 Apr 2019 10:50:11 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555325411.52.0.13891531527.issue36618@roundup.psfhosted.org> Change by Florian Weimer : ---------- nosy: +fweimer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 06:59:18 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 10:59:18 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1555325958.14.0.234306980625.issue27860@roundup.psfhosted.org> Inada Naoki added the comment: I am not owner of ipaddress module, so I don't know we should support more form of masks. On the other hand, IPv4Interface and IPv6Interface expose netmask and hostmask attributes when address is not bytes or int. These attributes are not documented. I assume it was added accidentally, when coping some code from Network classes. But there are test for these attributes. NetmaskTestMixin_v4.test_valid_netmask runs for IPv4Network and IPv4Interface. It checks these attributes when constructor argument is string. https://github.com/python/cpython/blob/3c7931e514faf509a39c218c2c9f55efb434628f/Lib/test/test_ipaddress.py#L422-L440 For safety, I added these attributes always, instead of remove them. PR-12836 is fixing it, and extracts methods for Network/Interface constructor (a part of PR-12774). It doesn't add additional mask form support. ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:01:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 11:01:40 +0000 Subject: [issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x Message-ID: <1555326100.12.0.0433329524894.issue36632@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 FreeBSD 10-STABLE Non-Debug 3.x https://buildbot.python.org/all/#/builders/167/builds/777 0:04:20 load avg: 4.05 [113/420/1] test_multiprocessing_forkserver failed (env changed) (3 min 43 sec) ... test_listener_client (test.test_multiprocessing_forkserver.WithProcessesTestListenerClient) ... ok test_lock (test.test_multiprocessing_forkserver.WithProcessesTestLock) ... ok test_lock_context (test.test_multiprocessing_forkserver.WithProcessesTestLock) ... ok test_rlock (test.test_multiprocessing_forkserver.WithProcessesTestLock) ... ok test_enable_logging (test.test_multiprocessing_forkserver.WithProcessesTestLogging) ... ok test_level (test.test_multiprocessing_forkserver.WithProcessesTestLogging) ... ok test_rapid_restart (test.test_multiprocessing_forkserver.WithProcessesTestManagerRestart) ... ok Warning -- Dangling processes: {} test_access (test.test_multiprocessing_forkserver.WithProcessesTestPicklingConnections) ... ok test_pickling (test.test_multiprocessing_forkserver.WithProcessesTestPicklingConnections) ... ok test_boundaries (test.test_multiprocessing_forkserver.WithProcessesTestPoll) ... ok ... ---------- components: Tests messages: 340260 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:02:44 2019 From: report at bugs.python.org (Florian Weimer) Date: Mon, 15 Apr 2019 11:02:44 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555326164.29.0.148220134775.issue36618@roundup.psfhosted.org> Florian Weimer added the comment: The issue is related to the definition of PyCArgObject: typedef struct tagPyCArgObject PyCArgObject; struct tagPyCArgObject { PyObject_HEAD ffi_type *pffi_type; char tag; union { char c; char b; short h; int i; long l; long long q; long double D; double d; float f; void *p; } value; PyObject *obj; Py_ssize_t size; /* for the 'V' tag */ }; This object must be allocated with suitable alignment (which is 16 on many platforms), and the default Python allocator apparently provides 8-byte alignment only on 64-bit platforms. In short, using PyObject_New with PyCArgObject results in undefined behavior. This issue potentially affects all compilers, not just Clang. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:03:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 11:03:35 +0000 Subject: [issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x In-Reply-To: <1555326100.12.0.0433329524894.issue36632@roundup.psfhosted.org> Message-ID: <1555326215.41.0.479761803346.issue36632@roundup.psfhosted.org> STINNER Victor added the comment: Fixed issues: * bpo-31069: test_multiprocessing_spawn and test_multiprocessing_forkserver leak dangling processes * bpo-31234: Make support.threading_cleanup() stricter ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:05:54 2019 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 15 Apr 2019 11:05:54 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555326354.01.0.439340468843.issue35866@roundup.psfhosted.org> Miro Hron?ok added the comment: Reverting 3b699932e5ac3e76031bbb6d700fbea07492641d makes problem go away. ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:21:32 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 11:21:32 +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: <1555327291.99.0.0950716830437.issue27987@roundup.psfhosted.org> Inada Naoki added the comment: I had not noticed bpo-33374 changed Python 2.7. I don't know why it caused segv only for Python 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:24:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 11:24:14 +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: <1555327454.89.0.689417614113.issue27987@roundup.psfhosted.org> STINNER Victor added the comment: The x86-64 ABI requires that memory allocated on the heap is aligned to 16 bytes. On x86-64, glibc malloc(size) aligns on 16 bytes for size >= 16, otherwise align to 8 bytes. So the glibc doesn't respect exactly the ABI. I understand that a compiler will not use instructions which require 16B align on a memory block smaller than 16B, so align to 8B for size < 16B should be fine *in practice*. Python objects are at least 16B because of PyObject header. Moreover, objects tracked by the GC gets additional 16B header from PyGC_Head. But pymalloc is also used for PyMem_Malloc() since Python 3.6, and PyMem_Malloc() is used to allocate things which are not PyObject. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:40:27 2019 From: report at bugs.python.org (Florian Weimer) Date: Mon, 15 Apr 2019 11:40:27 +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: <1555328427.94.0.975089754418.issue27987@roundup.psfhosted.org> Florian Weimer added the comment: Minor correction: glibc malloc follows ABI on x86-64 and always returns a 16-byte-aligned pointer, independently of allocation size. However, other mallocs (such as jemalloc and tcmalloc) may return pointers with less alignment for allocation sizes less than 16 bytes, violating ABI. They still follow ABI for allocations of 16 bytes and more. But as you said, the distinction should not matter for Python because of the object header. Furthermore, without LTO, the compiler will not be able to detect that a pointer returned from Py_NewObject is a top-level allocation, and therefore has to be more conservative about alignment, using information from the type definitions only. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 07:53:13 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 11:53:13 +0000 Subject: [issue36404] Document PendingDeprecationWarning is not so useful. In-Reply-To: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> Message-ID: <1555329193.24.0.00778635080899.issue36404@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 08:15:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 12:15:14 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555330514.62.0.0593242320273.issue36629@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for your bug report Marat Sharafutdinov, it's now fixed in 3.7 and master (Python 2.7 is not affected, it doesn't have the test_imaplib test method). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 08:18:18 2019 From: report at bugs.python.org (Marat Sharafutdinov) Date: Mon, 15 Apr 2019 12:18:18 +0000 Subject: [issue36629] imaplib test fails with errno 101 In-Reply-To: <1555252441.31.0.294648595666.issue36629@roundup.psfhosted.org> Message-ID: <1555330698.75.0.735713548133.issue36629@roundup.psfhosted.org> Marat Sharafutdinov added the comment: Thank you for the patch, Victor! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 08:37:12 2019 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 15 Apr 2019 12:37:12 +0000 Subject: [issue36625] Obsolete comments in docstrings in fractions module In-Reply-To: <1555196323.81.0.314132124963.issue36625@roundup.psfhosted.org> Message-ID: <1555331832.84.0.211202481248.issue36625@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset a9a28808e5a03d2e68e421227c113a38edc40946 by Mark Dickinson (Jakub Molinski) in branch 'master': bpo-36625: Remove obsolete comments from docstrings in fractions module (GH-12822) https://github.com/python/cpython/commit/a9a28808e5a03d2e68e421227c113a38edc40946 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 08:38:17 2019 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 15 Apr 2019 12:38:17 +0000 Subject: [issue36625] Obsolete comments in docstrings in fractions module In-Reply-To: <1555196323.81.0.314132124963.issue36625@roundup.psfhosted.org> Message-ID: <1555331897.21.0.838499295841.issue36625@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 08:41:38 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 15 Apr 2019 12:41:38 +0000 Subject: [issue36404] Document PendingDeprecationWarning is not so useful. In-Reply-To: <1554454470.93.0.363997208929.issue36404@roundup.psfhosted.org> Message-ID: <1555332098.52.0.283725017154.issue36404@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 09:24:15 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 15 Apr 2019 13:24:15 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555334655.33.0.255126220944.issue36616@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +12764 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 09:29:22 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 15 Apr 2019 13:29:22 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555334962.69.0.967969547895.issue36616@roundup.psfhosted.org> Jeroen Demeyer added the comment: The gain is small, but it's there. I made some further changes: - replacing code of the form sp = stack_pointer; call_function(..., &sp, ...) stack_pointer = sp; by call_function(..., &stack_pointer, ...) - fold the inline function do_call_core() in the main eval loop (the function became so small that there was no longer a reason to pull it out of the main loop) - removed pointless check PyMethod_GET_SELF(func) != NULL (methods always have self != NULL) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 09:51:34 2019 From: report at bugs.python.org (Jens Vagelpohl) Date: Mon, 15 Apr 2019 13:51:34 +0000 Subject: [issue36633] py_compile.compile: AttributeError on importlib.utils Message-ID: <1555336294.55.0.159986341873.issue36633@roundup.psfhosted.org> New submission from Jens Vagelpohl : The following code in py_compile.compile fails (tested on 3.6.6 and 3.7.3) with tracebacks that end like the one shown at the bottom. There's an AttributeError about importlib.utils. """ if cfile is None: if optimize >= 0: optimization = optimize if optimize >= 1 else '' cfile = importlib.util.cache_from_source(file, optimization=optimization) else: cfile = importlib.util.cache_from_source(file) """ Sample tail end of traceback: """ File "/Users/jens/src/.eggs/Chameleon-3.6-py3.7.egg/chameleon/template.py", line 243, in _cook cooked = self.loader.build(source, filename) File "/Users/jens/src/.eggs/Chameleon-3.6-py3.7.egg/chameleon/loader.py", line 177, in build py_compile.compile(name) File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/py_compile.py", line 130, in compile cfile = importlib.util.cache_from_source(file) AttributeError: module 'importlib' has no attribute 'util' """ ---------- components: Library (Lib) messages: 340271 nosy: dataflake priority: normal severity: normal status: open title: py_compile.compile: AttributeError on importlib.utils versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:06:37 2019 From: report at bugs.python.org (Erik Bray) Date: Mon, 15 Apr 2019 14:06:37 +0000 Subject: [issue32451] python -m venv activation issue when using cygwin on windows In-Reply-To: <1514607229.33.0.213398074469.issue32451@psf.upfronthosting.co.za> Message-ID: <1555337197.75.0.243603140567.issue32451@roundup.psfhosted.org> Erik Bray added the comment: Coincidentally I just encountered this myself when trying to activate a venv created by Python for Windows while in a Cygwin shell. Indeed, bash for Cygwin is just like bash anywhere else, and considers it a syntax error to encounter unexpected CR's. Alas, venv creates //Scripts/activate with CRLFs. After running dos2unix on it, this script can be sourced from Cygwin and otherwise works fine. The issue that arises with interactive mode is a known issue not specific to Python or venv. It can also be worked around by running python with winpty. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:14:32 2019 From: report at bugs.python.org (Michael Felt) Date: Mon, 15 Apr 2019 14:14:32 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555321812.32.0.744796279635.issue36624@roundup.psfhosted.org> Message-ID: <9049c4cb-27f0-c916-f272-42a9d43a4b7b@felt.demon.nl> Michael Felt added the comment: On 15/04/2019 11:50, STINNER Victor wrote: > STINNER Victor added the comment: > > support.is_android has two flaws: > > * it's a constant: it must be spelled as UPPER CASE > * I dislike "is_" prefix: "MS_WINDOWS" constant is commonly used, and it doesn't start with "is_". I do not like the is_xxx form either, but I am low in the (name) picking order. I like ALL_CAPS because it is easier to recognize as a constant, I have the habit of using _ (underscore) before a name - but the clear consensus is to not use that for constants coming from support.test. As to being 'backported', even manually - that is something I would work on. I am an old dog - and this seems like a good enough bone for me. So, I'll finish up for AIX - except I would like to underline again something I have come across a few times (but cannot find right now) - and that is to base these constants not on the platform being built on, but the platform being run on (i.e., platform.system()). I expect there may be specific tests that are relevant during the build moment, or perhaps, "later", when using something such as 'pip' to add a module. As, relatively speaking, a new-comer to Python, I see this as a vast improvement to the readability (and clarity) of the code. As to new tests, modifications, etc. it will become part of the PR review to be sure this becomes and stays the standard. Anyway, I'll get started with AIX - not that many - and I hope with all the constant definitions being moved to one place that should simplify maintenance (and perhaps even back-porting). > > In my PR, I used support.ANDROID. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:15:59 2019 From: report at bugs.python.org (Bastian Wenzel) Date: Mon, 15 Apr 2019 14:15:59 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH Message-ID: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> New submission from Bastian Wenzel : After creating a virtual environment on win 7 (64bit) with: py -3.7 -m venv venv Running venv\Scripts\activate.bat will yield this result: \Common was unexpected at this time. (venv) C:\... My PATH variable contains a path that starts with: C:\Program Files (x86)\Common Files\... To me this looks like this issue for virtualenv: https://github.com/pypa/virtualenv/issues/35 https://github.com/pypa/virtualenv/pull/839 Running: (venv) C:\Tools\venv_test>where python C:\Python34\python.exe This is my default python on PATH. Doing this with virtualenv: (virtualenv) C:\Tools\venv_test>where python C:\Tools\venv_test\virtualenv\Scripts\python.exe C:\Python34\python.exe I really hope this is not a duplicate. ---------- components: Library (Lib) messages: 340274 nosy: BWenzel priority: normal severity: normal status: open title: venv: activate.bat fails for venv with parentheses in PATH type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:22:28 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 15 Apr 2019 14:22:28 +0000 Subject: [issue36633] py_compile.compile: AttributeError on importlib.utils In-Reply-To: <1555336294.55.0.159986341873.issue36633@roundup.psfhosted.org> Message-ID: <1555338148.42.0.674130445739.issue36633@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Can you please add a simplified script to reproduce this and possibly without any external dependencies? Looking at the traceback it seems to come from the project chameleon at https://github.com/malthe/chameleon/blob/983877e628a75f42c473cb2ea2350fb0727eb85b9/src/chameleon/loader.py#L177 . The file seems standalone without some helper functions from utils file. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:25:46 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 15 Apr 2019 14:25:46 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555338346.57.0.718832866468.issue36634@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:26:29 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 15 Apr 2019 14:26:29 +0000 Subject: [issue26270] Support for read()/write()/select() on asyncio In-Reply-To: <1454451619.12.0.0280470843365.issue26270@psf.upfronthosting.co.za> Message-ID: <1555338389.29.0.516046324868.issue26270@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +asvetlov versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:27:03 2019 From: report at bugs.python.org (Jens Vagelpohl) Date: Mon, 15 Apr 2019 14:27:03 +0000 Subject: [issue36633] py_compile.compile: AttributeError on importlib.utils In-Reply-To: <1555336294.55.0.159986341873.issue36633@roundup.psfhosted.org> Message-ID: <1555338423.4.0.0698843588714.issue36633@roundup.psfhosted.org> Jens Vagelpohl added the comment: Thank you for the prompt reply. It turns out this is not a bug in py_compile. Other code we use imports importlib.util briefly for a quick check at module level and then deletes it, also at module scope. Removing the deletion fixes the issue. Thanks again and apologies! ---------- resolution: -> third party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:29:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 15 Apr 2019 14:29:56 +0000 Subject: [issue36633] py_compile.compile: AttributeError on importlib.utils In-Reply-To: <1555336294.55.0.159986341873.issue36633@roundup.psfhosted.org> Message-ID: <1555338596.72.0.286122207423.issue36633@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: No problem, closing the issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:30:09 2019 From: report at bugs.python.org (cagney) Date: Mon, 15 Apr 2019 14:30:09 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555338609.12.0.279785396461.issue35866@roundup.psfhosted.org> cagney added the comment: @hroncok see comment msg339370 Vanilla 3.7.0 (re-confirmed) didn't contain the change, nor did 3.6.8 (ok, that isn't vanilla) but both can hang using the test. It can take a while and, subjectively, it seems to depend on machine load. I've even struggled to get 3.7.3 to fail without load. Presumably there's a race and grinding the test machine into the ground increases the odds of it happening. The patch for bpo-6721 could be causing many things, but two to mind: - turning this bug into bpo-36533 (aka bpo-6721 caused a regression) - slowed down the fork (sending time acquiring locks) which increased the odds of this hang My hunch is the latter as the stack dumps look nothing like those I analyzed for bpo-36533 (see messages msg339454 and msg339458). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:37:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 14:37:05 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1555339025.27.0.900721335327.issue35134@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:45:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 14:45:19 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555339519.85.0.722266190685.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: C++ has a __alignof__ function/macro/operator (not sure what is its kind) to get the alignment of a type. C11 has header which provides an alignof() function. GCC has __alignof__(). I also found "_Alignof()" name. ... no sure which one is the most portable ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:47:00 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 14:47:00 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555339620.77.0.070436315612.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: I also found this macro: #define ALIGNOF(type) offsetof (struct { char c; type member; }, member) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:47:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 14:47:56 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555339676.3.0.707296046932.issue36618@roundup.psfhosted.org> STINNER Victor added the comment: More info on alignof(): http://www.wambold.com/Martin/writings/alignof.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:51:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 14:51:20 +0000 Subject: [issue36635] Add _testinternalcapi module Message-ID: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> New submission from STINNER Victor : Python headers are being reorganized to clarify what's public, specific to CPython or "internal". See issues bpo-35134 (Add a new Include/cpython/ subdirectory) and bpo-35081 (Move internal headers to Include/internal/). Problem: the _testcapi module designed to only test the *public* API. Functions tested by _testcapi cannot be made internal. I propose to add a new _testinternalcapi module reserved to test internal APIs. Attached PR implements this idea: it makes _Py_GetConfigsAsDict() private and moves _testcapi.get_configs() to _testinternalcapi.get_configs(). ---------- components: Tests messages: 340282 nosy: vstinner priority: normal severity: normal status: open title: Add _testinternalcapi module versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 10:59:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 14:59:39 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1555340379.95.0.468271805581.issue36635@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12766 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:00:22 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 15:00:22 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1555340422.62.0.898520407166.issue35134@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9820c07e4146e18bddc9ac1586cee7e542903de0 by Victor Stinner in branch 'master': bpo-35134: Add Include/cpython/pymem.h (GH-12840) https://github.com/python/cpython/commit/9820c07e4146e18bddc9ac1586cee7e542903de0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:03:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 15:03:17 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1555340597.72.0.259060525094.issue35134@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:09:11 2019 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 15 Apr 2019 15:09:11 +0000 Subject: [issue33632] undefined behaviour: signed integer overflow in threadmodule.c In-Reply-To: <1527151195.18.0.682650639539.issue33632@psf.upfronthosting.co.za> Message-ID: <1555340951.73.0.894337627693.issue33632@roundup.psfhosted.org> Paul Ganssle added the comment: > In short, a+b can overflow, but a-b cannot? I think it's more that by always checking the elapsed time against `now() - starttime`, you never need to represent the time at which the timeout should happen - which may be so far in the future that it causes a signed overflow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:16:15 2019 From: report at bugs.python.org (Michael Felt) Date: Mon, 15 Apr 2019 15:16:15 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555341375.19.0.712705143658.issue36624@roundup.psfhosted.org> Change by Michael Felt : ---------- keywords: +patch pull_requests: +12768 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:16:16 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 15:16:16 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1555341376.97.0.334143256527.issue36389@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:29:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 15:29:36 +0000 Subject: [issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details In-Reply-To: <1541076409.33.0.788709270274.issue35134@psf.upfronthosting.co.za> Message-ID: <1555342176.46.0.938485010227.issue35134@roundup.psfhosted.org> STINNER Victor added the comment: New changeset aba7d662abbb847f9f45c6db58242a9b4bf65bff by Victor Stinner in branch 'master': bpo-35134: Add cpython/pymem.h to build system (GH-12842) https://github.com/python/cpython/commit/aba7d662abbb847f9f45c6db58242a9b4bf65bff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:41:46 2019 From: report at bugs.python.org (Dan Timofte) Date: Mon, 15 Apr 2019 15:41:46 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555342906.16.0.429199284605.issue36626@roundup.psfhosted.org> Change by Dan Timofte : ---------- keywords: +patch pull_requests: +12770 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:41:57 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 15 Apr 2019 15:41:57 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555342917.33.0.533299201666.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: False positives must be added to the 'ignored_duplicates' file in order to have duplicate_code_names.py exit with success. Not sure whether this may be considered as an annoyance by commiters, if TRAVIS would fail when duplicate_code_names.py fails. All the function or class names duplicates have been removed as false positives from the list in my previous post and this single false positive has been removed from the duplicate method names: Lib/test/test_socket.py:4115 InterruptedTimeoutBase.setAlarm All the duplicates are method names as reported now or five years ago in msg 198586, so this script should get another command line option to only report duplicate method names. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 11:54:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 15:54:13 +0000 Subject: [issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC In-Reply-To: <1553166161.96.0.697085261419.issue36389@roundup.psfhosted.org> Message-ID: <1555343653.69.0.290312819164.issue36389@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0810fa79885276114d1a94e2ce61da367ebb1ffc by Victor Stinner in branch 'master': bpo-36389: Cleanup gc.set_threshold() (GH-12844) https://github.com/python/cpython/commit/0810fa79885276114d1a94e2ce61da367ebb1ffc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:00:02 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 15 Apr 2019 16:00:02 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1555344002.46.0.395184277228.issue30840@roundup.psfhosted.org> Joannah Nanjekye added the comment: I actually opened a PR with the relevant documentation suggested by @ncoghlan but what am wondering is. when @ncoghlan says That part of the PEP was never implemented - relative imports have never been allowed to cross package boundaries in practice, does it mean we dont need this to work anymore as was earlier put in the PEP? In which case this issue will be closed if my PR is merged or we should actually implement it to complete everything the PEP specified? ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:00:07 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 15 Apr 2019 16:00:07 +0000 Subject: [issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace In-Reply-To: <1474461492.99.0.941056742104.issue28238@psf.upfronthosting.co.za> Message-ID: <1555344007.84.0.682781090624.issue28238@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eli.bendersky, scoder, serhiy.storchaka versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:07:07 2019 From: report at bugs.python.org (Eric Snow) Date: Mon, 15 Apr 2019 16:07:07 +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: <1555344427.65.0.692882136244.issue31954@roundup.psfhosted.org> Eric Snow added the comment: Please don't miss the fact that the main reason for mirroring the dict table is to get O(1) node lookup (in the linked list). Otherwise most lookup-dependent operations, like __delitem__(), would become O(n); whereas in the pure-Python implementation they are O(1). This is all explained in the notes at the top of Objects/odictobject.c. Also, I didn't change anything in the dict implementation to rely on the OrderedDict implementation. So while I would say OrderedDict is coupled to dict, I wouldn't say the reverse, that dict is coupled to OrderedDict. If dict changes then OrderedDict must be updated apporpropriately, but not vice-versa. That should still hold. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:09:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:09:20 +0000 Subject: [issue26270] Support for read()/write()/select() on asyncio In-Reply-To: <1454451619.12.0.0280470843365.issue26270@psf.upfronthosting.co.za> Message-ID: <1555344560.03.0.388353406141.issue26270@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:10:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:10:12 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555344612.43.0.88791085697.issue36616@roundup.psfhosted.org> STINNER Victor added the comment: > The gain is small, but it's there. Do you mean a performance speedup? If yes, can you please run a micro-benchmark? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:11:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:11:58 +0000 Subject: [issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x In-Reply-To: <1555326100.12.0.0433329524894.issue36632@roundup.psfhosted.org> Message-ID: <1555344718.6.0.491803253163.issue36632@roundup.psfhosted.org> STINNER Victor added the comment: https://buildbot.python.org/all/#/builders/58/builds/2225 test_listener_client (test.test_multiprocessing_spawn.WithProcessesTestListenerClient) ... ok test_lock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok test_lock_context (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok test_rlock (test.test_multiprocessing_spawn.WithProcessesTestLock) ... ok test_enable_logging (test.test_multiprocessing_spawn.WithProcessesTestLogging) ... ok test_level (test.test_multiprocessing_spawn.WithProcessesTestLogging) ... ok test_rapid_restart (test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ... ok Warning -- Dangling processes: {} test_access (test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok test_pickling (test.test_multiprocessing_spawn.WithProcessesTestPicklingConnections) ... ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:23:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:23:46 +0000 Subject: [issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly In-Reply-To: <1552921033.43.0.82087415933.issue36348@roundup.psfhosted.org> Message-ID: <1555345426.2.0.264323528653.issue36348@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 74125a60b7a477451ff2b8385bfbce3fdaee8dbc by Victor Stinner in branch 'master': bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411) https://github.com/python/cpython/commit/74125a60b7a477451ff2b8385bfbce3fdaee8dbc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:24:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:24:21 +0000 Subject: [issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly In-Reply-To: <1552921033.43.0.82087415933.issue36348@roundup.psfhosted.org> Message-ID: <1555345461.98.0.916505301084.issue36348@roundup.psfhosted.org> STINNER Victor added the comment: I pushed a change to get more information if the test fails again. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:27:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:27:36 +0000 Subject: [issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly In-Reply-To: <1552921033.43.0.82087415933.issue36348@roundup.psfhosted.org> Message-ID: <1555345656.47.0.251703352167.issue36348@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12771 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:27:47 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 15 Apr 2019 16:27:47 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555345667.43.0.0159147966743.issue36634@roundup.psfhosted.org> Steve Dower added the comment: Basically everyone has that directory in their PATH - we'd be hearing a lot more issues if it were a consistent bug. Can you share the full contents of your activate.bat file? And if it's okay, your full PATH variable (before and after running activate.bat) (You may not want to share PATH if there are applications in there that you don't want to be seen publicly - in that case, can you randomize letters rather than deleting them? e.g. "System32"->"Xborpm99" That way we won't lose potentially important information to this bug like punctuation.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:36:06 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 15 Apr 2019 16:36:06 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555346166.68.0.39666125436.issue16079@roundup.psfhosted.org> Gregory P. Smith added the comment: Agreed, making duplicate method definitions a CI failure is the desired end state once our test suite is cleaned up and it doesn't have false positives. FYI - pylint also implements this check quite reliably as function-redefined via its pylint.checkers.base.BasicErrorChecker._check_redefinition() method. https://github.com/PyCQA/pylint/blob/2.2/pylint/checkers/base.py#L843 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 12:45:07 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 15 Apr 2019 16:45:07 +0000 Subject: [issue36348] test_imaplib.RemoteIMAP_STARTTLSTest.test_logout() fails randomly In-Reply-To: <1552921033.43.0.82087415933.issue36348@roundup.psfhosted.org> Message-ID: <1555346707.47.0.713007842186.issue36348@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2815bf5b1f39b9f677135473392887a8d261fc97 by Victor Stinner in branch '3.7': bpo-36348: test_imaplib: add debug info (GH-12846) https://github.com/python/cpython/commit/2815bf5b1f39b9f677135473392887a8d261fc97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 13:52:43 2019 From: report at bugs.python.org (Drew Budwin) Date: Mon, 15 Apr 2019 17:52:43 +0000 Subject: [issue36636] Inner exception is not being raised using asyncio.gather Message-ID: <1555350763.65.0.175708085.issue36636@roundup.psfhosted.org> New submission from Drew Budwin : Using Python 3.7, I am trying to catch an exception and re-raise it by following an example I found on StackOverflow (https://stackoverflow.com/a/6246394/1595510). While the example does work, it doesn't seem to work for all situations. Below I have two asynchronous Python scripts that try to re-raise exceptions. The first example works, it will print both the inner and outer exception. import asyncio class Foo: async def throw_exception(self): raise Exception("This is the inner exception") async def do_the_thing(self): try: await self.throw_exception() except Exception as e: raise Exception("This is the outer exception") from e async def run(): await Foo().do_the_thing() def main(): loop = asyncio.get_event_loop() loop.run_until_complete(run()) if __name__ == "__main__": main() Running this will correctly output the following exception stack trace: $ py test.py Traceback (most recent call last): File "test.py", line 9, in do_the_thing await self.throw_exception() File "test.py", line 5, in throw_exception raise Exception("This is the inner exception") Exception: This is the inner exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "test.py", line 21, in main() File "test.py", line 18, in main loop.run_until_complete(run()) File "C:\Python37\lib\asyncio\base_events.py", line 584, in run_until_complete return future.result() File "test.py", line 14, in run await Foo().do_the_thing() File "test.py", line 11, in do_the_thing raise Exception("This is the outer exception") from e Exception: This is the outer exception However, in my next Python script, I have multiple tasks that I queue up that I want to get a similar exception stack trace from. Essentially, I except the above stack trace to be printed 3 times (once for each task in the following script). The only difference between the above and below scripts is the run() function. import asyncio class Foo: async def throw_exception(self): raise Exception("This is the inner exception") async def do_the_thing(self): try: await self.throw_exception() except Exception as e: raise Exception("This is the outer exception") from e async def run(): tasks = [] foo = Foo() tasks.append(asyncio.create_task(foo.do_the_thing())) tasks.append(asyncio.create_task(foo.do_the_thing())) tasks.append(asyncio.create_task(foo.do_the_thing())) results = await asyncio.gather(*tasks, return_exceptions=True) for result in results: if isinstance(result, Exception): print(f"Unexpected exception: {result}") def main(): loop = asyncio.get_event_loop() loop.run_until_complete(run()) if __name__ == "__main__": main() The above code snippet produces the disappointingly short exceptions lacking stack traces. $ py test.py Unexpected exception: This is the outer exception Unexpected exception: This is the outer exception Unexpected exception: This is the outer exception If I change return_exceptions to be False, I will get the exceptions and stack trace printed out once and then execution stops and the remaining two tasks are cancelled. The output is identical to the output from the first script. The downside of this approach is, I want to continue processing tasks even when exceptions are encountered and then display all the exceptions at the end when all the tasks are completed. ---------- components: asyncio messages: 340297 nosy: Drew Budwin, asvetlov, yselivanov priority: normal severity: normal status: open title: Inner exception is not being raised using asyncio.gather type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 14:27:31 2019 From: report at bugs.python.org (danijar) Date: Mon, 15 Apr 2019 18:27:31 +0000 Subject: [issue36637] Restrict syntax for tuple literals with one element Message-ID: <1555352851.43.0.0863954988621.issue36637@roundup.psfhosted.org> New submission from danijar : A tuple can be created with or without parentheses: a = (1, 2, 3) a = 1, 2, 3 While both are intuitive in this example, omitting the parentheses can lead to hard to find errors when there is only one element: a = (1,) a = 1, The first is clear but the second can easily occur as a typo when the programmer actually just wanted to assign an integer (comma is next to enter on many keyboards). I think ideally, omitting parentheses in the single element case would throw a SyntaxError. On the other hand, I assume that it could be difficult to separate the behavior or tuple creating with an without parentheses, since the parentheses are probably not actually part of the tuple literal. ---------- components: Interpreter Core messages: 340298 nosy: benjamin.peterson, brett.cannon, danijar, xtreak, yselivanov priority: normal severity: normal status: open title: Restrict syntax for tuple literals with one element _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 14:27:39 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 15 Apr 2019 18:27:39 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1555352859.36.0.042118248595.issue30840@roundup.psfhosted.org> Brett Cannon added the comment: RE: "does it mean we dont need this to work anymore as was earlier put in the PEP?" Correct, we aren't going to implement that part of the PEP ever. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 14:29:48 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 15 Apr 2019 18:29:48 +0000 Subject: [issue36637] Restrict syntax for tuple literals with one element In-Reply-To: <1555352851.43.0.0863954988621.issue36637@roundup.psfhosted.org> Message-ID: <1555352988.91.0.6679092839.issue36637@roundup.psfhosted.org> Brett Cannon added the comment: Thanks for the idea, but this would break way too much code to warrant changing it. Plus making this act differently just in the single-item case is too much special-casing/surprise. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 14:51:42 2019 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 15 Apr 2019 18:51:42 +0000 Subject: [issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace In-Reply-To: <1474461492.99.0.941056742104.issue28238@psf.upfronthosting.co.za> Message-ID: <1555354302.43.0.512122129958.issue28238@roundup.psfhosted.org> Stefan Behnel added the comment: lxml has a couple of nice features here: - all tags in a namespace: "{namespace}*" - a local name 'tag' in any (or no) namespace: "{*}tag" - a tag without namespace: "{}tag" - all tags without namespace: "{}*" "{*}*" is also accepted but is the same as "*". Note that "*" is actually allowed as an XML tag name by the spec, but rare enough to hijack it for this purpose. I've actually never seen it used anywhere in the wild. lxml's implementation isn't applicable to ElementTree (searching has been subject to excessive optimisation), but it shouldn't be hard to extend the one in ET's ElementPath.py module, as well as Element.iter() in ElementTree.py, to support this kind of tag comparison. PR welcome. lxml's tests are here (and in the following test methods): https://github.com/lxml/lxml/blob/359f693b972c2e6b0d83d26a329d2d20b7581c48/src/lxml/tests/test_etree.py#L2911 Note that they actually test the deprecated .getiterator() method for historical reasons. They should probably call .iter() instead these days. lxml's ElementPath implementation is under src/lxml/_elementpath.py, but the tag comparison itself is done elsewhere in Cython code (here, in case it matters:) https://github.com/lxml/lxml/blob/359f693b972c2e6b0d83d26a329d2d20b7581c48/src/lxml/apihelpers.pxi#L921-L1048 ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 15:02:23 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 15 Apr 2019 19:02:23 +0000 Subject: [issue30202] Update test.test_importlib.test_abc to test find_spec() In-Reply-To: <1493416572.94.0.214494308366.issue30202@psf.upfronthosting.co.za> Message-ID: <1555354943.11.0.303293567676.issue30202@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12772 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 15:08:38 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 15 Apr 2019 19:08:38 +0000 Subject: [issue30202] Update test.test_importlib.test_abc to test find_spec() In-Reply-To: <1493416572.94.0.214494308366.issue30202@psf.upfronthosting.co.za> Message-ID: <1555355318.35.0.210445182685.issue30202@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 15:12:50 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 15 Apr 2019 19:12:50 +0000 Subject: [issue30202] Update test.test_importlib.test_abc to test find_spec() In-Reply-To: <1493416572.94.0.214494308366.issue30202@psf.upfronthosting.co.za> Message-ID: <1555355570.43.0.871488978644.issue30202@roundup.psfhosted.org> Joannah Nanjekye added the comment: Since it was almost 2 years since the last conversation, i opened a PR for this. @brett.cannon I may have not looked at all possible areas to use find_spec(), so please let me know in the reviews for this PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 15:14:12 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 15 Apr 2019 19:14:12 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1555355652.12.0.312517216312.issue30840@roundup.psfhosted.org> Joannah Nanjekye added the comment: Great, thanks for clarity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 15:23:46 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 15 Apr 2019 19:23:46 +0000 Subject: [issue24638] asyncio "loop argument must agree with future" error message could be improved In-Reply-To: <1436967590.12.0.584324642332.issue24638@psf.upfronthosting.co.za> Message-ID: <1555356226.94.0.986308568779.issue24638@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12773 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 15:25:24 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 15 Apr 2019 19:25:24 +0000 Subject: [issue24638] asyncio "loop argument must agree with future" error message could be improved In-Reply-To: <1436967590.12.0.584324642332.issue24638@psf.upfronthosting.co.za> Message-ID: <1555356324.69.0.591973047582.issue24638@roundup.psfhosted.org> Zackery Spytz added the comment: I've created a PR for this issue. ---------- components: +asyncio nosy: +ZackerySpytz, asvetlov, yselivanov versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 16:18:17 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 15 Apr 2019 20:18:17 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1555359497.23.0.186633129715.issue35329@roundup.psfhosted.org> Cheryl Sabella added the comment: Hi Hans, Would you be interested in making a pull request with this change? Thanks! ---------- nosy: +cheryl.sabella stage: -> needs patch type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 19:11:52 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 23:11:52 +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: <1555369912.71.0.0405615227926.issue31954@roundup.psfhosted.org> Inada Naoki added the comment: @Serhiy > It the pure Python implementation PyDict_GetItem also > returns value, not node of linked list. I missed pure Python implementation used two dicts. @Eric > Please don't miss the fact that the main reason for mirroring the dict table is to get O(1) node lookup (in the linked list). I don't miss it, of course. I'm proposing make linked list node as Python Object, and store it directly into dict, like LRU implementation in _functools. In this idea, if dict.__getitem__ is called directly, a node of linked list is returned instead of value in the node. I must admit this idea is too aggressive. If we can redesign OrderedDict from scratch, I propose OrderedDict uses dict, without inheriting it. But it is too late. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 19:32:37 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 23:32:37 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1555371157.27.0.812531701107.issue27860@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 6fa84bd12c4b83bee6a41b989363230d5c03b96c by Inada Naoki in branch 'master': bpo-27860: ipaddress: fix Interface missed some attributes (GH-12836) https://github.com/python/cpython/commit/6fa84bd12c4b83bee6a41b989363230d5c03b96c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 19:37:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 15 Apr 2019 23:37:38 +0000 Subject: [issue27860] Improvements to ipaddress module In-Reply-To: <1472138068.64.0.756560879111.issue27860@psf.upfronthosting.co.za> Message-ID: <1555371458.72.0.411862623076.issue27860@roundup.psfhosted.org> Inada Naoki added the comment: I merged all cleanups. I don't merge accepting any IP representations as mask, because I'm not expert of this module. At least, I don't want to pass prefix/netmask by something like IPv4Network("0.0.255.255"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 21:08:35 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 16 Apr 2019 01:08:35 +0000 Subject: [issue36638] typeperf.exe is not in all skus of Windows Message-ID: <1555376915.06.0.702327922476.issue36638@roundup.psfhosted.org> New submission from Paul Monson : typeperf.exe is not present on small editions of windows like Windows IoT Core or nanoserver This causes WindowsLoadTracker to throw an exception during test initialization. ---------- components: Tests messages: 340309 nosy: Paul Monson priority: normal severity: normal status: open title: typeperf.exe is not in all skus of Windows type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 21:16:19 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 16 Apr 2019 01:16:19 +0000 Subject: [issue36638] typeperf.exe is not in all skus of Windows In-Reply-To: <1555376915.06.0.702327922476.issue36638@roundup.psfhosted.org> Message-ID: <1555377379.11.0.0808903889733.issue36638@roundup.psfhosted.org> Change by Paul Monson : ---------- keywords: +patch pull_requests: +12774 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 21:23:32 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 16 Apr 2019 01:23:32 +0000 Subject: [issue36638] typeperf.exe is not in all skus of Windows SKUs In-Reply-To: <1555376915.06.0.702327922476.issue36638@roundup.psfhosted.org> Message-ID: <1555377812.23.0.800217499099.issue36638@roundup.psfhosted.org> Change by Paul Monson : ---------- title: typeperf.exe is not in all skus of Windows -> typeperf.exe is not in all skus of Windows SKUs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 21:31:07 2019 From: report at bugs.python.org (Nic Watson) Date: Tue, 16 Apr 2019 01:31:07 +0000 Subject: [issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing In-Reply-To: <1490694354.71.0.0417616939951.issue29930@psf.upfronthosting.co.za> Message-ID: <1555378267.24.0.513773811728.issue29930@roundup.psfhosted.org> Change by Nic Watson : ---------- nosy: +jnwatson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 21:54:37 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 01:54:37 +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: <1555379677.91.0.473318759809.issue27987@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12775 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 23:33:13 2019 From: report at bugs.python.org (Peixing Xin) Date: Tue, 16 Apr 2019 03:33:13 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555385593.98.0.813828094682.issue31904@roundup.psfhosted.org> Change by Peixing Xin : ---------- nosy: +pxinwr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 15 23:37:50 2019 From: report at bugs.python.org (Peixing Xin) Date: Tue, 16 Apr 2019 03:37:50 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555385870.01.0.651733115138.issue31904@roundup.psfhosted.org> Peixing Xin added the comment: @vstinner I've informed WRS team of temporarily not creating new PRs in until less than 4 PRs are in the open state. Next we will keep open PRs less than 4. Thanks for your effort on them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 01:53:36 2019 From: report at bugs.python.org (twisteroid ambassador) Date: Tue, 16 Apr 2019 05:53:36 +0000 Subject: [issue36636] Inner exception is not being raised using asyncio.gather In-Reply-To: <1555350763.65.0.175708085.issue36636@roundup.psfhosted.org> Message-ID: <1555394016.95.0.370630220693.issue36636@roundup.psfhosted.org> twisteroid ambassador added the comment: The difference is because you grabbed and print()ed the exception themselves in Script 2, while in Script 1 you let Python's built-in unhandled exception handler (sys.excepthook) print the traceback for you. If you want a traceback, then you need to print it yourself. Try something along the lines of this: traceback.print_tb(result.__traceback__) or: traceback.print_exception(type(result), result, result.__traceback__) or if you use the logging module: logging.error('Unexpected exception', exc_info=result) reference: https://stackoverflow.com/questions/11414894/extract-traceback-info-from-an-exception-object ---------- nosy: +twisteroid ambassador _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 02:46:24 2019 From: report at bugs.python.org (=?utf-8?b?5p6X6Ieq5Z2H?=) Date: Tue, 16 Apr 2019 06:46:24 +0000 Subject: [issue36639] Provide list.rindex() Message-ID: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> New submission from ??? : There are str.index() and str.rindex(), but there is only list.index() and no list.rindex(). It will be very handy if we provide it. ---------- components: Library (Lib) messages: 340312 nosy: johnlinp priority: normal severity: normal status: open title: Provide list.rindex() type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 02:55:57 2019 From: report at bugs.python.org (=?utf-8?b?5p6X6Ieq5Z2H?=) Date: Tue, 16 Apr 2019 06:55:57 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1555397757.29.0.188278467668.issue36639@roundup.psfhosted.org> Change by ??? : ---------- keywords: +patch pull_requests: +12776 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 02:57:04 2019 From: report at bugs.python.org (Bastian Wenzel) Date: Tue, 16 Apr 2019 06:57:04 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555397824.42.0.224141013708.issue36634@roundup.psfhosted.org> Bastian Wenzel added the comment: I have attached the activate.bat script that got generated by venv. My current path looks like this (added line breaks for readability): C:\Program Files\Git\bin; C:\Tools\antlr; C:\Program Files (x86)\Common Files\Oracle\Java\javapath; C:\ProgramData\Oracle\Java\javapath; C:\windows\system32; C:\windows; C:\windows\System32\Wbem; C:\windows\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\CheckPoint\Endpoint Security\Endpoint Common\bin; C:\Program Files\IBM\Informix\Client-SDK; C:\Program Files\IBM\Informix\Client-SDK\bin\netf20; C:\Python34\; C:\Python34\Scripts; C:\Dwimperl\perl\bin; C:\Dwimperl\perl\site\bin; C:\Dwimperl\c\bin; C:\Program Files\TortoiseSVN\bin; C:\Program Files\Git LFS; C:\Users\a0000000\Downloads\chromedriver_win32; C:\Program Files (x86)\PuTTY\; C:\Program Files\doxygen\bin; C:\Strawberry\c\bin; C:\Strawberry\perl\site\bin; C:\Strawberry\perl\bin; C:\Projects\tex\MiKTeX 2.9\miktex\bin\x64\; C:\Program Files\MATLAB\R2017b\runtime\win64; C:\Program Files\MATLAB\R2017b\bin; C:\Program Files (x86)\Koenmdpk\AG-WC\Version Selector Plus\; %AGWCROOT%\bin; %SSLROOT%; %IBISUROOT%; C:\Program Files (x86)\Sennheiser\SoftphoneSDK\; C:\Program Files\dotnet\; C:\Program Files\Microsoft SQL Server\130\Tools\Binn\; C:\HashiCorp\Vagrant\bin; %systemroot%\System32\WindowsPowerShell\v1.0\; C:\Program Files\Git\usr\bin; %systemroot%\System32\WindowsPowerShell\v1.0\; %systemroot%\System32\WindowsPowerShell\v1.0\; C:\Program Files\TortoiseGit\bin %IBISUROOT%=C:\Program Files (x86)\Koenmdpk\ibisu\ %SSLROOT%=C:\Program Files (x86)\Koenmdpk\SSL\ %AGWCROOT%=C:\Program Files (x86)\Koenmdpk\AG-WC\3.60.30 %systemroot%=C:\windows ---------- Added file: https://bugs.python.org/file48267/activate.bat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 03:03:46 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 16 Apr 2019 07:03:46 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1555398226.86.0.153036705069.issue36639@roundup.psfhosted.org> SilentGhost added the comment: That's a fairly bare-bones implementation you're providing in your PR. Such a feature would need documentation, tests, news entry. I'm not endorsing or discarding your idea, but these are the general requirements for the feature of this level. ---------- components: +Interpreter Core -Library (Lib) nosy: +SilentGhost, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 03:05:10 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 16 Apr 2019 07:05:10 +0000 Subject: [issue36638] typeperf.exe is not in all skus of Windows SKUs In-Reply-To: <1555376915.06.0.702327922476.issue36638@roundup.psfhosted.org> Message-ID: <1555398310.93.0.778519324671.issue36638@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 03:10:41 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 16 Apr 2019 07:10:41 +0000 Subject: [issue36572] python-snappy install issue during Crossbar install with Python 3.7.3 (Windows x86 executable installer) In-Reply-To: <1554803251.97.0.1929107908.issue36572@roundup.psfhosted.org> Message-ID: <1555398641.95.0.321350279051.issue36572@roundup.psfhosted.org> SilentGhost added the comment: This doesn't seem like a Python issue at all. I would suggest to turn to the crossbario project in the first place, and report it to them if the fix for their 1521 bug does not fix it for you. ---------- nosy: +SilentGhost resolution: -> third party stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 03:14:27 2019 From: report at bugs.python.org (Bastian Wenzel) Date: Tue, 16 Apr 2019 07:14:27 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555398867.81.0.13541124623.issue36634@roundup.psfhosted.org> Bastian Wenzel added the comment: So if I replace this section from venv's activate.bat: if defined _OLD_VIRTUAL_PATH ( set "PATH=%_OLD_VIRTUAL_PATH%" ) else ( set "_OLD_VIRTUAL_PATH=%PATH%" ) with the part from virtualenv's activate.bat: REM if defined _OLD_VIRTUAL_PATH ( if not defined _OLD_VIRTUAL_PATH goto ENDIFVPATH1 set "PATH=%_OLD_VIRTUAL_PATH%" :ENDIFVPATH1 REM ) else ( if defined _OLD_VIRTUAL_PATH goto ENDIFVPATH2 set "_OLD_VIRTUAL_PATH=%PATH%" :ENDIFVPATH2 then venv\Scrtips\activate.bat seems to behave as expected. ---------- keywords: +patch Added file: https://bugs.python.org/file48268/Report.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 03:19:19 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 16 Apr 2019 07:19:19 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1555399159.83.0.0578805818439.issue36639@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New methods to builtins generally require a python-ideas discussion. Search brings up an old discussion for rindex and rremove : https://mail.python.org/pipermail/python-ideas/2009-May/004506.html . It also would make users ask for tuple.rindex as in the linked discussion. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 03:34:20 2019 From: report at bugs.python.org (Andrey Paramonov) Date: Tue, 16 Apr 2019 07:34:20 +0000 Subject: [issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed In-Reply-To: <1498525522.6.0.617023291854.issue30782@psf.upfronthosting.co.za> Message-ID: <1555400060.82.0.487105108133.issue30782@roundup.psfhosted.org> Andrey Paramonov added the comment: Hello! Below is updated implementation containing more consistent error handling. The main rough edges encountered: 1. asyncio.Queue alone proved insufficient for precise control of limit, as asyncio.create_task() schedules created Task() immediately and it may start executing before being added to queue (thus leading to limit+1 tasks running). Additional semaphore is used to tackle that. 2. When exception, other running tasks have to be cancel()ed and then await'ed to ensure all tasks are successfully finished by the time igather exits. Just cancel()ing proved not sufficient. 3. When exception, unscheduled coroutines have to be wrapped with asyncio.create_task(coro).cancel() to avoid RuntimeWarning "coroutine was never awaited". But maybe there is a more elegant way to suppress this warning for a coroutine? In my client code I didn't so far encounter "an implicit requirement that back pressure from the consumer should be handled", but it should be possible to implement separately and quite straightforwardly, with the help of asyncio.Queue. async def igather(coros, limit=None): coros = iter(coros) buf = asyncio.Queue() sem = asyncio.Semaphore(limit or math.inf) async def submit(coros, buf): while True: await sem.acquire() try: # TODO: additionally support async iterators coro = next(coros) except StopIteration: break task = asyncio.create_task(coro) buf.put_nowait(task) await buf.put(None) async def consume(buf): while True: task = await buf.get() if task: v = await asyncio.wait_for(task, None) sem.release() yield v else: break submit_task = asyncio.create_task(submit(coros, buf)) try: async for result in consume(buf): yield result except: submit_task.cancel() # cancel scheduled while not buf.empty(): task = buf.get_nowait() if task: task.cancel() try: await task except: pass # cancel pending for coro in coros: asyncio.create_task(coro).cancel() raise Shall I go ahead and prepare a PR with docs and tests? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 04:06:11 2019 From: report at bugs.python.org (=?utf-8?b?5p6X6Ieq5Z2H?=) Date: Tue, 16 Apr 2019 08:06:11 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1555401971.09.0.328596649968.issue36639@roundup.psfhosted.org> ??? added the comment: Hi @SilentGhost, Thank you for the feedback. The PR is only a WIP and a placeholder. Hi @xtreak, Thank you for searching that mailing list for me. However, after reading the thread, it seems that we didn't have any conclusion on whether we should add list.rindex() or not. Did I miss something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 04:15:58 2019 From: report at bugs.python.org (Bastian Wenzel) Date: Tue, 16 Apr 2019 08:15:58 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555402558.16.0.966891593951.issue36634@roundup.psfhosted.org> Bastian Wenzel added the comment: Ok I think I found my problem. The system path of of my machine is ok but my user path contains a stray double quotation mark (") like this: C:\Program Files\Git\bin";C:\Tools\antlr;C:\Program Files (x86)\Common Files\Oracle\Java\javapath ... With this I am closing the double quotation of the .bat file too early and this leads to an early closing ). If I remove it venv\Script\activate.bat behaves as expected. Sorry for taking up your time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 04:49:07 2019 From: report at bugs.python.org (Eryk Sun) Date: Tue, 16 Apr 2019 08:49:07 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555404547.05.0.833964380932.issue36634@roundup.psfhosted.org> Eryk Sun added the comment: > my user path contains a stray double quotation mark (") Steve, do you think we should work around this by first removing double quote characters from PATH? This will fix the user's PATH, making one or more directories searchable again, but it could have side effects. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 05:19:35 2019 From: report at bugs.python.org (serge-sans-paille) Date: Tue, 16 Apr 2019 09:19:35 +0000 Subject: [issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes In-Reply-To: <1555090582.18.0.289146441616.issue36618@roundup.psfhosted.org> Message-ID: <1555406375.23.0.129425096055.issue36618@roundup.psfhosted.org> serge-sans-paille added the comment: @vstinner: once you have a portable version of alignof, you can deciding to *not* use the pool allocator if the required alignment is greater than 8B, or you could modify the pool allocator to take alignment information as an extra parameter? ---------- nosy: +serge-sans-paille _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 05:20:54 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Tue, 16 Apr 2019 09:20:54 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555406454.09.0.347052083356.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: Thanks for the link Gregory. I will write a script based on ast and check its output against pylint and against the current script based on tokenize. The travis() function of Tools/scripts/patchcheck.py may be modified to import this script and run it only on files modified by the PR. This may allow the pre-commit duplicate check to be installed without waiting for the python test suite to be cleaned if the existing duplicates are temporarily added to the ignored_duplicates file (assuming an issue has been entered for each one of those existing duplicates with a note saying to remove the entry in ignored_duplicates when the issue is fixed). Indeed, issues #19113 and #19119 are still open after they have been entered 5 years ago. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 05:22:51 2019 From: report at bugs.python.org (Saba Kauser) Date: Tue, 16 Apr 2019 09:22:51 +0000 Subject: [issue36640] python ibm_db setup.py post install script does not seem to work from Anaconda Message-ID: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> New submission from Saba Kauser : Hi, I have added a post install class that's working fine when I do "pip install ibm_db" on MAC. However, when I use the python/pip from anaconda3(python 3.7), the same pip is not executing the post install script. Can some one please take a look at assist. The class can be seen at: https://github.com/ibmdb/python-ibmdb/blob/master/IBM_DB/ibm_db/setup.py#L52 Post install, I am expecting following output: BLR-D-MACOS03:site-packages skauser$ otool -L ibm_db.cpython-37m-darwin.so ibm_db.cpython-37m-darwin.so: @loader_path/clidriver/lib/libdb2.dylib (compatibility version 0.0.0, current version 0.0.0) When executing from Anaconda, the name of libdb2.dylib is unchanged. I would also like to know how can I verbose the print/log statements of my setup.py via pip install. ---------- components: Build messages: 340324 nosy: sabakauser priority: normal severity: normal status: open title: python ibm_db setup.py post install script does not seem to work from Anaconda type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 05:41:31 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 16 Apr 2019 09:41:31 +0000 Subject: [issue36640] python ibm_db setup.py post install script does not seem to work from Anaconda In-Reply-To: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> Message-ID: <1555407691.77.0.220323697542.issue36640@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Anacond and ibm_db are not part of CPython distribution. Can you please add a script and explain over how it's a bug with CPython? There are also previous reports when searching for "ibm_db" and I am not sure if these are bugs with CPython too. https://bugs.python.org/issue?%40columns=id%2Cactivity%2Ctitle%2Ccreator%2Cassignee%2Cstatus%2Ctype&%40sort=-activity&%40filter=status&%40action=searchid&ignore=file%3Acontent&%40search_text=ibm_db&submit=search&status=-1%2C1%2C2%2C3 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 05:56:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 09:56:39 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555408599.71.0.454367225493.issue32849@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 05:56:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 09:56:57 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555408617.37.0.939198878646.issue32849@roundup.psfhosted.org> STINNER Victor added the comment: > ktrace shows that dup(0) succeeded but fstat(0) failed. Aha, the problem is still the is_valid_fd() function: /* Prefer dup() over fstat(). fstat() can require input/output whereas dup() doesn't, there is a low risk of EMFILE/ENFILE at Python startup. */ The function has been fixed on macOS with: #ifdef __APPLE__ /* bpo-30225: On macOS Tiger, when stdout is redirected to a pipe and the other side of the pipe is closed, dup(1) succeed, whereas fstat(1, &st) fails with EBADF. Prefer fstat() over dup() to detect such error. */ struct stat st; return (fstat(fd, &st) == 0); #else I see two options: * Only use dup() on platforms when we know that dup() is enough to detect corner cases: Linux and Windows * Force usage of fstat() on FreeBSD... But what about OpenBSD, NetBSD and other BSD variants? I wrote attached PR 12852 to only use dup() on Linux and Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 06:01:59 2019 From: report at bugs.python.org (Saba Kauser) Date: Tue, 16 Apr 2019 10:01:59 +0000 Subject: [issue36640] python ibm_db setup.py post install script does not seem to work from Anaconda In-Reply-To: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> Message-ID: <1555408918.99.0.887990377305.issue36640@roundup.psfhosted.org> Saba Kauser added the comment: Thanks Karthikeyan. The behavior is specific to anaconda when I use the python/pip that comes with it. When I use the pip from anaconda, e.g:/Users/skauser/anaconda3/bin/pip pip install ibm_db Installation is success,but when I import ibm_db, I get this error import ibm_db >>> import ibm_db Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Users/skauser/anaconda3/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so, 2): Library not loaded: libdb2.dylib Referenced from: /Users/skauser/anaconda3/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so Reason: image not found Reason being, the post install script of my setup.py is not executed and hence following command did not run post install . for so in glob.glob(get_python_lib()+r'/ibm_db*.so'): os.system("install_name_tool -change libdb2.dylib {}/lib/libdb2.dylib {}".format(clipath, so)) Can be seen at https://github.com/ibmdb/python-ibmdb/blob/master/IBM_DB/ibm_db/setup.py#L58 However, when I use the standalone python installation that is outside of anaconda distribution, pip install correctly runs the post install script ibm_db's setup.py. /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ibm_db >> The error Reason: image not found is specific to MAC due to its security setting and I have added a workaround that is expected to work with pip install. However, it does not seem to work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 06:02:42 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 16 Apr 2019 10:02:42 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555408962.46.0.443382169159.issue36624@roundup.psfhosted.org> Michael Felt added the comment: OK. I have been chewing my bone. I hope not too much indigestion. Who has a pointer for the antacid? Getting base branch for PR ... origin/master Getting the list of files that have been added/changed ... 72 files Fixing Python file whitespace ... Traceback (most recent call last): File "../git/python3-3.8/Tools/scripts/patchcheck.py", line 285, in main() File "../git/python3-3.8/Tools/scripts/patchcheck.py", line 253, in main normalize_whitespace(python_files) File "../git/python3-3.8/Tools/scripts/patchcheck.py", line 35, in call_fxn result = fxn(*args, **kwargs) File "../git/python3-3.8/Tools/scripts/patchcheck.py", line 149, in normalize_whitespace fixed = [path for path in file_paths if path.endswith('.py') and File "../git/python3-3.8/Tools/scripts/patchcheck.py", line 150, in reindent.check(os.path.join(SRCDIR, path))] File "/data/prj/python/git/python3-3.8/Tools/scripts/reindent.py", line 138, in check if r.run(): File "/data/prj/python/git/python3-3.8/Tools/scripts/reindent.py", line 203, in run for _token in tokens: File "/data/prj/python/git/python3-3.8/Lib/tokenize.py", line 521, in _tokenize raise TokenError("EOF in multi-line statement", (lnum, 0)) tokenize.TokenError: ('EOF in multi-line statement', (694, 0)) make: 1254-004 The error code from the last command is 1. In other words - I have not changed the file 'complaining', but have changed many files. Likely, a new issue - however, I would like to move forward with this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 06:12:31 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 10:12:31 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555409551.07.0.36248458398.issue32849@roundup.psfhosted.org> STINNER Victor added the comment: Alexey Izbyshev: "I think that we can even drop dup-based validation from is_valid_fd() since there is a corner case for Linux too: if a descriptor opened with O_PATH inherited as a standard one, dup() will succeed but fstat() will fail in kernels before 3.6. And we do fstat() almost immediately after is_valid_fd() to get blksize, so the dup-based optimization doesn't seem worth the trouble. Victor, do you have an opinion on that?" I don't understand this case. I don't know O_PATH nor how to inherit such special file descriptor. Would you mind to elaborate? man open: O_PATH (since Linux 2.6.39) Obtain a file descriptor that can be used for two purposes: to indicate a location in the filesystem tree and to perform opera? tions that act purely at the file descriptor level. The file itself is not opened, and other file operations (e.g., read(2), write(2), fchmod(2), fchown(2), fgetxattr(2), ioctl(2), mmap(2)) fail with the error EBADF. In following C program, fd 0 is a file descriptor opened by O_PATH: dup(0) and fstat(0) both succeed, which is not surprising, it's a valid file descriptor. --- #include #include #include #include #include #define O_PATH 010000000 int main(void) { int path_fd; path_fd = open(".", O_PATH); if (dup2(path_fd, 0)) { perror("dup2"); } int fd = dup(0); if (fd < 0) perror("dup"); else { fprintf(stderr, "dup ok: %d\n", fd); close(fd); } struct stat st; if (fstat(0, &st) < 0) { perror("fstat"); } else { printf("fstat ok\n"); } return 0; } --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 06:14:54 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 10:14: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: <1555409694.37.0.933110224573.issue27987@roundup.psfhosted.org> Inada Naoki added the comment: > In 3.8, the union used to ensure alignment on a C double is gone. Note that two uintptr_t is aligned 16bytes on 64bit platforms and 8bytes on 32bit platforms. Python 3.7 is worse than 3.8. It used "double dummy" to align by 8 bytes, not 16 bytes. We should use "long double" to align by 16 bytes. https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf But it means +8 bytes for all tuples. If we backport PR-12850 to 3.7, +8 bytes for 1/2 tuples, and +16 bytes for remaining tuples. Any ideas about reduce impact for Python 3.7? For example, can we add 8byte dummy to PyGC_Head, and tuple use the dummy for hash? Maybe, it breaks ABI.... Not a chance... I wonder if we can add -fmax-type-align=8 for extension types... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 06:20:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 10:20:56 +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: <1555410056.85.0.30702477069.issue27987@roundup.psfhosted.org> STINNER Victor added the comment: > I wonder if we can add -fmax-type-align=8 for extension types... No, we cannot: it's a temporary fix. The flag causes compilation error if it's added to old version of clang or to a C compiler different than clang. > Any ideas about reduce impact for Python 3.7? I don't think that it's a matter of performance here. What matters the most here is correctness. See Florian Weimer's message: https://bugs.python.org/issue36618#msg340261 "This issue potentially affects all compilers, not just Clang." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 06:30:27 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 16 Apr 2019 10:30:27 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555410627.43.0.910942096724.issue36626@roundup.psfhosted.org> Andrew Svetlov added the comment: Not sure about `create_task()`. Usually you create tasks from async code, where the `_write_to_self()` call is not needed. Handling writing to self-pipe is not free, starting very many tasks at once can hit performance. Stopping the loop is another beast, we can perform relative slow operations in such calls. Thinking more about the issue I'm inclining to reject my initial proposal. If you want to stop a loop from signal handler you should make `loop.call_soon_threadsafe(loop.stop)` call because `loop.stop()` is not thread-safe operation by definition. Threadsafe call solves your problem, isn't it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:00:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 12:00:54 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1555416054.05.0.355364151756.issue36635@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12779 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:05:17 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 12:05:17 +0000 Subject: [issue36641] make docstring in C const Message-ID: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> New submission from Inada Naoki : In most case, docstring in C is constant. Can we add "const"? If we can, it can avoid allocating and copying several KBs. --- a/Include/pymacro.h +++ b/Include/pymacro.h @@ -69,4 +69,4 @@ /* Define macros for inline documentation. */ -#define PyDoc_VAR(name) static char name[] +#define PyDoc_VAR(name) static const char name[] #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) #ifdef WITH_DOC_STRINGS Some drastic impacts: before: text data bss dec hex filename 110446 57371 96 167913 28fe9 Modules/posixmodule.o 91937 32236 208 124381 1e5dd build/temp.linux-x86_64-3.8/home/inada-n/work/python/cpython/Modules/_decimal/_decimal.o 61070 31534 472 93076 16b94 build/temp.linux-x86_64-3.8/home/inada-n/work/python/cpython/Modules/_cursesmodule.o after: $ size **/*.o text data bss dec hex filename 150761 17064 96 167921 28ff1 Modules/posixmodule.o 115213 8976 208 124397 1e5ed build/temp.linux-x86_64-3.8/home/inada-n/work/python/cpython/Modules/_decimal/_decimal.o 86878 5736 472 93086 16b9e build/temp.linux-x86_64-3.8/home/inada-n/work/python/cpython/Modules/_cursesmodule.o ---------- components: Interpreter Core messages: 340333 nosy: inada.naoki priority: normal severity: normal status: open title: make docstring in C const versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:05:54 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 16 Apr 2019 12:05:54 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555416354.75.0.530630201221.issue36624@roundup.psfhosted.org> Michael Felt added the comment: Never mind - typos in the files I did work on. iow, I found a way to get the filename, and am cleaning up the errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:12:04 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 12:12:04 +0000 Subject: [issue36641] make docstring in C const In-Reply-To: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> Message-ID: <1555416724.12.0.272829601614.issue36641@roundup.psfhosted.org> Inada Naoki added the comment: Without any configure options: $ size python python-const text data bss dec hex filename 2980860 448880 131672 3561412 3657c4 python 3185372 244464 131664 3561500 36581c python-const ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:19:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 12:19:38 +0000 Subject: [issue36641] make docstring in C const In-Reply-To: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> Message-ID: <1555417178.47.0.246721132079.issue36641@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +12780 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:40:53 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 16 Apr 2019 12:40:53 +0000 Subject: [issue36641] make docstring in C const In-Reply-To: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> Message-ID: <1555418453.6.0.0531364573744.issue36641@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:49:58 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 12:49:58 +0000 Subject: [issue36642] make unicodedata "const" Message-ID: <1555418998.59.0.0730766026669.issue36642@roundup.psfhosted.org> New submission from Inada Naoki : diff --git a/Tools/unicode/makeunicodedata.py b/Tools/unicode/makeunicodedata.py index 9327693a17..2550b8f940 100644 --- a/Tools/unicode/makeunicodedata.py +++ b/Tools/unicode/makeunicodedata.py @@ -1249,7 +1249,7 @@ class Array: size = getsize(self.data) if trace: print(self.name+":", size*len(self.data), "bytes", file=sys.stderr) - file.write("static ") + file.write("static const ") if size == 1: file.write("unsigned char") elif size == 2: ---------- components: Unicode messages: 340336 nosy: benjamin.peterson, ezio.melotti, inada.naoki, vstinner priority: normal severity: normal status: open title: make unicodedata "const" versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:52:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 12:52:09 +0000 Subject: [issue36642] make unicodedata "const" In-Reply-To: <1555418998.59.0.0730766026669.issue36642@roundup.psfhosted.org> Message-ID: <1555419129.25.0.197286038726.issue36642@roundup.psfhosted.org> STINNER Victor added the comment: Can you write a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:53:14 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Tue, 16 Apr 2019 12:53:14 +0000 Subject: [issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d In-Reply-To: <1552917459.29.0.295748589939.issue36345@roundup.psfhosted.org> Message-ID: <1555419194.33.0.494102648612.issue36345@roundup.psfhosted.org> St?phane Wirtel added the comment: New changeset 2b7f93b99afbe78e4e567d9252d9470d29f387c8 by St?phane Wirtel in branch 'master': bpo-36345: Update wsgiref example (GH-12562) https://github.com/python/cpython/commit/2b7f93b99afbe78e4e567d9252d9470d29f387c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:54:20 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 12:54:20 +0000 Subject: [issue36642] make unicodedata "const" In-Reply-To: <1555418998.59.0.0730766026669.issue36642@roundup.psfhosted.org> Message-ID: <1555419260.27.0.529547706025.issue36642@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +12781 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 08:54:39 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 16 Apr 2019 12:54:39 +0000 Subject: [issue36641] make docstring in C const In-Reply-To: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> Message-ID: <1555419279.57.0.284462582503.issue36641@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 09:01:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 13:01:36 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1555419696.63.0.326152528819.issue36508@roundup.psfhosted.org> STINNER Victor added the comment: New changeset cd46b09b0863c787dd54c433fae52bd8bdfaecd0 by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-36508: python-config don't export LINKFORSHARED (GH-12661) (GH-12748) https://github.com/python/cpython/commit/cd46b09b0863c787dd54c433fae52bd8bdfaecd0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 09:04:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 13:04:17 +0000 Subject: [issue36508] python-config --ldflags must not contain LINKFORSHARED ("-Xlinker -export-dynamic" on Linux) In-Reply-To: <1554217219.99.0.0709585421369.issue36508@roundup.psfhosted.org> Message-ID: <1555419857.59.0.752784046543.issue36508@roundup.psfhosted.org> STINNER Victor added the comment: The bug is fixed in 3.7 and master (future 3.8) branches. I prefer to leave 2.7 unchanged. I close the issue. Python 2.7 is affected as well, but I'm really scared to touch the build system of Python 2.7 which is very stable. Even for Python 3.7, I wasn't fully comfortable to merge my fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 09:12:18 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 13:12:18 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1555420338.85.0.944948941791.issue36616@roundup.psfhosted.org> STINNER Victor added the comment: Jeroen Demeyer closed his PR 12839, so I close the issue as well. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 09:46:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 13:46:44 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1555422404.23.0.570916970304.issue34160@roundup.psfhosted.org> STINNER Victor added the comment: FYI pungi project is also broken by this change and it blocks Fedora Rawhide to upgrade to Python 3.8: https://bugzilla.redhat.com/show_bug.cgi?id=1698514 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 09:49:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 13:49:44 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555422584.09.0.410362288229.issue35866@roundup.psfhosted.org> STINNER Victor added the comment: Gregory: It seems like https://github.com/python/cpython/commit/3b699932e5ac3e76031bbb6d700fbea07492641d is causing deadlocks which is not a good thing. What do you think of reverting this change? ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 09:54:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 13:54:57 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555422897.56.0.468285452371.issue35866@roundup.psfhosted.org> STINNER Victor added the comment: A least 2 projects were broken by the logging change: libreswan and Anaconda. > I've filed a Fedora bug report that points to this one: That's related to the libreswan project. Last year, there was another regression in Anaconda: Fedora installer: > https://bugzilla.redhat.com/show_bug.cgi?id=1644936 The workaround/fix was to revert 3b699932e5ac3e7 in Python. Anaconda has been modified, and we were able to revert the revert 3b699932e5ac3e7 :-) I'm not sure what was the Anaconda fix. Maybe this change? https://github.com/rhinstaller/anaconda/pull/1721 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 10:05:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 14:05:48 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1555423548.26.0.425892929646.issue34160@roundup.psfhosted.org> STINNER Victor added the comment: PR 10452 is still open. Should it be closed if you consider that we must not add an optional sort_attrs=False attribute? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 10:24:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 14:24:32 +0000 Subject: [issue36558] Change time.mktime() return type from float to int? In-Reply-To: <1554728057.82.0.282756231506.issue36558@roundup.psfhosted.org> Message-ID: <1555424672.21.0.687711413774.issue36558@roundup.psfhosted.org> STINNER Victor added the comment: I started a thread on python-dev: https://mail.python.org/pipermail/python-dev/2019-April/157121.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 11:33:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 15:33:32 +0000 Subject: [issue36631] test_urllib2net: test_ftp_no_timeout() killed after a timeout of 15 min In-Reply-To: <1555324751.9.0.575658866792.issue36631@roundup.psfhosted.org> Message-ID: <1555428812.28.0.8476610519.issue36631@roundup.psfhosted.org> STINNER Victor added the comment: > It seems like test_urllib2net.test_ftp_no_timeout() has no timeout: it should use a timeout to not block the whole test suite if the FTP server is down. Well. I didn't read the name of the test... I'm not sure that it makes any sense to add a timeout to test called "no_timeout"... On Linux, there is TCP_USER_TIMEOUT socket option. Maybe we could use that? Or maybe I will just close the issue since it's likely that it's not going to come back soon... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 11:36:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 15:36:25 +0000 Subject: [issue35697] _decimal: Implement the previously rejected changes from #7442. In-Reply-To: <1547033508.44.0.197270282125.issue35697@roundup.psfhosted.org> Message-ID: <1555428985.72.0.779590337478.issue35697@roundup.psfhosted.org> STINNER Victor added the comment: I'm no longer interested to rewrite my patch to avoid _Py_GetLocaleconvNumeric() which comes from the internal API, so I close my PR. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 11:39:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 15:39:01 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1555429141.69.0.965742339833.issue34814@roundup.psfhosted.org> STINNER Victor added the comment: > Downstream (RHEL) issue: > https://bugzilla.redhat.com/show_bug.cgi?id=1585201 This issue has been closed as "not a bug". -- Since this issue has been created, no consensus could be found. So I close the issue to keep the status quo. In short, RTLD_LOCAL is not supported. I also close this issue as not a bug. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 11:44:54 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 16 Apr 2019 15:44:54 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1555429494.57.0.688151056406.issue34814@roundup.psfhosted.org> Antoine Pitrou added the comment: What do you mean, "no consensus could be found"? I don't see anyone objecting the change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 11:53:56 2019 From: report at bugs.python.org (Nick Davies) Date: Tue, 16 Apr 2019 15:53:56 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555430036.04.0.833625212793.issue36607@roundup.psfhosted.org> Change by Nick Davies : ---------- type: -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:01:04 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 16 Apr 2019 16:01:04 +0000 Subject: [issue36634] venv: activate.bat fails for venv with parentheses in PATH In-Reply-To: <1555337759.6.0.97149991925.issue36634@roundup.psfhosted.org> Message-ID: <1555430464.91.0.746465704145.issue36634@roundup.psfhosted.org> Steve Dower added the comment: We should be able to use alternate characters in the SET call, or just drop the quotes completely. In theory they make sense, but there's no trailing whitespace to worry about here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:08:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 16:08:27 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555430907.93.0.328229147954.issue35755@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:11:11 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 16:11:11 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555431071.65.0.147089930819.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 12858 to os.confstr("CS_PATH") if available in shutil.which() and distutils.spawn.find_executable(), but also change the behavior when the PATH environment variable is set to an empty string: use an empty string, don't use os.confstr("CS_PATH") nor os.defpath. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:17:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 16:17:01 +0000 Subject: [issue36263] test_hashlib.test_scrypt() fails on Fedora 29 In-Reply-To: <1552317311.05.0.612992750251.issue36263@roundup.psfhosted.org> Message-ID: <1555431421.66.0.84278915307.issue36263@roundup.psfhosted.org> STINNER Victor added the comment: OpenSSL regression has been fixed in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1688284 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:18:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 16:18:54 +0000 Subject: [issue36558] Change time.mktime() return type from float to int? In-Reply-To: <1554728057.82.0.282756231506.issue36558@roundup.psfhosted.org> Message-ID: <1555431534.5.0.803000947336.issue36558@roundup.psfhosted.org> STINNER Victor added the comment: https://mail.python.org/pipermail/python-dev/2019-April/157125.html Guido van Rossum wrote: "Consistency with C should not be the issue -- consistency between the time functions is important. (...) So let's drop the idea." I close the issue. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:22:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 16:22:01 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1555431721.95.0.271394780888.issue34814@roundup.psfhosted.org> STINNER Victor added the comment: > What do you mean, "no consensus could be found"? I don't see anyone objecting the change. I propose a change to always link and a change to never link. I don't see any tracking towards one option. It seems like there are issues on Android. Anyway, this issue only seems to be theoretical since libpython must not be used with RTLD_LOCAL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:47:31 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 16 Apr 2019 16:47:31 +0000 Subject: [issue33783] Use proper class markup for random.Random docs In-Reply-To: <1528294962.84.0.592728768989.issue33783@psf.upfronthosting.co.za> Message-ID: <1555433251.54.0.981216632685.issue33783@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:47:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 16:47:32 +0000 Subject: [issue33783] Use proper class markup for random.Random docs In-Reply-To: <1528294962.84.0.592728768989.issue33783@psf.upfronthosting.co.za> Message-ID: <1555433252.27.0.191702376758.issue33783@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 31e8d69bfe7cf5d4ffe0967cb225d2a8a229cc97 by Victor Stinner (Matthias Bussonnier) in branch 'master': bpo-33783: Use proper class markup for random.Random docs (GH?7817) https://github.com/python/cpython/commit/31e8d69bfe7cf5d4ffe0967cb225d2a8a229cc97 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 12:59:00 2019 From: report at bugs.python.org (Jakub Wilk) Date: Tue, 16 Apr 2019 16:59:00 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555433940.09.0.345778010137.issue35755@roundup.psfhosted.org> Jakub Wilk added the comment: which(1) is not standardized, and there are many[*] implementations with different behavior in corner cases. For example, this happens with zsh 5.7.1 on Debian: % which python /usr/bin/python % PATH= which python python % PATH=. which python ./python % PATH=: which python python [*] I'm aware of GNU which, which from debianutils, and zsh builtin. In addition to this, AFAICS every major BSD distro has a different implementation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 13:05:00 2019 From: report at bugs.python.org (cagney) Date: Tue, 16 Apr 2019 17:05:00 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555434300.64.0.221149233392.issue35866@roundup.psfhosted.org> cagney added the comment: (disclaimer: I'm mashing my high level backtraces in with @jwiki's low level backtraces) The Python backtrace shows the deadlocked process called 'f' which then 'called': import ctypes which, in turn 'called': from _ctypes import Union, Structure, Array and that hung. The low-level back-trace shows it was trying to acquire a lock (no surprises there); but the surprise is that it is inside of dlopen() trying to load '_ctypes...so'! #11 __dlopen (file=file at entry=0x7f398da4b050 "_ctypes.cpython-37m-x86_64-linux-gnu.so", mode=) at dlopen.c:87 ... #3 _dl_map_object_from_fd (name="_ctypes.cpython-37m-x86_64-linux-gnu.so", origname=origname at entry=0x0, fd=-1, fbp=, realname=, loader=loader at entry=0x0, l_type=, mode=, stack_endp=, nsid=) at dl-load.c:1413 #2 _dl_add_to_namespace_list (new=0x55f8b8f34540, nsid=0) at dl-object.c:34 #1 __GI___pthread_mutex_lock (mutex=0x7f3991fb9970 <_rtld_global+2352>) at ../nptl/pthread_mutex_lock.c:115 and the lock in question (assuming my sources roughly match above) seems to be: /* We modify the list of loaded objects. */ __rtld_lock_lock_recursive (GL(dl_load_write_lock)); presumably a thread in the parent held this lock at the time of the fork. If one of the other children also has the lock pre-acquired then this is confirmed (unfortunately not having the lock won't rebut the theory). So, any guesses as to what dl related operation was being performed by the parent? ---- I don't think the remaining processes are involved (and I've probably got 4 in total because my machine has 4 cores). 8976 - this acquired the multi-process semaphore and is blocked in '_recv' awaiting further instructions 8978, 8977 - these are blocked waiting for above to free the multi-process semaphore ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 13:20:47 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 16 Apr 2019 17:20:47 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555435247.44.0.700019679668.issue35866@roundup.psfhosted.org> Gregory P. Smith added the comment: Please do not blindly revert that. See my PR in https://bugs.python.org/issue36533 which is specific to this "issue" with logging. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 13:22:31 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 16 Apr 2019 17:22:31 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555435351.12.0.344135733822.issue35866@roundup.psfhosted.org> Gregory P. Smith added the comment: I'd appreciate it if someone with an application running into the issue could be tested with my PR from issue36533 (https://github.com/python/cpython/pull/12704) applied. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 15:44:38 2019 From: report at bugs.python.org (Misha Drachuk) Date: Tue, 16 Apr 2019 19:44:38 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() Message-ID: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> New submission from Misha Drachuk : Forward reference is not resolved by `dataclasses.fields()`, but it works with `typing.get_type_hints()`. E.g. from dataclasses import dataclass, fields from typing import Optional, get_type_hints @dataclass class Nestable: child: Optional['Nestable'] o = Nestable(None) print('fields:', fields(o)) print('type hints:', get_type_hints(Nestable)) ... outputs the following: fields: (Field(name='child',type=typing.Union[ForwardRef('Nestable'), NoneType] ... ) type hints: {'child': typing.Union[__main__.Nestable, NoneType]} ---------- components: Library (Lib) messages: 340361 nosy: mdrachuk priority: normal severity: normal status: open title: Forward reference is not resolved by dataclasses.fields() type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 15:49:45 2019 From: report at bugs.python.org (Jakub Wilk) Date: Tue, 16 Apr 2019 19:49:45 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555444185.35.0.906700626053.issue35866@roundup.psfhosted.org> Jakub Wilk added the comment: https://github.com/python/cpython/pull/12704 doesn't fix the bug for me. Reverting 3b699932e5ac3e76031bbb6d700fbea07492641d doesn't fix it either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 16:04:45 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 16 Apr 2019 20:04:45 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1555445085.06.0.888509752022.issue36643@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 16:08:54 2019 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 16 Apr 2019 20:08:54 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1555445334.59.0.127145136519.issue34160@roundup.psfhosted.org> Stefan Behnel added the comment: I rejected the (now conflicting) PR that adds a sorting option. I also sent Victor a tentative (and trivial) patch for the pungi package. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 16:43:52 2019 From: report at bugs.python.org (PEW's Corner) Date: Tue, 16 Apr 2019 20:43:52 +0000 Subject: [issue36644] Improve documentation of slice.indices() Message-ID: <1555447432.64.0.0569137704921.issue36644@roundup.psfhosted.org> New submission from PEW's Corner : The slice class is described in the Built-In Functions document: https://docs.python.org/3/library/functions.html#slice ... but that entry fails to mention the indices() method, and states that slice objects "have no other explicit functionality" beyond the start, stop, and step attributes. The entry links only to a glossary item which doesn't provide more info. However, it turns out that there is another description of slice objects - including the indices() method - in the Data model document: https://docs.python.org/3/reference/datamodel.html#slice.indices ... but (as the rejected issue 11842 in my opinion correctly argues) this entry is not clear about how to interpret the return values from the indices() method, i.e. that they are appropriate as arguments to range() - not as arguments to a new slice(). So, right now the best documentation of the indices() method is the old Python 2.3 "what's new" documentation of extended slices: https://docs.python.org/2.3/whatsnew/section-slices.html "To simplify implementing sequences that support extended slicing, slice objects now have a method indices(length) which, given the length of a sequence, returns a (start, stop, step) tuple that can be passed directly to range(). indices() handles omitted and out-of-bounds indices in a manner consistent with regular slices (and this innocuous phrase hides a welter of confusing details!)." I would propose to at least: * Add a link from the slice class in the Built-In Functions doc to the slice object section of the Data model doc. * Delete the statement about "no other explicit functionality" in the Built-In Functions doc. * Mention in the Data model doc that the return values from indices() can be passed to range() to obtain the sequence of indices described by the slice when applied to a sequence object of the specified length, and perhaps make it clear that the indices() values do not in general represent the new start, stop, and step attributes of a truncated slice object. ---------- assignee: docs at python components: Documentation messages: 340364 nosy: docs at python, pewscorner priority: normal severity: normal status: open title: Improve documentation of slice.indices() type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 17:16:02 2019 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 16 Apr 2019 21:16:02 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555449362.01.0.502808304606.issue30485@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: +12784 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 17:19:56 2019 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 16 Apr 2019 21:19:56 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555449596.01.0.71725447941.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: I submitted a PR that changes the API back to an empty string. While lxml uses None here, an all-strings mapping is simply more convenient. I will start supporting both in lxml from the next release. Comments welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 17:30:11 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 21:30:11 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1555433940.09.0.345778010137.issue35755@roundup.psfhosted.org> Message-ID: STINNER Victor added the comment: My PR is consistent with the behavior you described in your zsh example, no? which doesn't find python if PATH is empty or equal to ":". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 17:32:45 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 21:32:45 +0000 Subject: [issue33783] Use proper class markup for random.Random docs In-Reply-To: <1528294962.84.0.592728768989.issue33783@psf.upfronthosting.co.za> Message-ID: <1555450365.85.0.992053359103.issue33783@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a6fce19968cd39dfbc2684f97ca3184d9996f61e by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-33783: Use proper class markup for random.Random docs (GH-7817) (GH-12859) https://github.com/python/cpython/commit/a6fce19968cd39dfbc2684f97ca3184d9996f61e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 17:37:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 16 Apr 2019 21:37:27 +0000 Subject: [issue33783] Use proper class markup for random.Random docs In-Reply-To: <1528294962.84.0.592728768989.issue33783@psf.upfronthosting.co.za> Message-ID: <1555450647.68.0.00365457900491.issue33783@roundup.psfhosted.org> STINNER Victor added the comment: I pushed Matthias's change. Thanks Matthias! I am not sure that it implements exactly what Nick asked. Reopen the issue if it is not the case. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 18:29:30 2019 From: report at bugs.python.org (Berker Peksag) Date: Tue, 16 Apr 2019 22:29:30 +0000 Subject: [issue36432] Running python test suite fails on macOS 10.14.4 with resource.RLIMIT_STACK error In-Reply-To: <1553584151.61.0.380593331105.issue36432@roundup.psfhosted.org> Message-ID: <1555453770.36.0.996113288599.issue36432@roundup.psfhosted.org> Berker Peksag added the comment: I can also confirm that reverting 335ab5b66f432ae3713840ed2403a11c368f5406 fixes the problem. ---------- nosy: +berker.peksag type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 18:40:12 2019 From: report at bugs.python.org (Caleb Donovick) Date: Tue, 16 Apr 2019 22:40:12 +0000 Subject: [issue35297] untokenize documentation is not correct In-Reply-To: <1542921902.22.0.788709270274.issue35297@psf.upfronthosting.co.za> Message-ID: <1555454412.7.0.676592275969.issue35297@roundup.psfhosted.org> Change by Caleb Donovick : ---------- nosy: +donovick _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 18:42:59 2019 From: report at bugs.python.org (mollison) Date: Tue, 16 Apr 2019 22:42:59 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions Message-ID: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> New submission from mollison : This is regarding the change to re.sub() between 3.6 and 3.7 that results in different behavior even for simple cases like the following: re.sub('a*','b', 'a') returns 'b' in 3.6 and 'bb' in 3.7 This change is well documented here: https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api However, it is not well documented here: https://docs.python.org/3.7/library/re.html The latter document does actually contain the appropriate text: "Empty matches for the pattern are replaced when adjacent to a previous non-empty match." However, the formatting makes this text look like it was always there, and is not part of the 3.7 changes announcement. That is how I interpreted it, leading to some lost productivity. After so many years, people don't expect the regex engine to change like this, and that only makes it easier to misinterpret that text as always have been there vs. being new to 3.7. Related: https://bugs.python.org/issue32308 ---------- assignee: docs at python components: Documentation messages: 340370 nosy: docs at python, mollison priority: normal severity: normal status: open title: re.sub() library entry does not adequately document surprising change in behavior between versions versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 19:18:00 2019 From: report at bugs.python.org (Berker Peksag) Date: Tue, 16 Apr 2019 23:18:00 +0000 Subject: [issue19961] MacOSX: Tkinter build failure when building without command-line tools In-Reply-To: <1386850286.1.0.287048995559.issue19961@psf.upfronthosting.co.za> Message-ID: <1555456680.14.0.526823222836.issue19961@roundup.psfhosted.org> Change by Berker Peksag : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 19:39:58 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 23:39:58 +0000 Subject: [issue36641] make docstring in C const In-Reply-To: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> Message-ID: <1555457998.46.0.456761786465.issue36641@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 926b0cb5f688808dc11448a0bf3e452d1b92c232 by Inada Naoki in branch 'master': bpo-36641: Add "const" to PyDoc_VAR macro (GH-12854) https://github.com/python/cpython/commit/926b0cb5f688808dc11448a0bf3e452d1b92c232 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 19:40:36 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 23:40:36 +0000 Subject: [issue36642] make unicodedata "const" In-Reply-To: <1555418998.59.0.0730766026669.issue36642@roundup.psfhosted.org> Message-ID: <1555458036.78.0.508376707216.issue36642@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 6fec905de5c139017f36b212e54cac46959808fe by Inada Naoki in branch 'master': bpo-36642: make unicodedata const (GH-12855) https://github.com/python/cpython/commit/6fec905de5c139017f36b212e54cac46959808fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 19:40:49 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 23:40:49 +0000 Subject: [issue36642] make unicodedata "const" In-Reply-To: <1555418998.59.0.0730766026669.issue36642@roundup.psfhosted.org> Message-ID: <1555458049.53.0.820249209434.issue36642@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 19:41:02 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 16 Apr 2019 23:41:02 +0000 Subject: [issue36641] make docstring in C const In-Reply-To: <1555416317.5.0.961282490804.issue36641@roundup.psfhosted.org> Message-ID: <1555458062.95.0.340375876085.issue36641@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 20:46:40 2019 From: report at bugs.python.org (Ryan) Date: Wed, 17 Apr 2019 00:46:40 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 Message-ID: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> New submission from Ryan : My script need scan a netdisk directory to get the content of it. I use os.listdir() method for an easy implement, then I got permission error when executing in Python 3.x, but the same code is working fine in Python 2.7,I attached a screenshot for explaining the problem. ---------- components: Windows files: X1ONx.png messages: 340373 nosy: Ryan_D at 163.com, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.listdir() got permission error in Python3.6 but it's fine in Python2.7 type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file48269/X1ONx.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 20:49:55 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 17 Apr 2019 00:49:55 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555462195.28.0.561170939792.issue36645@roundup.psfhosted.org> Josh Rosenberg added the comment: I believe the second note under "Changed in 3.7" is intended to address this: > Empty matches for the pattern are replaced when adjacent to a previous non-empty match. Obviously not as detailed as the What's New entry, but it's there. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 21:18:46 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 17 Apr 2019 01:18:46 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555463926.69.0.2630048752.issue36646@roundup.psfhosted.org> Steven D'Aprano added the comment: Please don't post screen shots of text, copy and paste the text as text. Screen shots are hostile to the blind and visually impaired as screen-readers don't work with them. They make it impossible for us to copy your code to run it ourselves, and text in screen shots cannot be searched for. As this is a permission error, the chances are very strong that it is not a bug but an actual OS permission error. You need to eliminate site-specific factors: Are you running the two different versions of Python using the same user account with the same access controls? If the two versions of Python run with different permissions, that may explain why you get a permission error. What are the permssions on the file you are trying to access? Could there be any additional OS-level or network drive ACLs? Being a networked drive, is it possible that it is a transient network glitch being wrongly reported by Windows as a permission error? In other words, do you get the same error every time, or was it just a one-off? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 21:25:00 2019 From: report at bugs.python.org (mollison) Date: Wed, 17 Apr 2019 01:25:00 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555464300.61.0.590464961281.issue36645@roundup.psfhosted.org> mollison added the comment: You have not understood my message. I know that text is already there. My point is that because it's in a separate paragraph, it looks like it's not part of Changed in 3.7. There is nowhere else on the page where a change description is in a separate paragraph from the "Changed in version X.X:" text. When I came across this I thought, this probably goes with the paragraph before it, right? In other words, it's probably another change from 3.7, just in a different paragraph? But then I thought, no, they probably wouldn't change something like that (i.e. basic regex stuff) after so many years. So it's not that obvious. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 22:06:54 2019 From: report at bugs.python.org (Tanmay Jain) Date: Wed, 17 Apr 2019 02:06:54 +0000 Subject: [issue35663] webbrowser.py firefox bug [python3, windows 10] In-Reply-To: <1546664632.95.0.705177998493.issue35663@roundup.psfhosted.org> Message-ID: <1555466814.0.0.766155206312.issue35663@roundup.psfhosted.org> Tanmay Jain added the comment: Fix: If you set firefox as your default browser then we get correct return from browser_controller.open(url) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 22:22:04 2019 From: report at bugs.python.org (Ryan) Date: Wed, 17 Apr 2019 02:22:04 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555467724.15.0.851001233042.issue36646@roundup.psfhosted.org> Ryan added the comment: Hi Steven, Thanks for your reply, I paste the output I executed just now as below. You can see that the both version of Python are running in the same shell with the same permission. And the frequency of this problem is always happen. BTW, the network disk is an intranet path of our company, we have the read permission of it. PS D:\workspace> python Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.listdir(r'L:\Temp') ['manager.txt', 'alps-trunk-m0.tk.log', '2015102914.LOG', 'log', 'alps-trunk-m0.tk-k55mv1_64_om_c2k6m_eng-2015111215.LOG ', 'logof', '1', 'dsp_1_ltg_n.bin', 'dsp_1_lwg_n.bin', 'modem_1_ltg_n.img', 'modem_1_lwg_n.img', 'kernel_symbols', 'k55v 1_64_om_c2k6m_clang.log', 'k55v1_64_om_c2k6m_android.log', 'k50v1_64_om_c2k6m_android.log', 'collectBuildLog.sh', 'Utili tySpotlight', 'k55v1_bsp_android.log', 'specialowner.pm', 'DBbuild_GIT.pl', 'daily_out-k37mv1_basic', 'mtkall_new.txt', 'Visa', 'insert_err_command_file.txt', 'test', 'DB_X_remake.list', 'aosp_img.txt', 'Jola', '04272', 'alps_dailybuild.ini ', 'Luca', 'android-security-bulletin', 'michael', '2018073115.LOG', 'LOG~1', 'mtk-db.pl', 'MCD_k79v1_64_android.log', ' build-full_k79v1_64.ninja'] >>> exit() PS D:\workspace> python3 Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.listdir(r'L:\Temp') Traceback (most recent call last): File "", line 1, in PermissionError: [WinError 5] ?????: 'L:\\Temp' >>> exit() PS D:\workspace> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 22:38:35 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 17 Apr 2019 02:38:35 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555467724.15.0.851001233042.issue36646@roundup.psfhosted.org> Message-ID: <20190417023828.GI3010@ando.pearwood.info> Steven D'Aprano added the comment: Thanks Ryan. > PermissionError: [WinError 5] ?????: 'L:\\Temp' Can you translate the error message into English for us please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 16 23:10:10 2019 From: report at bugs.python.org (Ryan) Date: Wed, 17 Apr 2019 03:10:10 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555470610.37.0.966208151239.issue36646@roundup.psfhosted.org> Ryan added the comment: Hi Steven, > PermissionError: [WinError 5] ?????: 'L:\\Temp' to EN > PermissionError: [WinError 5] Access denied.: 'L:\\Temp' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 02:50:17 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 17 Apr 2019 06:50:17 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1555483817.12.0.751817903005.issue32424@roundup.psfhosted.org> Serhiy Storchaka added the comment: > As it stands, calling Element.__deepcopy__() will succeed with the C > implementation and fail with the Python implementation. You should not call it directly. Use copy.deepcopy(). > What is > different about the C implementation that requires the definition of > __deepcopy__() in the first place? __deepcopy__() in the C implementation is merely optimization. It is less efficient to convert from the efficient internal representation of Element object to tuples and dicts and back. > However, create_new_element() > does not make a copy of the attrib dict that is passed in, meaning that > the internal attrib dict of an Element instance is mutable by changing > the dict that was passed in. create_new_element() usually is called with a new copy of the attrib dict. Making yet one copy inside it is just a waste of time. If in some cases it is called with an externally referred dict, fix these cases by making a copy before calling create_new_element(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 04:26:30 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 17 Apr 2019 08:26:30 +0000 Subject: [issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function In-Reply-To: <1289739891.46.0.690681439003.issue10417@psf.upfronthosting.co.za> Message-ID: <1555489590.35.0.644755352234.issue10417@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > Test that your fix does not break the case of 8-bit non-ascii docstring. Do you mean double escaping of the backslash as in t\xe4st changed to t\\xe4st due to this PR? ? cpython git:(bpo10417) $ cat /tmp/foo.py # -*- coding: utf-8 -*- import unittest class UnicodeTest(unittest.TestCase): def test_unicode_docstring(self): u"""docstring with unicode character. t\xe4st""" self.assertEqual(1+1, 2) if __name__ == '__main__': unittest.main() # ASCII encoding ? cpython git:(bpo10417) $ PYTHONIOENCODING=ascii ./python.exe /tmp/foo.py --verbose test_unicode_docstring (__main__.UnicodeTest) docstring with unicode character. t\xe4st ... ok ---------------------------------------------------------------------- Ran 1 test in 0.019s OK # utf-8 encoding ? cpython git:(bpo10417) $ ./python.exe /tmp/foo.py --verbose test_unicode_docstring (__main__.UnicodeTest) docstring with unicode character. t?st ... ok ---------------------------------------------------------------------- Ran 1 test in 0.004s OK ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 04:38:41 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 17 Apr 2019 08:38:41 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1555490320.94.0.848891362728.issue36639@roundup.psfhosted.org> Raymond Hettinger added the comment: There were known, strong use cases for str.rindex(). The list.rindex() method was intentionally omitted. AFAICT no compelling use cases have arisen, so we should continue to leave it out. In general, we don't grow the core APIs unnecessarily. Thank you for the suggestion, but we should pass on this unless actual, real-world use cases arise often enough to warrant its inclusion. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 05:44:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 09:44:56 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555494296.69.0.31160940222.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: find_executable() first looks if the program exists in the current directory. My PR doesn't change that. I have no opinion if it's a good thing or not, but I don't want to change that in this PR. If someone wants to change it, please open a separated issue on bugs.python.org since it will be backward incompatible change not directly related to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 05:46:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 09:46:54 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555494414.44.0.828087117368.issue31904@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 36c41bc2017921321dbb19557f616a6bb7572c83 by Victor Stinner (Lihua Zhao) in branch 'master': bpo-31904: Fix test_tabnanny on VxWorks (GH-12646) https://github.com/python/cpython/commit/36c41bc2017921321dbb19557f616a6bb7572c83 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 06:11:42 2019 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 17 Apr 2019 10:11:42 +0000 Subject: [issue35271] venv creates pyvenv.cfg with wrong home In-Reply-To: <1542542887.08.0.788709270274.issue35271@psf.upfronthosting.co.za> Message-ID: <1555495902.85.0.582127147025.issue35271@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 06:16:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 10:16:39 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1555496199.98.0.599889796686.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: Another example: AMD64 Fedora Rawhide Refleaks 3.6 https://buildbot.python.org/all/#/builders/193/builds/5 test_contextlib leaked [8, 1, 1] memory blocks, sum=10 I cannot reproduce the issue on my ("idle") laptop. It sounds like a random failure (race condition). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 06:21:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 10:21:03 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1555496463.68.0.657869930131.issue36635@roundup.psfhosted.org> STINNER Victor added the comment: I listed DLL exports in the Visual Studio Command Prompt: dumpbin /exports \vstinner\python\master\PCbuild\amd64\python38_d.dll > \vstinner\python\exports.txt To make sure that I don't mess with commands, I started with a fresh Git checkout using: git clean -fdx PCbuild\build.bat -d -p x64 -e Good news: using PR 12853, exports.txt is exactly the same file (I expected memory address to change, but nope, they are the same). My change doesn't introduce any new symbol. See attached exports.txt file. By the way, there is no symbol which contains "PyInit" nor "Py_pickle_init" in DLL exports. ---------- Added file: https://bugs.python.org/file48270/exports.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 06:44:19 2019 From: report at bugs.python.org (Maor Kleinberger) Date: Wed, 17 Apr 2019 10:44:19 +0000 Subject: [issue36305] Inconsistent behavior of pathlib.WindowsPath with drive paths In-Reply-To: <1552664225.98.0.0986812073641.issue36305@roundup.psfhosted.org> Message-ID: <1555497859.42.0.112280196715.issue36305@roundup.psfhosted.org> Maor Kleinberger added the comment: What can we do in order to make progress here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 06:51:25 2019 From: report at bugs.python.org (Eryk Sun) Date: Wed, 17 Apr 2019 10:51:25 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555498285.01.0.354154998641.issue36646@roundup.psfhosted.org> Eryk Sun added the comment: Try os.listdir(u'L:\\Temp') in Python 2. Using a unicode string should result in the same WINAPI FindFirstFileW call as in Python 3. You're running `python3`, but the standard installation doesn't include "python3.exe". Please show the output of `(get-command python3).source` in PowerShell. Compare the security context (user, groups, privileges) by running subprocess.call('whoami /all /fo list') from both Python 2 and 3. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 06:59:22 2019 From: report at bugs.python.org (Robert Collins) Date: Wed, 17 Apr 2019 10:59:22 +0000 Subject: [issue26903] ProcessPoolExecutor(max_workers=64) crashes on Windows In-Reply-To: <1462135538.41.0.857077084248.issue26903@psf.upfronthosting.co.za> Message-ID: <1555498762.59.0.755207473138.issue26903@roundup.psfhosted.org> Robert Collins added the comment: This is now showing up in end user tools like black: https://github.com/ambv/black/issues/564 ---------- nosy: +rbcollins versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 08:02:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 12:02:30 +0000 Subject: [issue36273] test_thread leaks a core dump on PPC64 AIX 3.x In-Reply-To: <1552407244.81.0.665825370239.issue36273@roundup.psfhosted.org> Message-ID: <1555502550.6.0.16511942439.issue36273@roundup.psfhosted.org> STINNER Victor added the comment: The same bug is back: https://buildbot.python.org/all/#/builders/10/builds/2443 Warning -- files was modified by test_threading Before: [] After: ['core'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 08:27:00 2019 From: report at bugs.python.org (Dan Timofte) Date: Wed, 17 Apr 2019 12:27:00 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555504020.31.0.127391223104.issue36626@roundup.psfhosted.org> Dan Timofte added the comment: `loop.call_soon_threadsafe(loop.stop)` solves the problem because it has the write_to_self there. I can use that or call loop._write_to_self() myself before calling loop.stop(). In my code i'm stoping the loop from the exception_handler not signal. The code was a small example i thought of that reproduces the described behaviour. You can close the issue if it's ok for you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 09:07:37 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 17 Apr 2019 13:07:37 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555506457.09.0.47545288493.issue36626@roundup.psfhosted.org> Andrew Svetlov added the comment: Technically signal handlers are called from main thread, while loop can be executed in another one. *In general* `call_soon_threadsafe()` is the correct solution. Also, it works fine just now with Python 3.5+ Let's close as won't fix ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 09:07:50 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 17 Apr 2019 13:07:50 +0000 Subject: [issue36626] asyncio run_forever blocks indefinitely In-Reply-To: <1555221451.6.0.952991660079.issue36626@roundup.psfhosted.org> Message-ID: <1555506470.6.0.451382347511.issue36626@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 09:15:40 2019 From: report at bugs.python.org (Ryan) Date: Wed, 17 Apr 2019 13:15:40 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555506940.71.0.978180619839.issue36646@roundup.psfhosted.org> Ryan added the comment: I ran "python3" because I rename the execute file for distincting with python2 exe. PS D:\workspace> (get-command python3).source C:\Python36_64\python3.exe There is no problem for my dev environment, it's an obviously different output for the same API call between python2.7 and python3.6. not only listdir(), but also os.walk() has the same problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 09:41:04 2019 From: report at bugs.python.org (Michael Felt) Date: Wed, 17 Apr 2019 13:41:04 +0000 Subject: [issue36273] test_thread leaks a core dump on PPC64 AIX 3.x In-Reply-To: <1555502550.6.0.16511942439.issue36273@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: On 17/04/2019 14:02, STINNER Victor wrote: > STINNER Victor added the comment: > > The same bug is back: > https://buildbot.python.org/all/#/builders/10/builds/2443 > > Warning -- files was modified by test_threading > Before: [] > After: ['core'] > > ---------- What can I do to "copy" the core dump before normal testing removes it? I have had a similar message regarding the multiprocessing tests, but in those cases I expect it is the "client" thread complaining about a "server" thread crash. > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 09:50:12 2019 From: report at bugs.python.org (Eryk Sun) Date: Wed, 17 Apr 2019 13:50:12 +0000 Subject: [issue36305] Inconsistent behavior of pathlib.WindowsPath with drive paths In-Reply-To: <1552664225.98.0.0986812073641.issue36305@roundup.psfhosted.org> Message-ID: <1555509012.37.0.751255682595.issue36305@roundup.psfhosted.org> Eryk Sun added the comment: > In contrast, in the case of CreateProcessW, both Path('./exec') and > Path('exec') are the *correct* paths to the executable. The ./ is not > necessary in that case to display the path correctly, but just to > interact correctly with CreateProcessW's interface. It's semantic information, just for different reasons than the "./c:a" case. In this case, it's about what a path means in a search context. I think specifying a filesystem path for a search disposition is as valid a use case as is specifying a path for an open or create disposition. In Windows, the qualified path r".\exec" is resolved relative to just the working directory. Classically, for an unqualified name such as "exec", the working directory is checked after the application directory. Starting with Windows Vista, CreateProcessW and the CMD shell won't check the working directory at all for unqualified "exec" if NoDefaultCurrentDirectoryInExePath is set in the environment, not unless a "." entry is explicitly added to PATH. The behavior of CreateProcessW also differs for r".\spam\exec" vs r"spam\exec". Without explicitly including the leading ".", the system searches every directory in the executable search path (i.e. the application directory, working directory, system directories, and PATH). This differs from Unix, in which any path with a slash in it is always resolved relative to the working directory. Getting this behavior in Windows requires using the qualified path r".\spam\exec". We may want either behavior. I think if a path is specified explicitly with a leading "." component, or joined from one, the "." component should be preserved, just as we already preserve a leading ".." component. This is a separate issue, as I suggested in the PR comment. It was just supposed to be a related issue that you might be interested in. I didn't intend to conflate it with this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 09:53:47 2019 From: report at bugs.python.org (Eryk Sun) Date: Wed, 17 Apr 2019 13:53:47 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555509227.12.0.596767481773.issue36646@roundup.psfhosted.org> Eryk Sun added the comment: Did you try os.listdir(u'L:\\Temp') in Python 2? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 10:24:22 2019 From: report at bugs.python.org (=?utf-8?q?Jos=C3=A9_Luis_Segura_Lucas?=) Date: Wed, 17 Apr 2019 14:24:22 +0000 Subject: [issue36647] TextTestRunner doesn't honour "buffer" argument Message-ID: <1555511062.15.0.629417801049.issue36647@roundup.psfhosted.org> New submission from Jos? Luis Segura Lucas : When using "buffer = True" in a TextTestRunner, the test result behaviour doesn't change at all. This is because TextTestRunner.stream is initialised using a decorator (_WritelnDecorator). When "buffer" is passed, the TestResult base class will try to redirect the stdout and stderr to 2 different io.StringIO objects. As the TextTestRunner.stream is initialised before that "redirection", all the "self.stream.write" calls will end using the original stream (stderr by default), and resulting in not buffering at all. ---------- components: Tests messages: 340398 nosy: Jos? Luis Segura Lucas priority: normal severity: normal status: open title: TextTestRunner doesn't honour "buffer" argument type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 10:26:41 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 14:26:41 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555511201.84.0.78516380743.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 228a3c99bdb2d02771bead66a0beabafad3a90d3 by Victor Stinner in branch 'master': bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858) https://github.com/python/cpython/commit/228a3c99bdb2d02771bead66a0beabafad3a90d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 10:51:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 14:51:49 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555512709.22.0.233506745139.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: CS_PATH value: * Fedora 29: "/usr/bin" * Ubuntu 16.04: "/bin:/usr/bin" It seems like the current directory is usually not part of the CS_PATH value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:05:43 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:05:43 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555513543.31.0.416561712033.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2c4c02f8a876fcf084575dcaf857a0236c81261a by Victor Stinner in branch 'master': bpo-35755: Remove current directory from posixpath.defpath (GH-11586) https://github.com/python/cpython/commit/2c4c02f8a876fcf084575dcaf857a0236c81261a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:06:12 2019 From: report at bugs.python.org (Jakub Wilk) Date: Wed, 17 Apr 2019 15:06:12 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555513572.57.0.309703504337.issue35755@roundup.psfhosted.org> Jakub Wilk added the comment: (Note that in msg333835 another implementation, presumably GNU which, was tested.) My point is that "which" implementations have different behavior, so justifying anything with "which" compatibility is weird at best. You can't be compatible with all them. Also telling users that you "mimick Unix which command behavior" is unhelpful, because vast majority of users have no idea how it behaves in this corner case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:15:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:15:37 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555514137.77.0.680846165488.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: > My point is that "which" implementations have different behavior I don't understand this point. Your example is consistent with what I saw on my Fedora 29 and the Python implementation that I just merged. Would you mind to elaborate which corner case is handled differently and describe how? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:23:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:23:54 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555514634.77.0.521963776269.issue35755@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:24:26 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:24:26 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555514666.44.0.854699925224.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: Anyway, I wrote PR 12861 to remove "to mimick Unix which command behavior". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:32:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:32:37 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1555515157.08.0.273896162163.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: It seems like a change has been pushed into urllib3 to fix this issue, but that there is an issue with international URLs and that maybe RFC 3986 should be updated. RFC 3986: "Uniform Resource Identifier (URI): Generic Syntax" (January 2005) https://www.ietf.org/rfc/rfc3986.txt "Without #1531 or IRI support in rfc3986 releasing master in it's current state will break backwards compatibility with international URLs." https://github.com/urllib3/urllib3/issues/1553#issuecomment-474046652 => where 1531 means https://github.com/urllib3/urllib3/pull/1531 "wave Hi! I've noticed that CVE-2019-11236 has been assigned to the CRLF injection issue described here. It seems that the library has been patched in GitHub, but no new release has been made to pypi. Will a new release containing the fix be made to pypi soon? Based on @theacodes comment it seems like a release was going to be made, but I also see her status has her perhaps unavailable. Is someone else perhaps able to cut a new release into pypi?" https://github.com/urllib3/urllib3/issues/1553#issuecomment-484113222 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:33:43 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:33:43 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555515223.74.0.803838644597.issue31904@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2954550818e5c23a082e6279eb326168230ebf04 by Victor Stinner (Lihua Zhao) in branch 'master': bpo-31904: Port test_cmd_line to VxWorks (#12648) https://github.com/python/cpython/commit/2954550818e5c23a082e6279eb326168230ebf04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:35:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:35:49 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1555515349.93.0.562842481869.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: "wave Hi! I've noticed that CVE-2019-11236 has been assigned to the CRLF injection issue described here. It seems that the library has been patched in GitHub, but no new release has been made to pypi. (...)" This urllib3 change: https://github.com/urllib3/urllib3/commit/0aa3e24fcd75f1bb59ab159e9f8adb44055b2271 urllib3 now vendors a copy of the rfc3986 library: https://pypi.org/project/rfc3986/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:40:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:40:34 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1555515634.49.0.0457858901985.issue30458@roundup.psfhosted.org> STINNER Victor added the comment: > urllib3 now vendors a copy of the rfc3986 library: > https://pypi.org/project/rfc3986/ There are multiple Python projects to validate URI: * https://github.com/python-hyper/rfc3986/ -> https://pypi.org/project/rfc3986/ * https://github.com/dgerber/rfc3987 -> https://pypi.org/project/rfc3987/ (the name is confusing: the library implements the RFC 3986, not the RFC 3987) * https://github.com/tkem/uritools/ -> https://pypi.org/project/uritools/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:41:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:41:37 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1555515697.18.0.642032718726.issue31904@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 693c104ae74feea11f0b51176dc91ecd153230c0 by Victor Stinner (Lihua Zhao) in branch 'master': bpo-31904: Port test_resource to VxWorks (GH-12719) https://github.com/python/cpython/commit/693c104ae74feea11f0b51176dc91ecd153230c0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:44:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:44:10 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555515850.76.0.0615165781943.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 197f0447e3bcfa4f529fedab09966d7e3d283979 by Victor Stinner in branch 'master': bpo-35755: Don't say "to mimick Unix which command behavior" (GH-12861) https://github.com/python/cpython/commit/197f0447e3bcfa4f529fedab09966d7e3d283979 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:49:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 15:49:01 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555516141.18.0.044528724979.issue35755@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:53:41 2019 From: report at bugs.python.org (LihuaZhao) Date: Wed, 17 Apr 2019 15:53:41 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks Message-ID: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> New submission from LihuaZhao : anonymous mappings is not part of the POSIX standard, python user just need to specified -1 as fd value when do anonymous map, for example: m = mmap.mmap(-1, 100) then python adapter module(mmapmodule.c) try to specify MAP_SHARED or MAP_PRIVATE based on operate system requirement, Linux require MAP_SHARED, VxWorks require MAP_PRIVATE, this different should be hidden by this module, and python user won't be affected. Currently, mmap is only adapted for the system which use MAP_SHARED when do anonymous map, VxWorks need be supported. https://en.wikipedia.org/wiki/Mmap ---------- components: Library (Lib) messages: 340411 nosy: lzhao priority: normal pull_requests: 12787 severity: normal status: open title: MAP_SHARED isn't proper for anonymous mappings for VxWorks versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:54:55 2019 From: report at bugs.python.org (LihuaZhao) Date: Wed, 17 Apr 2019 15:54:55 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555516495.48.0.626146810826.issue36648@roundup.psfhosted.org> Change by LihuaZhao : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:55:52 2019 From: report at bugs.python.org (LihuaZhao) Date: Wed, 17 Apr 2019 15:55:52 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555516552.89.0.054834481243.issue36648@roundup.psfhosted.org> Change by LihuaZhao : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:56:39 2019 From: report at bugs.python.org (LihuaZhao) Date: Wed, 17 Apr 2019 15:56:39 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555516599.26.0.305518232198.issue36648@roundup.psfhosted.org> Change by LihuaZhao : ---------- keywords: +patch pull_requests: +12788 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 11:57:11 2019 From: report at bugs.python.org (LihuaZhao) Date: Wed, 17 Apr 2019 15:57:11 +0000 Subject: [issue31094] asyncio: get list of connected clients In-Reply-To: <1501564064.1.0.785973244818.issue31094@psf.upfronthosting.co.za> Message-ID: <1555516631.59.0.848725704342.issue31094@roundup.psfhosted.org> Change by LihuaZhao : ---------- pull_requests: +12789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:06:10 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 17 Apr 2019 16:06:10 +0000 Subject: [issue22454] Adding the opposite function of shlex.split() In-Reply-To: <1411328149.26.0.00522128245951.issue22454@psf.upfronthosting.co.za> Message-ID: <1555517170.12.0.608748927563.issue22454@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:09:25 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 17 Apr 2019 16:09:25 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555517365.12.0.24095590702.issue32849@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:09:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:09:25 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555517365.62.0.798082448363.issue32849@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3092d6b2630e4d2bd200fbc3231c27a7cba4d6b2 by Victor Stinner in branch 'master': bpo-32849: Fix is_valid_fd() on FreeBSD (GH-12852) https://github.com/python/cpython/commit/3092d6b2630e4d2bd200fbc3231c27a7cba4d6b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:30:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:30:38 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555518638.91.0.925476266305.issue32849@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b87a8073db73f9ffa96104e00c624052e34b11c7 by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-32849: Fix is_valid_fd() on FreeBSD (GH-12852) (GH-12863) https://github.com/python/cpython/commit/b87a8073db73f9ffa96104e00c624052e34b11c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:33:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:33:47 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555518827.05.0.145843616447.issue32849@roundup.psfhosted.org> STINNER Victor added the comment: In short, Python 2.7 doesn't seem to be affected by fstat/dup issues. Python 2.7 doesn't check if file descriptors 0, 1 and 2 at startup. Python 2 uses PyFile_FromFile() to create sys.stdin, sys.stdout and sys.stderr which create a "file" object. The function calls fstat(fd) but it ignores the error: fstat() is only used to fail if the fd is a directory. Python 2.7 doesn't have the is_valid_fd() function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:36:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:36:19 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555518979.68.0.288121213319.issue32849@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Rudolph Froger for the bug report: the issue is now fixed in 3.7 and master (future Python 3.8) branches. Sorry for the delay. -- Alexey Izbyshev wrote PR 5773 to also use fstat() on Linux. I chose to merge my PR 12852 which is more conservative: it keeps dup() on Linux. I'm not sure why exactly, but I recall that the author of the function, Antoine Pitrou, wanted to use dup() on Linux. I'm not convinced by the O_PATH issue on Linux (described above), so I merged my conservative change instead. Later, we can still move to fstat() on Linux as well if someone comes with a more concrete example against dup(). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:38:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:38:10 +0000 Subject: [issue35755] Remove current directory from posixpath.defpath to enhance security In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555519090.2.0.811058261043.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 394b991e41a2a4ce3afc8e6fde44de46e73bbb34 by Victor Stinner in branch '3.7': [3.7] bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12862) https://github.com/python/cpython/commit/394b991e41a2a4ce3afc8e6fde44de46e73bbb34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:38:47 2019 From: report at bugs.python.org (=?utf-8?b?5p6X6Ieq5Z2H?=) Date: Wed, 17 Apr 2019 16:38:47 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1555519127.5.0.42865089216.issue36639@roundup.psfhosted.org> ??? added the comment: Hi @rhettinger , Thank you for the reply. May I ask what is the known, strong use cases for str.rindex()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:38:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:38:59 +0000 Subject: [issue35755] shutil.which() and subprocess no longer looks the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555519139.45.0.0211469753801.issue35755@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Remove current directory from posixpath.defpath to enhance security -> shutil.which() and subprocess no longer looks the executable in the current directory if PATH environment variable is not set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:39:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:39:08 +0000 Subject: [issue35755] shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555519148.56.0.10541837449.issue35755@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: shutil.which() and subprocess no longer looks the executable in the current directory if PATH environment variable is not set -> shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:50:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:50:06 +0000 Subject: [issue35755] shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555519806.48.0.64409374486.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: Gregory: > I'm not arguing against this change, just trying to figure out where it came from in the first place. We should fix the value on all OSes. In the meanwhile, I reverted the ntpath change. I'm not sure that it's ok to change the Windows case. shutil.which() *always* starts by checking if the searched program is the current directory: if sys.platform == "win32": # The current directory takes precedence on Windows. ... if curdir not in path: path.insert(0, curdir) If someone cares about changing Windows, please open a separated issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:50:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:50:34 +0000 Subject: [issue35755] shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555519834.12.0.741232128918.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: I'm still confused by distutils.spawn.find_executable() function which *always* first look the current directory. I don't know the rationale for this behavior, so I made the conservation choice of keeping it. If someone wants to change distutils.spawn.find_executable(), please open a separated issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:53:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 16:53:09 +0000 Subject: [issue35755] On Unix, shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555519989.13.0.668846566926.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: I modified posixpath.defpath, shutil.which() and distutils.spawn.find_executable() in 3.7 and master (future Python 3.8) branches. I close the issue. Thanks everybody for the review and helping me to collect info about corner cases! I chose to also change Python 3.7. IMHO there is a low risk of breaking applications: I expect that few users run Python with no PATH environment variable *and* expect that Python looks for programs in the current directory. But it enhances the security a little bit. For Python 2.7... well, I don't think that this issue is important enough to justify a backport. I prefer to do nothing rather than having to deal with unhappy users complaining that Python 2.7 changed broke their application in a minor 2.7.x release :-) Even if, again, the risk of regression is very low. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set -> On Unix, shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 12:54:43 2019 From: report at bugs.python.org (Roundup Robot) Date: Wed, 17 Apr 2019 16:54:43 +0000 Subject: [issue18564] Integer overflow in socketmodule In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1555520083.18.0.601607654532.issue18564@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +12791 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 13:00:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 17:00:09 +0000 Subject: [issue18564] Integer overflow in socketmodule In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1555520409.92.0.230450355101.issue18564@roundup.psfhosted.org> STINNER Victor added the comment: > In Modules/socketmodule.c , the bluetooth address supplied is vulnerable to integer overflow. Attached PR 12864 modifies the following code: unsigned int b0, b1, b2, b3, b4, b5; char ch; int n; n = sscanf(name, "%X:%X:%X:%X:%X:%X%c", &b5, &b4, &b3, &b2, &b1, &b0, &ch); Can someone please elaborate how this code can trigger an integer overflow? What is the consequence of an integer overflow? Does Python crash? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 13:00:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 17:00:44 +0000 Subject: [issue18564] Integer overflow in the socket function parsing a Bluetooth address In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1555520444.46.0.404090894154.issue18564@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Integer overflow in socketmodule -> Integer overflow in the socket function parsing a Bluetooth address versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 13:10:16 2019 From: report at bugs.python.org (Tim Hatch) Date: Wed, 17 Apr 2019 17:10:16 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555521016.77.0.531322269405.issue36607@roundup.psfhosted.org> Change by Tim Hatch : ---------- nosy: +thatch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 13:29:24 2019 From: report at bugs.python.org (Jakub Wilk) Date: Wed, 17 Apr 2019 17:29:24 +0000 Subject: [issue35755] On Unix, shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555522164.4.0.161505442771.issue35755@roundup.psfhosted.org> Jakub Wilk added the comment: When PATH is empty string: * zsh and FreeBSD which look for binaries in cwd. * debianutils and GNU which always fail. I suspect that the former is implementation accident. I can't imagine why would anyone want this behavior. NB, POSIX says that when PATH is unset or empty, the path search is implementation-defined. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 13:48:46 2019 From: report at bugs.python.org (Brett Cannon) Date: Wed, 17 Apr 2019 17:48:46 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555523326.68.0.0329420225029.issue36645@roundup.psfhosted.org> Brett Cannon added the comment: @mollison: would you like to open a PR w/ how you would expect it to be formatted? ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:25:01 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 17 Apr 2019 18:25:01 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555525501.01.0.104040864788.issue36607@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks for the report! I see 3 ways to fix the bug: 1. Guard _all_tasks with threading.Lock. It hurts performance significantly. 2. Retry list(_all_tasks) call in a loop if RuntimeError was raised. A chance of collision is very low, the strategy is good enough 3. Change _all_tasks from weak set of tasks to WeakDict[AbstractEventLoop, WeakSet[Task]]. This realization eliminates the collision it is a little complicated. Plus loop should be hashable now (perhaps ok but I'm not sure if all third-party loops support it). Thus I'm inclining to bullet 2. THoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:26:59 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 17 Apr 2019 18:26:59 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555525619.9.0.524670698756.issue36607@roundup.psfhosted.org> Andrew Svetlov added the comment: The fix can be applied to 3.7 and 3.8 only, sorry. Python 3.6 is in security mode now. ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:30:48 2019 From: report at bugs.python.org (Hugues Valois) Date: Wed, 17 Apr 2019 18:30:48 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths Message-ID: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> New submission from Hugues Valois : When reading registry values under HKCU\SOFTWARE\Python\PythonCore\3.7 that were written by the Windows Store app install, all file and folder paths are incorrect. Notice the extra [ ] as well as the missing backslash before python.exe and pythonw.exe Paths read from registry are: ``` C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0[ ] C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0python.exe[ ] C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0pythonw.exe[ ] ``` Paths on disk are: ``` C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0 C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\python.exe C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\pythonw.exe ``` ---------- components: Installation, Windows messages: 340426 nosy: Hugues Valois, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows Store app install registry keys have incorrect paths type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:37:59 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 17 Apr 2019 18:37:59 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555526279.7.0.0775983747245.issue36649@roundup.psfhosted.org> Steve Dower added the comment: Can you get me the *exact* Windows version number you're using? I added those to work around a bug where keys were being incorrectly trimmed, and that format seemed to evaluate to nothing correctly, but perhaps that bug has been fixed in the OS? ---------- assignee: -> steve.dower versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:41:17 2019 From: report at bugs.python.org (Nick Davies) Date: Wed, 17 Apr 2019 18:41:17 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555526477.92.0.928028231941.issue36607@roundup.psfhosted.org> Nick Davies added the comment: My preference would actually be number 3 because: 1: I agree that this isn't really a safe option because it could slow things down (possibly a lot) 2: I haven't found this to be rare in my situation but I am not sure how common my setup is. We have a threaded server with a mix of sync and asyncio so we use run in a bunch of places inside threads. Any time the server gets busy any task creation that occurs during the return of run crashes. My two main reservations about this approach are: - There is a potentially unbounded number of times that this could need to retry. - Also this is covering up a thread unsafe operation and we are pretty lucky based on the current implementation that it explodes in a consistent and sane way that we can catch and retry. 3: Loop is already expected to be hashable in 3.7 as far as I can tell (https://github.com/python/cpython/blob/3.7/Lib/asyncio/tasks.py#L822) so other than the slightly higher complexity this feels like the cleanest solution. > The fix can be applied to 3.7 and 3.8 only, sorry. Python 3.6 is in security mode now. Thats fine, you can work around the issue using asyncio.set_task_factory to something that tracks the tasks per loop with some care. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:45:43 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 17 Apr 2019 18:45:43 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 Message-ID: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> New submission from Jason R. Coombs : In [this ticket](https://github.com/jaraco/jaraco.functools/issues/12), I learned that [jaraco.functools.method_cache](https://github.com/jaraco/jaraco.functools/blob/6b32ee0dfd3e7c88f99e88cd87c35fa9b76f261f/jaraco/functools.py#L109-L180) no longer works on Python 3.7.3. A distilled version of what's not working is this example: ``` >>> import jaraco.functools >>> class MyClass: ... calls = 0 ... @jaraco.functools.method_cache ... def call_me_maybe(self, val): ... self.calls += 1 ... return val ... >>> a = MyClass() >>> a.call_me_maybe(0) 0 >>> a.call_me_maybe(0) 0 >>> a.calls 2 ``` The second call to the cached function is missing the cache even though the parameters to the function are the same. ``` >>> a.call_me_maybe >>> a.call_me_maybe.cache_info() CacheInfo(hits=0, misses=2, maxsize=128, currsize=2) ``` Here's a further distilled example not relying on any code from jaraco.functools: ``` >>> def method_cache(method): ... def wrapper(self, *args, **kwargs): ... # it's the first call, replace the method with a cached, bound method ... bound_method = functools.partial(method, self) ... cached_method = functools.lru_cache()(bound_method) ... setattr(self, method.__name__, cached_method) ... return cached_method(*args, **kwargs) ... return wrapper ... >>> import functools >>> class MyClass: ... calls = 0 ... @method_cache ... def call_me_maybe(self, val): ... self.calls += 1 ... return val ... >>> a = MyClass() >>> a.call_me_maybe(0) 0 >>> a.call_me_maybe(0) 0 >>> a.calls 2 ``` I was not able to replicate the issue with a simple lru_cache on a partial object: ``` >>> def func(a, b): ... global calls ... calls += 1 ... >>> import functools >>> cached = functools.lru_cache()(functools.partial(func, 'a')) >>> calls = 0 >>> cached(0) >>> cached(0) >>> calls 1 ``` Suggesting that there's some interaction with the instance attribute and the caching functionality. I suspect the issue arose as a result of changes in issue35780. ---------- assignee: rhettinger keywords: 3.7regression messages: 340429 nosy: jaraco, rhettinger priority: normal severity: normal status: open title: Cached method implementation no longer works on Python 3.7.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:46:22 2019 From: report at bugs.python.org (cagney) Date: Wed, 17 Apr 2019 18:46:22 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555526782.0.0.560465073184.issue35866@roundup.psfhosted.org> cagney added the comment: Here's a possible stack taken during the fork(): Thread 1 "python3" hit Breakpoint 1, 0x00007ffff7124734 in fork () from /lib64/libc.so.6 Thread 1814 (Thread 0x7fffe69d5700 (LWP 23574)): #0 0x00007ffff7bc24e5 in __pthread_mutex_unlock_usercnt () from /lib64/libpthread.so.0 #1 0x00007ffff71928e3 in dl_iterate_phdr () from /lib64/libc.so.6 #2 0x00007fffe5fcfe55 in _Unwind_Find_FDE () from /lib64/libgcc_s.so.1 #3 0x00007fffe5fcc403 in uw_frame_state_for () from /lib64/libgcc_s.so.1 #4 0x00007fffe5fcd90f in _Unwind_ForcedUnwind_Phase2 () from /lib64/libgcc_s.so.1 #5 0x00007fffe5fcdf30 in _Unwind_ForcedUnwind () from /lib64/libgcc_s.so.1 #6 0x00007ffff7bc7712 in __pthread_unwind () from /lib64/libpthread.so.0 #7 0x00007ffff7bbf7e7 in pthread_exit () from /lib64/libpthread.so.0 #8 0x000000000051b2fc in PyThread_exit_thread () at Python/thread_pthread.h:238 #9 0x000000000055ed16 in t_bootstrap (boot_raw=0x7fffe8da0e40) at ./Modules/_threadmodule.c:1021 #10 0x00007ffff7bbe594 in start_thread () from /lib64/libpthread.so.0 #11 0x00007ffff7157e5f in clone () from /lib64/libc.so.6 Thread 1 (Thread 0x7ffff7fca080 (LWP 20524)): #0 0x00007ffff7124734 in fork () from /lib64/libc.so.6 #1 0x0000000000532c8a in os_fork_impl (module=) at ./Modules/posixmodule.c:5423 #2 os_fork (module=, _unused_ignored=) at ./Modules/clinic/posixmodule.c.h:1913 where, in my source code, dl_iterate_phdr() starts with something like: /* Make sure nobody modifies the list of loaded objects. */ __rtld_lock_lock_recursive (GL(dl_load_write_lock)); i.e., when the fork occures, the non-fork thread has acquired dl_load_write_lock - the same lock that the child will later try to acquire (and hang) no clue as to what that thread is doing though; other than it looks like it is trying to generate a backtrace? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:47:35 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 17 Apr 2019 18:47:35 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555526855.52.0.174984588494.issue36650@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- components: +Library (Lib) type: -> behavior versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:49:45 2019 From: report at bugs.python.org (cagney) Date: Wed, 17 Apr 2019 18:49:45 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555526985.51.0.583617840692.issue35866@roundup.psfhosted.org> cagney added the comment: run ProcessPoolExecutor with one fixed child (over ride default of #cores) ---------- Added file: https://bugs.python.org/file48271/cf-deadlock-1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:50:20 2019 From: report at bugs.python.org (cagney) Date: Wed, 17 Apr 2019 18:50:20 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555527020.07.0.558977150735.issue35866@roundup.psfhosted.org> cagney added the comment: script to capture stack backtrace at time of fork, last backtrace printed will be for hang ---------- Added file: https://bugs.python.org/file48272/gdb.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:52:55 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 17 Apr 2019 18:52:55 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555527175.39.0.359858954641.issue36649@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +12792 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:52:55 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 17 Apr 2019 18:52:55 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555527175.53.0.856355244653.issue36650@roundup.psfhosted.org> Jason R. Coombs added the comment: I've put together this full reproducer script: ``` import functools def method_cache(method): def wrapper(self, *args, **kwargs): # it's the first call, replace the method with a cached, bound method bound_method = functools.partial(method, self) cached_method = functools.lru_cache()(bound_method) setattr(self, method.__name__, cached_method) return cached_method(*args, **kwargs) return wrapper class MyClass: calls = 0 @method_cache def call_me_maybe(self, number): self.calls += 1 return number ob = MyClass() ob.call_me_maybe(0) ob.call_me_maybe(0) assert ob.calls == 1 ``` That code fails on Python 3.7.3. If I bypass the `from _functools import _lru_cache_wrapper` in functools, the test no longer fails, so the issue seems to be only with the C implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:53:02 2019 From: report at bugs.python.org (Enrico Carbognani) Date: Wed, 17 Apr 2019 18:53:02 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) Message-ID: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> New submission from Enrico Carbognani : In the documentation for the call_later and the call_at methods there is a note which says that the delay cannot be longer than a day, but both methods have a note saying that this limitation was removed in Python 3.8. ---------- assignee: docs at python components: Documentation files: documenation_incosistency.png messages: 340434 nosy: Enrico Carbognani, docs at python priority: normal severity: normal status: open title: Asyncio Event Loop documentation inconsistency (call_later and call_at methods) versions: Python 3.8 Added file: https://bugs.python.org/file48273/documenation_incosistency.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 14:55:13 2019 From: report at bugs.python.org (Hugues Valois) Date: Wed, 17 Apr 2019 18:55:13 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555527313.46.0.293760620218.issue36649@roundup.psfhosted.org> Hugues Valois added the comment: C:\Users\huvalo>ver Microsoft Windows [Version 10.0.17763.437] ---------- versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 15:03:42 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 17 Apr 2019 19:03:42 +0000 Subject: [issue23382] Maybe can not shutdown ThreadPoolExecutor when call the method of shutdown In-Reply-To: <1422951603.17.0.63584283635.issue23382@psf.upfronthosting.co.za> Message-ID: <1555527822.13.0.166565254554.issue23382@roundup.psfhosted.org> Josh Rosenberg added the comment: Correct me if I'm wrong, but this isn't actually an issue for CPython, right? The GIL ensures that when a thread writes to _shutdown, nothing else is reading it until the GIL is released and acquired by a new thread (which synchronizes _shutdown). It might conceivably be a problem on non-CPython interpreters if they have no other form of inter-thread synchronization involved; that said, the locking involved in the self.work_queue.get(block=True) call likely synchronizes by side-effect even there. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 15:04:09 2019 From: report at bugs.python.org (Rudolph Froger) Date: Wed, 17 Apr 2019 19:04:09 +0000 Subject: [issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams In-Reply-To: <1518686430.4.0.467229070634.issue32849@psf.upfronthosting.co.za> Message-ID: <1555527849.85.0.222249402339.issue32849@roundup.psfhosted.org> Rudolph Froger added the comment: Thanks all for the fixes! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 15:28:40 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 17 Apr 2019 19:28:40 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555529320.12.0.52279331998.issue36650@roundup.psfhosted.org> Josh Rosenberg added the comment: It seems highly likely this is related to #26110 which optimizes method calls by avoiding the creation of bound methods in certain circumstances, and/or the follow-up #29263. Side-note: bound_method = functools.partial(method, self) is not how you create real bound methods. The correct approach (that makes a bound method identical to what the interpreter makes when necessary) for your use case is: bound_method = types.MethodType(method, self) ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 15:34:30 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 17 Apr 2019 19:34:30 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555529670.46.0.206061200743.issue36650@roundup.psfhosted.org> Josh Rosenberg added the comment: Hmm... Although I can't seem to reproduce on 3.7.2 (ob.calls is 1), so assuming it is really happening in 3.7.3, it wouldn't be either of those issues (which were fully in place long before 3.7.2 I believe). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 15:37:37 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 17 Apr 2019 19:37:37 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555529857.16.0.937656603844.issue36650@roundup.psfhosted.org> Jason R. Coombs added the comment: Hi Josh. Thanks for the tip on types.MethodType. I've updated the code to use that and the behavior seems to be the same, MethodType does seem a more appropriate way to create a bound method. Regarding the referenced tickets, I suspect they're not pertinent, as the behavior did work in Python 3.7.1 (confirmed) and 3.7.2 (highly likely), so the regression appears to be in the changes for 3.7.3 (https://docs.python.org/3.7/whatsnew/changelog.html#python-3-7-3-final). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 15:45:34 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 17 Apr 2019 19:45:34 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555530334.84.0.582703384468.issue36649@roundup.psfhosted.org> Steve Dower added the comment: Great, thanks. I have a fix in PR, but I'm going to do a "real" build to check. My machine is running a beta build, unfortunately, so I can't validate it against the older version. Might ping you for some help with that. ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:04:42 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Wed, 17 Apr 2019 20:04:42 +0000 Subject: [issue21710] --install-base option ignored? In-Reply-To: <1402436563.61.0.260081261103.issue21710@psf.upfronthosting.co.za> Message-ID: <1555531482.48.0.503123636852.issue21710@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:07:40 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 17 Apr 2019 20:07:40 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555531660.35.0.284791851378.issue35866@roundup.psfhosted.org> Gregory P. Smith added the comment: I am unable to get cf-deadlock.py to hang on my own builds of pure CPython 3.7.2+ d7cb2034bb or 3.6.8+ be77fb7a6e (versions i had in a local git clone). which specific python builds are seeing the hang using? Which specific platform/distro version? "3.7.2" isn't enough, if you are using a distro supplied interpreter please try and reproduce this with a build from the CPython tree itself. distros always apply their own patches to their own interpreters. ... Do realize that while working on this it is fundamentally *impossible* per POSIX for os.fork() to be safely used at the Python level in a process also using pthreads. That this _ever_ appeared to work is a pure accident of implementations of underlying libc, malloc, system libraries, and kernel behaviors. POSIX considers it undefined behavior. Nothing done in CPython can avoid that. Any "fix" for these kinds of issues is merely working around the inevitable which will re-occur. concurrent.futures.ProcessPoolExecutor uses multiprocessing for its process management. As of 3.7 ProcessPoolExecutor accepts a mp_context parameter to specify the multiprocessing start method. Alternatively the default appears to be controllable as a global setting https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods. Use the 'spawn' start method and the problem should go away as it'll no longer be misusing os.fork(). You _might_ be able to get the 'forkserver' start method to work, but only reliably if you make sure the forkserver is spawned _before_ any threads in the process (such as ProcessPoolExecutor's own queue management thread - which appears to be spawned upon the first call to .submit()). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:12:11 2019 From: report at bugs.python.org (Enrico Carbognani) Date: Wed, 17 Apr 2019 20:12:11 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555531931.78.0.279722266688.issue36651@roundup.psfhosted.org> Change by Enrico Carbognani : ---------- keywords: +patch pull_requests: +12793 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:15:57 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Wed, 17 Apr 2019 20:15:57 +0000 Subject: [issue27679] set_bitfields() unused in _ctypes_test In-Reply-To: <1470299556.34.0.285781931231.issue27679@psf.upfronthosting.co.za> Message-ID: <1555532157.98.0.52998298169.issue27679@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:19:49 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 17 Apr 2019 20:19:49 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555532389.8.0.521434536199.issue36650@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:30:21 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 17 Apr 2019 20:30:21 +0000 Subject: [issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function In-Reply-To: <1289739891.46.0.690681439003.issue10417@psf.upfronthosting.co.za> Message-ID: <1555533021.58.0.635083444119.issue10417@roundup.psfhosted.org> Serhiy Storchaka added the comment: I mean that '\xe4'.encode(encoding, 'backslashreplace') will fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:46:09 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 17 Apr 2019 20:46:09 +0000 Subject: [issue18564] Integer overflow in the socket function parsing a Bluetooth address In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1555533969.23.0.177243233418.issue18564@roundup.psfhosted.org> Serhiy Storchaka added the comment: Seconded Viktor's question. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:47:47 2019 From: report at bugs.python.org (wheelerlaw) Date: Wed, 17 Apr 2019 20:47:47 +0000 Subject: [issue36652] Non-embedded zip distribution Message-ID: <1555534067.61.0.67923116935.issue36652@roundup.psfhosted.org> New submission from wheelerlaw : Pretty straight forward request. It would be nice if there was an installation method where I can just unzip a Python distribution rather than running an installer. Specifically this is for getting Python to run in Wine. Right now, Python for Windows runs fine under Wine, but the installer doesn't, so a manual process of running the installer on a Windows machine and then copying the installed resources to a Linux machine with Wine installed. A zip distribution would solve this, since I could just unzip it and run it under Wine. ---------- components: Installation messages: 340445 nosy: wheelerlaw priority: normal severity: normal status: open title: Non-embedded zip distribution type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 16:58:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 20:58:47 +0000 Subject: [issue35755] On Unix, shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1555522164.4.0.161505442771.issue35755@roundup.psfhosted.org> Message-ID: STINNER Victor added the comment: > I suspect that the former is implementation accident. I can't imagine why would anyone want this behavior. > > NB, POSIX says that when PATH is unset or empty, the path search is implementation-defined. Not thank you POSIX for being clueless. Let's say that Python is opiniatied, as when we decided that file descriptors must be created non-inheritable by default even if "it goes against POSIX". If you want to look if the current directory, you now have to ask for it kindly and explicitly ;-) IHMO Using CS_PATH rather than hardcoded os.defpath is also a major step forward ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 17:01:20 2019 From: report at bugs.python.org (mollison) Date: Wed, 17 Apr 2019 21:01:20 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555534880.7.0.860437918426.issue36645@roundup.psfhosted.org> mollison added the comment: @brett.cannon: Yes, I will submit a PR. I have the code ready to go already. I just submitted the Python contributor agreement. I think it will take the system a day or two to register that. Then, I will submit the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 17:02:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 17 Apr 2019 21:02:49 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1555534969.2.0.120283548522.issue36635@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5c75f37d473140f0e0b7d9bf3a8c08343447ded1 by Victor Stinner in branch 'master': bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853) https://github.com/python/cpython/commit/5c75f37d473140f0e0b7d9bf3a8c08343447ded1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 17:31:38 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 17 Apr 2019 21:31:38 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555536698.31.0.631331555038.issue36649@roundup.psfhosted.org> Steve Dower added the comment: New changeset 4c3efd9cd07194b5db2a60ae5951134cda8b69db by Steve Dower in branch 'master': bpo-36649: Remove trailing spaces for registry keys when installed via the Store (GH-12865) https://github.com/python/cpython/commit/4c3efd9cd07194b5db2a60ae5951134cda8b69db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 17:32:59 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 17 Apr 2019 21:32:59 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555536779.15.0.109288296657.issue36649@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12794 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 17:52:18 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 17 Apr 2019 21:52:18 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555537938.28.0.568100791414.issue36649@roundup.psfhosted.org> miss-islington added the comment: New changeset 0d4f16d283fe3b8a183775ac7ac193988d971ad5 by Miss Islington (bot) in branch '3.7': bpo-36649: Remove trailing spaces for registry keys when installed via the Store (GH-12865) https://github.com/python/cpython/commit/0d4f16d283fe3b8a183775ac7ac193988d971ad5 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 18:01:48 2019 From: report at bugs.python.org (cagney) Date: Wed, 17 Apr 2019 22:01:48 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555538508.93.0.179993336987.issue35866@roundup.psfhosted.org> cagney added the comment: We're discussing vanilla Python, for instance v3.7.0 is: git clone .../cpython cd cpython git checkout v3.7.0 ./configure --prefix=/home/python/v3.7.0 make -j && make -j install (my 3.6.x wasn't vanilla, but I clearly stated that) Like I also mentioned, loading down the machine also helps. Try something like running #cores*2 of the script in parallel? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 18:22:57 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 17 Apr 2019 22:22:57 +0000 Subject: [issue36277] pdb's recursive debug command is not listed in the docs In-Reply-To: <1552441297.14.0.332408963845.issue36277@roundup.psfhosted.org> Message-ID: <1555539777.16.0.297040410975.issue36277@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- keywords: +easy stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 18:34:23 2019 From: report at bugs.python.org (PushkarVaity) Date: Wed, 17 Apr 2019 22:34:23 +0000 Subject: [issue36653] Dictionary Key is without ' ' quotes Message-ID: <1555540463.86.0.601540134814.issue36653@roundup.psfhosted.org> New submission from PushkarVaity : I am using Python 3.7 with anaconda install. I am trying to write out a dictionary with similar key's. for ex: proc_dict = {'add': ('/home/file.tcl', 'args'), 'add': ('/home/file2.tcl', 'args'), 'sub': ('/home/file2.tcl', 'args')} To do this, I am using the following class definition and functions: class ProcOne(object): def __init__(self, name): self.name = name def __repr__(self): return self.name I am writing out the dictionary in the following way: proc_dict[ProcOne(proc_name)] = (full_file, proc_args) Now, the dictionary key as shown in the example at top is of string type. proc_name is the variable holding this string. The values are tuples. Both elements in the tuple are strings. When the dictionary is finally written out, the format is as below: proc_dict = {add: ('/home/file.tcl', 'args'), add: ('/home/file2.tcl', 'args'), sub: ('/home/file2.tcl', 'args')} Please note the difference from the first example. The key values don't have a ' ' quote in spite of being a string variable type. Since the string quotes are missing, it is very difficult to do post processing on this dictionary key. I am a student and I though that this is an issue because now I am not able to compare the key value with a normal string because of the missing quotes. The in or not in checking operations do not evaluate to true/false because of the missing quotes. Please let me know if this has never been reported before as I am just a novice programmer and would be a big boost to my morale :-) Also, please let me know if this issue was already known or wasn't an issue at all. ---------- components: Regular Expressions messages: 340452 nosy: PushkarVaity, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Dictionary Key is without ' ' quotes type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 18:43:11 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 17 Apr 2019 22:43:11 +0000 Subject: [issue33039] int() and math.trunc don't accept objects that only define __index__ In-Reply-To: <1520672231.04.0.467229070634.issue33039@psf.upfronthosting.co.za> Message-ID: <1555540991.86.0.222293671986.issue33039@roundup.psfhosted.org> Cheryl Sabella added the comment: R?mi, Are you still working on the patch for this? Thanks! ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 18:43:41 2019 From: report at bugs.python.org (Brett Cannon) Date: Wed, 17 Apr 2019 22:43:41 +0000 Subject: [issue32913] Improve regular expression HOWTO In-Reply-To: <1519330200.78.0.467229070634.issue32913@psf.upfronthosting.co.za> Message-ID: <1555541021.98.0.9473619584.issue32913@roundup.psfhosted.org> Brett Cannon added the comment: New changeset a6de52c74d831e45ee0ff105196da8a58b9e43cd by Brett Cannon (josh) in branch 'master': bpo-32913: Added re.Match.groupdict example to regex HOWTO (GH-5821) https://github.com/python/cpython/commit/a6de52c74d831e45ee0ff105196da8a58b9e43cd ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 18:50:01 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 17 Apr 2019 22:50:01 +0000 Subject: [issue35959] math.prod(range(10)) caues segfault In-Reply-To: <1549825733.5.0.0745476001214.issue35959@roundup.psfhosted.org> Message-ID: <1555541401.92.0.318315549212.issue35959@roundup.psfhosted.org> Cheryl Sabella added the comment: Hi Pablo, Was this something you still wanted to clean up or can this be closed? Thanks! ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 19:23:45 2019 From: report at bugs.python.org (cagney) Date: Wed, 17 Apr 2019 23:23:45 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555543425.63.0.935466854976.issue35866@roundup.psfhosted.org> cagney added the comment: @gregory.p.smith, I'm puzzled by your references to POSIX and/or os.fork(). The code in question looks like: import concurrent.futures import sys def f(): import ctypes while True: with concurrent.futures.ProcessPoolExecutor() as executor: ftr = executor.submit(f) ftr.result() which, to me, looks like pure Python. Are you saying that this code can't work on GNU/Linux systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 19:26:44 2019 From: report at bugs.python.org (Matthew Barnett) Date: Wed, 17 Apr 2019 23:26:44 +0000 Subject: [issue36653] Dictionary Key is without ' ' quotes In-Reply-To: <1555540463.86.0.601540134814.issue36653@roundup.psfhosted.org> Message-ID: <1555543604.92.0.984074201328.issue36653@roundup.psfhosted.org> Matthew Barnett added the comment: That should be: def __repr__(self): return repr(self.name) Not a bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 19:43:13 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 17 Apr 2019 23:43:13 +0000 Subject: [issue36653] Dictionary Key is without ' ' quotes In-Reply-To: <1555540463.86.0.601540134814.issue36653@roundup.psfhosted.org> Message-ID: <1555544593.53.0.446179930898.issue36653@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi PushkarVaity, and welcome! I hope that Matthew's suggestion fixes your code for you, but please remember that this is a bug tracker for bugs in the Python language and standard library, not a help desk. As a beginner, 99.9% of the times you think that you have found a bug in Python, you haven't, it will be a bug in your own code. There are many forums where you can ask for help with your code, such as the tutor mailing list https://mail.python.org/mailman/listinfo/tutor Stackoverflow, Reddit's /rlearnpython, and more. You should check with other, more experienced programmers before reporting things as bugs. Thank you. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 19:52:39 2019 From: report at bugs.python.org (LihuaZhao) Date: Wed, 17 Apr 2019 23:52:39 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555545159.02.0.419978832007.issue36648@roundup.psfhosted.org> Change by LihuaZhao : ---------- pull_requests: -12788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 19:55:56 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 17 Apr 2019 23:55:56 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555545356.16.0.372587171929.issue35866@roundup.psfhosted.org> Gregory P. Smith added the comment: concurrent.futures.ProcessPoolExecutor uses both multiprocessing and threading. multiprocessing defaults to using os.fork(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 21:03:04 2019 From: report at bugs.python.org (cary) Date: Thu, 18 Apr 2019 01:03:04 +0000 Subject: [issue36466] Adding a way to strip annotations from compiled bytecode In-Reply-To: <1553825507.66.0.407362572806.issue36466@roundup.psfhosted.org> Message-ID: <1555549384.07.0.314114744245.issue36466@roundup.psfhosted.org> cary added the comment: Thanks for the feedback! I wasn't aware that modules depended on this during runtime. Abandoning this :) ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 21:06:10 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 01:06:10 +0000 Subject: [issue36638] typeperf.exe is not in all skus of Windows SKUs In-Reply-To: <1555376915.06.0.702327922476.issue36638@roundup.psfhosted.org> Message-ID: <1555549570.8.0.460185962809.issue36638@roundup.psfhosted.org> Steve Dower added the comment: New changeset 264a0b40b030fc0ff919b8294df91bdaac853bfb by Steve Dower (Paul Monson) in branch 'master': bpo-36638: Fix WindowsLoadTracker exception on some Windows versions (GH-12849) https://github.com/python/cpython/commit/264a0b40b030fc0ff919b8294df91bdaac853bfb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 21:09:18 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 01:09:18 +0000 Subject: [issue36071] Add support for Windows ARM32 in ctypes/libffi Message-ID: <1555549758.98.0.909981280409.issue36071@roundup.psfhosted.org> New submission from Steve Dower : New changeset 11efd79076559cc6e4034bb36db73e5e4293f02d by Steve Dower (Paul Monson) in branch 'master': bpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059) https://github.com/python/cpython/commit/11efd79076559cc6e4034bb36db73e5e4293f02d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 21:10:42 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 01:10:42 +0000 Subject: [issue36638] typeperf.exe is not in all skus of Windows SKUs In-Reply-To: <1555376915.06.0.702327922476.issue36638@roundup.psfhosted.org> Message-ID: <1555549842.92.0.678133326072.issue36638@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 21:10:55 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 01:10:55 +0000 Subject: [issue36071] Add support for Windows ARM32 in ctypes/libffi In-Reply-To: <1555549758.98.0.909981280409.issue36071@roundup.psfhosted.org> Message-ID: <1555549855.63.0.777003454504.issue36071@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 22:33:05 2019 From: report at bugs.python.org (Ryan) Date: Thu, 18 Apr 2019 02:33:05 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555554785.24.0.488608918803.issue36646@roundup.psfhosted.org> Ryan added the comment: PS D:\workspace> python Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.listdir(u'L:\\Temp') [u'manager.txt', u'alps-trunk-m0.tk.log', u'2015102914.LOG', u'log', u'alps-trunk-m0.tk-k55mv1_64_om_c2k6m_eng-201511121 5.LOG', u'logof', u'1', u'dsp_1_ltg_n.bin', u'dsp_1_lwg_n.bin', u'modem_1_ltg_n.img', u'modem_1_lwg_n.img', u'kernel_sym bols', u'k55v1_64_om_c2k6m_clang.log', u'k55v1_64_om_c2k6m_android.log', u'k50v1_64_om_c2k6m_android.log', u'collectBuil dLog.sh', u'UtilitySpotlight', u'k55v1_bsp_android.log', u'specialowner.pm', u'DBbuild_GIT.pl', u'daily_out-k37mv1_basic ', u'mtkall_new.txt', u'Visa', u'insert_err_command_file.txt', u'test', u'DB_X_remake.list', u'aosp_img.txt', u'Jola', u '04272', u'alps_dailybuild.ini', u'Luca', u'android-security-bulletin', u'michael', u'2018073115.LOG', u'LOG~1', u'mtk-d b.pl', u'MCD_k79v1_64_android.log', u'build-full_k79v1_64.ninja'] >>> exit() PS D:\workspace> PS D:\workspace> PS D:\workspace> python3 Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.listdir(u'L:\\Temp') Traceback (most recent call last): File "", line 1, in PermissionError: [WinError 5] Access denied.: 'L:\\Temp' >>> exit() PS D:\workspace> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 22:34:06 2019 From: report at bugs.python.org (cagney) Date: Thu, 18 Apr 2019 02:34:06 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555554846.9.0.823559915095.issue35866@roundup.psfhosted.org> cagney added the comment: So: #1 we've a bug: the single-threaded ProcessPoolExecutor test program should work 100% reliably - it does not #2 we've a cause: ProcessPoolExecutor is implemented internally using an unfortunate combination of fork and threads, this is causing the deadlock #3 we've got a workaround - something like: ProcessPoolExecutor(multiprocessing.get_context('spawn')) but I'm guessing, the documentation is scant. As for a fix, maybe: - have ProcessPoolExecutor use 'spawn' by default; this way things always work - have ProcessPoolExecutor properly synchronized its threads before "spawning"/"forking"/... so that "single-threaded" code works - document that combining ProcessPoolExecutor's "fork" option and user threads isn't a good idea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 23:14:51 2019 From: report at bugs.python.org (Windson Yang) Date: Thu, 18 Apr 2019 03:14:51 +0000 Subject: [issue14817] pkgutil.extend_path has no tests In-Reply-To: <1337109540.72.0.0262382182113.issue14817@psf.upfronthosting.co.za> Message-ID: <1555557291.94.0.1560240079.issue14817@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12795 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 23:16:13 2019 From: report at bugs.python.org (Windson Yang) Date: Thu, 18 Apr 2019 03:16:13 +0000 Subject: [issue14817] pkgutil.extend_path has no tests In-Reply-To: <1337109540.72.0.0262382182113.issue14817@psf.upfronthosting.co.za> Message-ID: <1555557373.12.0.441678376123.issue14817@roundup.psfhosted.org> Windson Yang added the comment: I added some tests in the PR. Actually, there are some tests for extend_path already (see https://github.com/python/cpython/blob/master/Lib/test/test_pkgutil.py#L235). However, I didn't test every line of the code in the extend_path function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 23:21:12 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 03:21:12 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555557672.57.0.0441346589576.issue36646@roundup.psfhosted.org> Steve Dower added the comment: This is weird. Are you able to tell us anything about how L: is mounted or what it's pointing at? Do you know if it's SMB or similar, or if there are symlinks or similar? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 23:43:56 2019 From: report at bugs.python.org (Windson Yang) Date: Thu, 18 Apr 2019 03:43:56 +0000 Subject: [issue36654] Add example to tokenize.tokenize Message-ID: <1555559036.7.0.0522143852215.issue36654@roundup.psfhosted.org> New submission from Windson Yang : > The tokenize() generator requires one argument, readline, which must be a callable object which provides the same interface as the io.IOBase.readline() method of file objects. Each call to the function should return one line of input as bytes. Add an example like this should be easier to understand: # example.py def foo: pass # tokenize_example.py import tokenize f = open('example.py', 'rb') token_gen = tokenize.tokenize(f.readline) for token in token_gen: # Something like this # TokenInfo(type=1 (NAME), string='class', start=(1, 0), end=(1, 5), line='class Foo:\n') # TokenInfo(type=1 (NAME), string='Foo', start=(1, 6), end=(1, 9), line='class Foo:\n') # TokenInfo(type=53 (OP), string=':', start=(1, 9), end=(1, 10), line='class Foo:\n') print(token) ---------- assignee: docs at python components: Documentation messages: 340467 nosy: Windson Yang, docs at python priority: normal severity: normal status: open title: Add example to tokenize.tokenize type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 17 23:58:46 2019 From: report at bugs.python.org (Dave Nguyen) Date: Thu, 18 Apr 2019 03:58:46 +0000 Subject: [issue36277] pdb's recursive debug command is not listed in the docs In-Reply-To: <1552441297.14.0.332408963845.issue36277@roundup.psfhosted.org> Message-ID: <1555559926.62.0.245752337373.issue36277@roundup.psfhosted.org> Change by Dave Nguyen : ---------- keywords: +patch pull_requests: +12796 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 01:07:53 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 18 Apr 2019 05:07:53 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1555564073.21.0.638159243987.issue35866@roundup.psfhosted.org> Gregory P. Smith added the comment: > "the single-threaded ProcessPoolExecutor test program" I doubt it is single threaded, the .submit() method appears to spawn a thread internally. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 02:08:30 2019 From: report at bugs.python.org (Utkarsh Gupta) Date: Thu, 18 Apr 2019 06:08:30 +0000 Subject: [issue35297] untokenize documentation is not correct In-Reply-To: <1542921902.22.0.788709270274.issue35297@psf.upfronthosting.co.za> Message-ID: <1555567710.86.0.174889801884.issue35297@roundup.psfhosted.org> Utkarsh Gupta added the comment: I am not sure if that's a documentation problem, is it? If so, I'll be happy to send a PR :) ---------- nosy: +utkarsh2102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 02:10:58 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 18 Apr 2019 06:10:58 +0000 Subject: [issue36652] Non-embedded zip distribution In-Reply-To: <1555534067.61.0.67923116935.issue36652@roundup.psfhosted.org> Message-ID: <1555567858.33.0.47737619999.issue36652@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 02:18:25 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 18 Apr 2019 06:18:25 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555568305.41.0.128602520829.issue36651@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +asyncio nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 02:24:25 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 18 Apr 2019 06:24:25 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555568665.52.0.430830282977.issue36645@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 03:07:26 2019 From: report at bugs.python.org (Utkarsh Gupta) Date: Thu, 18 Apr 2019 07:07:26 +0000 Subject: [issue36008] [good first issue] Update documentation for 3.8 In-Reply-To: <1550278435.56.0.94881175235.issue36008@roundup.psfhosted.org> Message-ID: <1555571246.68.0.107190154105.issue36008@roundup.psfhosted.org> Utkarsh Gupta added the comment: Hey, I am a new contributor, looking for an issue to start with. Since this is a "good first issue", I wanted to know if I could take it? I am myself at a dev sprint and would like to get it fixed :) Mariatta, let me know if you have any problems with the same? ---------- nosy: +utkarsh2102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 04:25:15 2019 From: report at bugs.python.org (kulopo) Date: Thu, 18 Apr 2019 08:25:15 +0000 Subject: [issue36655] Division Precision Problem Message-ID: <1555575915.63.0.127590822512.issue36655@roundup.psfhosted.org> New submission from kulopo : >>> a=224847175712806907706081280 >>> b=4294967296 >>> assert int(a*b/b)==int(a) Traceback (most recent call last): File "", line 1, in AssertionError (a can be exact divided by b) ---------- messages: 340471 nosy: kulopo priority: normal severity: normal status: open title: Division Precision Problem type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 04:30:33 2019 From: report at bugs.python.org (Christian Heimes) Date: Thu, 18 Apr 2019 08:30:33 +0000 Subject: [issue36655] Division Precision Problem In-Reply-To: <1555575915.63.0.127590822512.issue36655@roundup.psfhosted.org> Message-ID: <1555576233.66.0.33390944933.issue36655@roundup.psfhosted.org> Christian Heimes added the comment: This is the expected and correct behavior. Python's float are IEEE 754 floats, https://en.wikipedia.org/wiki/IEEE_754. IEE 754 have a limited precision. 224847175712806907706081280 / 4294967296 is not exactly dividable under IEEE 754 semantics. >>> a=224847175712806907706081280 >>> b=4294967296 >>> a/b 5.235131264496755e+16 ---------- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 04:32:19 2019 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 18 Apr 2019 08:32:19 +0000 Subject: [issue36655] Division Precision Problem In-Reply-To: <1555575915.63.0.127590822512.issue36655@roundup.psfhosted.org> Message-ID: <1555576339.96.0.939059405943.issue36655@roundup.psfhosted.org> Eric V. Smith added the comment: Also see https://docs.python.org/3/tutorial/floatingpoint.html for some Python-specific details. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 04:44:47 2019 From: report at bugs.python.org (Tom Hale) Date: Thu, 18 Apr 2019 08:44:47 +0000 Subject: [issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions Message-ID: <1555577087.92.0.769196427693.issue36656@roundup.psfhosted.org> New submission from Tom Hale : I cannot find a race-condition-free way to force overwrite an existing symlink. os.symlink() requires that the target does not exist, meaning that it could be created via race condition the two workaround solutions that I've seen: 1. Unlink existing symlink (could be recreated, causing following symlink to fail) 2. Create a new temporary symlink, then overwrite target (temp could be changed between creation and replace. The additional gotcha with the safer (because the attack filename is unknown) option (2) is that replace() may fail if the two files are on separate filesystems. I suggest an additional `force=` argument to os.symlink(), defaulting to `False` for backward compatibility, but allowing atomic overwriting of a symlink when set to `True`. I would be willing to look into a PR for this. Prior art: https://stackoverflow.com/a/55742015/5353461 ---------- messages: 340474 nosy: Tom Hale priority: normal severity: normal status: open title: Allow os.symlink(src, target, force=True) to prevent race conditions versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 05:20:09 2019 From: report at bugs.python.org (Antony Lee) Date: Thu, 18 Apr 2019 09:20:09 +0000 Subject: [issue36277] pdb's recursive debug command is not listed in the docs In-Reply-To: <1552441297.14.0.332408963845.issue36277@roundup.psfhosted.org> Message-ID: <1555579209.35.0.0224456417164.issue36277@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 05:24:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 09:24:13 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555579453.02.0.0617837351766.issue36648@roundup.psfhosted.org> STINNER Victor added the comment: What is the current behavior of m = mmap.mmap(-1, 100)? Does it raise an exception? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 05:27:04 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 09:27:04 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555579624.17.0.0221242534411.issue36648@roundup.psfhosted.org> STINNER Victor added the comment: I don't understand why PR 12394 modifies flags afterwards, whereas "m = mmap.mmap(-1, 100)" doesn't specify explicitly flags. So the bug looks to be default flags set by Python, no? int flags = MAP_SHARED; ... if (!PyArg_ParseTupleAndKeywords(args, kwdict, "in|iii" _Py_PARSE_OFF_T, keywords, &fd, &map_size, &flags, &prot, &access, &offset)) Is MAP_SHARED constant available in C on VxWorks? Is mmap.MAP_SHARED constant available in Python on VxWorks? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 05:37:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 09:37:35 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1555580255.89.0.613985958447.issue36635@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 23bace26ec265557697cf3b578b361c178070cd5 by Victor Stinner in branch 'master': bpo-36635: Add _testinternalcapi module (GH-12841) https://github.com/python/cpython/commit/23bace26ec265557697cf3b578b361c178070cd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 05:43:48 2019 From: report at bugs.python.org (Saba Kauser) Date: Thu, 18 Apr 2019 09:43:48 +0000 Subject: [issue36640] python ibm_db setup.py post install script does not seem to work from Anaconda In-Reply-To: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> Message-ID: <1555580628.48.0.818478854745.issue36640@roundup.psfhosted.org> Saba Kauser added the comment: I was able to determine the reason. When running through anaconda, the pip copies ibm_db.so to site-packages path. However, as logged in user, install_name_tool fails with permission denied error. BLR-D-MACOS03:site-packages skauser$ install_name_tool -change @loader_path/clidriver/lib/libdb2.dylib libdb2.dylib ibm_db.cpython-37m-darwin.so error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: can't open input file: ibm_db.cpython-37m-darwin.so for writing (Permission denied) error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: can't lseek to offset: 0 in file: ibm_db.cpython-37m-darwin.so for writing (Bad file descriptor) error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: can't write new headers in file: ibm_db.cpython-37m-darwin.so (Bad file descriptor) error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: can't close written on input file: ibm_db.cpython-37m-darwin.so (Bad file descriptor) BLR-D-MACOS03:site-packages skauser$ sudo install_name_tool -change @loader_path/clidriver/lib/libdb2.dylib libdb2.dylib ibm_db.cpython-37m-darwin.so Even if i do "sudo pip install ibm_db", although the package is copied to site-packages, install_name_tool fails with error. However, if build the source via pip as : cd /Users/skauser/python-ibmdb/IBM_DB/ibm_db sudo pip install . install_name_tool is able to execute on ibm_db*.so. Do you have any idea why would the permission problem occur only if I do pip install from pypi and not from source? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 06:02:42 2019 From: report at bugs.python.org (andrew-g) Date: Thu, 18 Apr 2019 10:02:42 +0000 Subject: [issue35100] urllib.parse.unquote_to_bytes: needs "escape plus" option In-Reply-To: <1540785354.09.0.788709270274.issue35100@psf.upfronthosting.co.za> Message-ID: <1555581762.63.0.323373081859.issue35100@roundup.psfhosted.org> andrew-g added the comment: pinging the issue to try get the PR reviewed ---------- nosy: +andrew-g _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 06:10:19 2019 From: report at bugs.python.org (LihuaZhao) Date: Thu, 18 Apr 2019 10:10:19 +0000 Subject: [issue36648] MAP_SHARED isn't proper for anonymous mappings for VxWorks In-Reply-To: <1555516421.89.0.141629661161.issue36648@roundup.psfhosted.org> Message-ID: <1555582219.36.0.0318942357966.issue36648@roundup.psfhosted.org> LihuaZhao added the comment: >>What is the current behavior of m = mmap.mmap(-1, 100)? Does it raise an exception? No, the following statement will return -1 without PR 12394 m_obj->data = mmap(NULL, map_size, prot, flags, fd, offset); >>I don't understand why PR 12394 modifies flags afterwards, whereas "m = mmap.mmap(-1, 100)" doesn't specify explicitly flags. So the bug looks to be default flags set by Python, no? Yes, this statement doesn't specify the flag, but as you said, the new_mmap_object() firstly set MAP_SHARED for flag, and in later code: if (fd == -1) { m_obj->fd = -1; ..... #ifdef MAP_ANONYMOUS /* BSD way to map anonymous memory */ flags |= MAP_ANONYMOUS; #else #endif This routine will pass (MAP_ANONYMOUS | MAP_SHARED) to mmap and fd is -1, this is true for Linux, but for VxWorks, if fd is -1, the flag type should be (MAP_ANONYMOUS | MAP_PRIVATE), and this behavior is not part of the POSIX standard, we can't say VxWorks isn't right. So my changes clear MAP_SHARED and set MAP_PRIVATE when the system type is VxWorks. >>Is MAP_SHARED constant available in C on VxWorks? Yes, but for MAP_ANONYMOUS, it require set MAP_PRIVATE. This PR still is try to enhance VxWorks support, doesn't affect Python user, and only change the behavior of VxWorks, other system don't have this issue, and also won't be influenced ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 07:24:55 2019 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 18 Apr 2019 11:24:55 +0000 Subject: [issue36652] Non-embedded zip distribution In-Reply-To: <1555534067.61.0.67923116935.issue36652@roundup.psfhosted.org> Message-ID: <1555586695.07.0.880198021614.issue36652@roundup.psfhosted.org> Ronald Oussoren added the comment: This is a duplicate of issue36010, which contains an explanation of why there is no installation method with a zipfile. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 08:43:18 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 18 Apr 2019 12:43:18 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555591398.75.0.970718373633.issue36651@roundup.psfhosted.org> miss-islington added the comment: New changeset 7e954e7de4f3777b5ce239640bd2b76aced09561 by Miss Islington (bot) (Enrico Alarico Carbognani) in branch 'master': bpo-36651: Fixed Asyncio Event Loop documentation inconsistency (GH-12866) https://github.com/python/cpython/commit/7e954e7de4f3777b5ce239640bd2b76aced09561 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 08:43:34 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 18 Apr 2019 12:43:34 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555591414.15.0.0247376208105.issue36651@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12798 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 08:44:36 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 18 Apr 2019 12:44:36 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555591476.59.0.1559847899.issue36651@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 08:49:28 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 18 Apr 2019 12:49:28 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555591768.23.0.637233320563.issue36651@roundup.psfhosted.org> miss-islington added the comment: New changeset d29b3dd9227cfc4a23f77e99d62e20e063272de1 by Miss Islington (bot) in branch '3.7': bpo-36651: Fixed Asyncio Event Loop documentation inconsistency (GH-12866) https://github.com/python/cpython/commit/d29b3dd9227cfc4a23f77e99d62e20e063272de1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 08:54:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 12:54:13 +0000 Subject: [issue35755] On Unix, shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1555592053.37.0.381995398849.issue35755@roundup.psfhosted.org> STINNER Victor added the comment: > For Python 2.7... well, I don't think that this issue is important enough to justify a backport. I prefer to do nothing rather than having to deal with unhappy users complaining that Python 2.7 changed broke their application in a minor 2.7.x release :-) Even if, again, the risk of regression is very low. Same rationale for Python 3.6. While I would call this change related to security, I'm not comfortable to backport the change. The issue is not important enough compared to the risk of regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 09:17:19 2019 From: report at bugs.python.org (Eryk Sun) Date: Thu, 18 Apr 2019 13:17:19 +0000 Subject: [issue36646] os.listdir() got permission error in Python3.6 but it's fine in Python2.7 In-Reply-To: <1555462000.28.0.955431957524.issue36646@roundup.psfhosted.org> Message-ID: <1555593439.79.0.24461487774.issue36646@roundup.psfhosted.org> Eryk Sun added the comment: For me in Windows 10, os.listdir(u"C:\\Temp") uses the same sequence of WINAPI and NT system calls in 2.7 and 3.6. Setup the query for all files ("*"), and return the first matching entry: FindFirstFileW FindFirstFileExW NtOpenFile( ObjectAttributes=( ObjectName="\??\C:\Temp\", Attributes=OBJ_CASE_INSENSITIVE) DesiredAccess=( SYNCHRONIZE | FILE_LIST_DIRECTORY), ShareAccess=( FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), OpenOptions=( FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT)) NtQuerDirectoryFileEx( FileInformationClass=FileBothDirectoryInformation, QueryFlags=SL_RETURN_SINGLE_ENTRY, FileName="*") Repeat for the remaining entries: FindNextFileW Return the next entry from a 4 KiB buffer. If the buffer is empty, refill it with the following call, until the query is exhausted (i.e. STATUS_NO_MORE_FILES): NtQuerDirectoryFileEx( FileInformationClass=FileBothDirectoryInformation, Length=4096) Unfortunately, many NT status codes map to ERROR_ACCESS_DENIED (5). If it's STATUS_ACCESS_DENIED (0xC0000022), then probably NtOpenFile failed. Try checking the last NT status value with ctypes. For example: >>> import os, ctypes >>> ntdll = ctypes.WinDLL('ntdll') >>> ntdll.RtlGetLastNtStatus.restype = ctypes.c_ulong >>> try: ... os.listdir(u'C:\\Users\\Administrator') ... except: ... print(hex(ntdll.RtlGetLastNtStatus())) ... 0xc0000022 Do you have any anti-malware programs running? If so, try disabling them. They can hook APIs or attach to the I/O stack with a filter driver (e.g. to deny an I/O request that's disallowed by a rule). If disabling your anti-malware software allows access, then you'll need to set a rule to grant access to Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 09:28:53 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Thu, 18 Apr 2019 13:28:53 +0000 Subject: [issue36651] Asyncio Event Loop documentation inconsistency (call_later and call_at methods) In-Reply-To: <1555527182.24.0.96593759188.issue36651@roundup.psfhosted.org> Message-ID: <1555594133.88.0.760951034019.issue36651@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 09:36:29 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 13:36:29 +0000 Subject: [issue36652] Non-embedded zip distribution In-Reply-To: <1555534067.61.0.67923116935.issue36652@roundup.psfhosted.org> Message-ID: <1555594589.64.0.134347869949.issue36652@roundup.psfhosted.org> Steve Dower added the comment: Also see the packages on nuget.org, which are essentially just zip files (with metadata and installation tools available). ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Please provide a .zip Windows release of Python that is not crippled/for embedding only _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:05:03 2019 From: report at bugs.python.org (Read Hughes) Date: Thu, 18 Apr 2019 14:05:03 +0000 Subject: [issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file In-Reply-To: <1554948440.07.0.28828566641.issue36596@roundup.psfhosted.org> Message-ID: <1555596303.24.0.250252977145.issue36596@roundup.psfhosted.org> Read Hughes added the comment: GNU description of tar file format: http://www.gnu.org/software/tar/manual/html_node/Standard.html Particular quotes that are relevant: >Physically, an archive consists of a series of file entries terminated by an end-of-archive entry, which consists of two 512 blocks of zero bytes >Each file archived is represented by a header block which describes the file, followed by zero or more blocks which give the contents of the file. At the end of the archive file there are two 512-byte blocks filled with binary zeros as an end-of-file marker The header itself is 257 bytes padded with NUL until it reaches 512. No input other than this, just trying to bring any relevant information to this issue that may help ---------- nosy: +rthugh02 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:12:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 14:12:14 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1555596734.36.0.840329508394.issue28552@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12799 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:12:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 14:12:14 +0000 Subject: [issue7774] sys.executable: wrong location if zeroth command argument is modified. In-Reply-To: <1264375402.09.0.657503917056.issue7774@psf.upfronthosting.co.za> Message-ID: <1555596734.46.0.786457624898.issue7774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:13:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 14:13:39 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1555596819.38.0.397206182.issue28552@roundup.psfhosted.org> STINNER Victor added the comment: This issue can be reproduced with: diff --git a/Lib/site.py b/Lib/site.py index ad1146332b..c850109c19 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -638,3 +638,5 @@ def _script(): if __name__ == '__main__': _script() + +sys.executable = None Attached PR 12875 fix distutils.sysconfig and the distutils build command if sys.executable is None or an empty string. I don't expect that everything works magically, but at least, it's possible to run "./python -m distutils.sysconfig" and use "make" in Python which runs "./python -E ./setup.py build". I'm surprised, but setup.py is able to build C extensions using sys.executable = None :-) I made a similar fix for sysconfig in bpo-7774: commit 171ba0504aa778d81346ea56fc9000b29d4d3e1d. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:42:24 2019 From: report at bugs.python.org (maak) Date: Thu, 18 Apr 2019 14:42:24 +0000 Subject: [issue36657] AttributeError Message-ID: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> New submission from maak : elif path == '' or path.endswith('/'): AttributeError: 'bool' object has no attribute 'endswith' ---------- assignee: docs at python components: Documentation messages: 340490 nosy: docs at python, maakvol priority: normal severity: normal status: open title: AttributeError type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:46:00 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 18 Apr 2019 14:46:00 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555598760.63.0.497675647831.issue36657@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Please add a short script and explain the problem over why it's a bug in CPython and not a problem with the program. The error says path has a boolean value and doesn't have endswith which is a method on string object. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:49:22 2019 From: report at bugs.python.org (Nils Goroll) Date: Thu, 18 Apr 2019 14:49:22 +0000 Subject: [issue31652] make install fails: no module _ctypes In-Reply-To: <1506812661.87.0.213398074469.issue31652@psf.upfronthosting.co.za> Message-ID: <1555598962.74.0.955355461764.issue31652@roundup.psfhosted.org> Nils Goroll added the comment: In case this helps: I noticed this during the build: *** WARNING: renaming "_ssl" since importing it failed: ld.so.1: python: fatal: libssl.so.1.1: open failed: No such file or directory *** WARNING: renaming "_hashlib" since importing it failed: ld.so.1: python: fatal: libssl.so.1.1: open failed: No such file or directory *** WARNING: renaming "_ctypes" since importing it failed: ld.so.1: python: fatal: libffi.so.6: open failed: No such file or directory ... Following modules built successfully but were removed because they could not be imported: _ctypes _hashlib _ssl In my case the reason was that libffi was installed under /opt/local, so the fix was: ./configure LDFLAGS='-L/opt/local/lib -R/opt/local/lib' and rebuild For other users I would recommend to inspect the build output for _ctypes related errors, I am not saying that the cause is the same ---------- nosy: +slink _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:50:15 2019 From: report at bugs.python.org (maak) Date: Thu, 18 Apr 2019 14:50:15 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555599015.06.0.254107685866.issue36657@roundup.psfhosted.org> maak added the comment: File "/home/maak/PycharmProjects/Fyp/venv/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 132, in main bestmodel_dir = os.path.join(FLAGS.train_dir, "best_checkpoint") File "/home/maak/PycharmProjects/Fyp/venv/lib/python2.7/posixpath.py", line 70, in join elif path == '' or path.endswith('/'): AttributeError: 'bool' object has no attribute 'endswith' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:57:16 2019 From: report at bugs.python.org (RimacV) Date: Thu, 18 Apr 2019 14:57:16 +0000 Subject: [issue36658] Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory Message-ID: <1555599436.89.0.215369051789.issue36658@roundup.psfhosted.org> New submission from RimacV : I compiled the source of CPython 3.7.3 myself on Windows with Visual Studio 2017 together with some packages like e.g numpy. When I start the Python Interpreter I am able to import and use numpy. However when I am running the same script via the C-API I get an ModuleNotFoundError. So the first thing I did, was to check if numpy is in my site-packages directory and indeed there is a folder named numpy-1.16.2-py3.7-win-amd64.egg. (Makes sense because the python interpreter can find numpy) The next thing I did was get some information about the sys.path variable created when running the script via the C-API. ##### sys.path content #### C:\Work\build\product\python37.zip C:\Work\build\product\DLLs C:\Work\build\product\lib C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\PROFESSIONAL\COMMON7\IDE\EXTENSIONS\TESTPLATFORM C:\Users\rvq\AppData\Roaming\Python\Python37\site-packages Examining the content of sys.path I noticed two things. 1. C:\Work\build\product\python37.zip has the correct path 'C:\Work\build\product\'. There was just no zip file. All my files and directory were unpacked. So I zipped the files to an archive named python37.zip and this resolved the import error. 2. C:\Users\rvq\AppData\Roaming\Python\Python37\site-packages is wrong it should be C:\Work\build\product\Lib\site-packages but I dont know how this wrong path is created. The next thing I tried was to use Py_SetPath(L"C:/Work/build/product/Lib/site-packages") before calling Py_Initialize(). This led to the Fatal Python Error 'unable to load the file system encoding' ModuleNotFoundError: No module named 'encodings' I created a minimal c++ project with exact these two calls and started to debug Cpython. int main() { Py_SetPath(L"C:/Work/build/product/Lib/site-packages"); Py_Initialize(); } I tracked the call of Py_Initialize() down to the call of static int zipimport_zipimporter___init___impl(ZipImporter *self, PyObject *path) inside of zipimport.c The comment above this function states the following: Create a new zipimporter instance. 'archivepath' must be a path-like object to a zipfile, or to a specific path inside a zipfile. For example, it can be '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a valid directory inside the archive. 'ZipImportError' is raised if 'archivepath' doesn't point to a valid Zip archive. The 'archive' attribute of the zipimporter object contains the name of the zipfile targeted. So for me it seems that the C-API expects the path set with Py_SetPath to be a path to a zipfile. Is this expected behaviour or is it a bug? If it is not a bug is there a way to changes this so that it can also detect directories? PS: The ModuleNotFoundError did not occur for me when using Python 3.5.2+, which was the version I used in my project before. I also checked if I had set any PYTHONHOME or PYTHONPATH environment variables but I did not see one of them on my system. ---------- components: Library (Lib) files: Capture.PNG messages: 340494 nosy: rvq priority: normal severity: normal status: open title: Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file48274/Capture.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 10:59:22 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 18 Apr 2019 14:59:22 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555599562.36.0.398222757912.issue36657@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Please check the value of FLAGS.train_dir which I guess has a boolean value. This is not a bug with CPython. $ python2 Python 2.7.14 (default, Mar 12 2018, 13:54:56) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.path.join(True, 'best_checkpoint') Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python at 2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 70, in join elif path == '' or path.endswith('/'): AttributeError: 'bool' object has no attribute 'endswith' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:02:16 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 15:02:16 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath Message-ID: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> New submission from STINNER Victor : Since 2010, the Fedora packages of Python are using a patch on distutils UnixCCompiler to remove standard library path from rpath. The patch has been written by David Malcolm for Python 2.6.4: * https://src.fedoraproject.org/rpms/python38/blob/master/f/00001-rpath.patch * https://src.fedoraproject.org/rpms/python2/c/f5df1f834310948b32407933e3b8713e1121105b I propose to make this change upstream so other Linux distributions will benefit on this change: see attached PR. "rpath" stands for "run-time search path". Dynamic linking loaders use the rpath to find required libraries: https://en.wikipedia.org/wiki/Rpath Full example. Install Python in /opt/py38 with RPATH=/opt/py38/lib, to ensure that Python looks for libpython in this directory: $ cd path/to/python/sources $ ./configure --prefix /opt/py38 LDFLAGS="-Wl,-rpath=/opt/py38/lib/" --enable-shared $ make $ make install # on my system, my user can write into /opt ;-) $ objdump -a -x /opt/py38/bin/python3.8|grep -i rpath RPATH /opt/py38/lib/ $ objdump -a -x /opt/py38/lib/libpython3.8m.so|grep -i rpath RPATH /opt/py38/lib/ Python is installed with RPATH: $ /opt/py38/bin/python3.8 -m sysconfig|grep -i rpath BLDSHARED = "gcc -pthread -shared -Wl,-rpath=/opt/py38/lib/" CONFIGURE_LDFLAGS = "-Wl,-rpath=/opt/py38/lib/" CONFIG_ARGS = "'--prefix' '/opt/py38' 'LDFLAGS=-Wl,-rpath=/opt/py38/lib/' '--enable-shared'" LDFLAGS = "-Wl,-rpath=/opt/py38/lib/" LDSHARED = "gcc -pthread -shared -Wl,-rpath=/opt/py38/lib/" PY_CORE_LDFLAGS = "-Wl,-rpath=/opt/py38/lib/" PY_LDFLAGS = "-Wl,-rpath=/opt/py38/lib/" Now the difference is how these flags are passed to third party C extensions. $ cd $HOME $ /opt/py38/bin/python3.8 -m venv opt_env $ opt_env/bin/python -m pip install lxml $ objdump -a -x $(opt_env/bin/python -c 'import lxml.etree; print(lxml.etree.__file__)')|grep -i rpath RPATH /opt/py38/lib/ lxml is compiled with the RPATH. This issue proposes to omit the Python RPATH here. Comparison with Fedora Python which already contains the change: $ python3 -m venv fed_venv # FYI: it's Python 3.7 on Fedora 29 $ fed_venv/bin/python -m pip install lxml $ objdump -a -x $(fed_venv/bin/python -c 'import lxml.etree; print(lxml.etree.__file__)')|grep -i rpath ^^ empty output: no RPATH, it's the expected behavior ... I'm not sure that the example using /usr/bin/python3.7 is useful, because it's not built using RPATH ... $ objdump -a -x /usr/bin/python3.7 |grep -i rpath $ python3.7 -m sysconfig|grep -i rpath $ objdump -a -x /usr/lib64/libpython3.7m.so |grep -i rpath ^^ no output, it's not built with RPATH ---------- components: Library (Lib) messages: 340496 nosy: vstinner priority: normal severity: normal status: open title: distutils UnixCCompiler: Remove standard library path from rpath versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:09:00 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 15:09:00 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1555600140.65.0.20672603634.issue36659@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12801 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:09:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 15:09:21 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1555600161.91.0.709866046576.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: Output with attached PR 12876: $ /opt/py38/bin/python3.8 -m venv opt_env $ opt_env/bin/python -m pip install lxml $ objdump -a -x $(opt_env/bin/python -c 'import lxml.etree; print(lxml.etree.__file__)')|grep -i rpath RPATH /opt/py38/lib/ ... Oops, the RPATH is still here. Maybe I misunderstood the purpose of the change :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:12:43 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Thu, 18 Apr 2019 15:12:43 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555599562.36.0.398222757912.issue36657@roundup.psfhosted.org> Message-ID: <20190418151239.wpahm4flhw44zeao@xps> St?phane Wirtel added the comment: Hi Karthikeyan, I think we could close this issue, it's not related to CPython itself. What do you think? ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:14:52 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 18 Apr 2019 15:14:52 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555600492.86.0.509435785489.issue36657@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > I think we could close this issue, it's not related to CPython itself. Closing it. OP can reopen if needed. Thanks. ---------- assignee: docs at python -> resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:20:25 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Thu, 18 Apr 2019 15:20:25 +0000 Subject: [issue36658] Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory In-Reply-To: <1555599436.89.0.215369051789.issue36658@roundup.psfhosted.org> Message-ID: <1555600825.27.0.960247110582.issue36658@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- components: +Windows -Library (Lib) nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:27:26 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 15:27:26 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1555601246.2.0.0847643508678.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: My colleague Miro Hron?ok points me to: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_beware_of_rpath "Any rpath flagged by check-rpaths MUST be removed." Note: On Linux, "chrpath" tool can be used to read, modify or remove the RPATH of an ELF binary (program or dynamic library). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:30:37 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 15:30:37 +0000 Subject: [issue36658] Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory In-Reply-To: <1555599436.89.0.215369051789.issue36658@roundup.psfhosted.org> Message-ID: <1555601437.94.0.632313397619.issue36658@roundup.psfhosted.org> Steve Dower added the comment: This is probably a documentation failure more than anything else. We're in the middle of redesigning initialization though, so it's good timing to contribute this feedback. The short answer is that you need to make sure Python can find the Lib/encodings directory, typically by putting the standard library in sys.path. Py_SetPath clears all inferred paths, so you need to specify all the places Python should look. (The rules for where Python looks automatically are complicated and vary by platform, which is something I'm keen to fix.) Paths that don't exist are okay, and that's the zip file. You can choose to put the stdlib into a zip, and it will be found automatically if you name it the default path, but you can also leave it unzipped and reference the directory. A full walk through on embedding is more than I'm prepared to type on my phone. Hopefully that's enough to get you going for now. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:39:00 2019 From: report at bugs.python.org (maak) Date: Thu, 18 Apr 2019 15:39:00 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555601940.43.0.26679751316.issue36657@roundup.psfhosted.org> maak added the comment: FLAGS.train_dir has a boolean value which is checking true or false and i also have same issue import os >>> os.path.join(True, 'best_checkpoint') Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python at 2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 70, in join elif path == '' or path.endswith('/'): AttributeError: 'bool' object has no attribute 'endswith' can you give me a solution or idea how to solve issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:39:11 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 15:39:11 +0000 Subject: [issue36649] Windows Store app install registry keys have incorrect paths In-Reply-To: <1555525848.37.0.287329960957.issue36649@roundup.psfhosted.org> Message-ID: <1555601951.91.0.533857587274.issue36649@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:50:26 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 18 Apr 2019 15:50:26 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555602626.14.0.0761051096761.issue36657@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi Maakvol, Please remember that this is a bug tracker for bugs in the Python language and standard library, not a help desk. As a beginner, 99.9% of the times you think that you have found a bug in Python, you haven't, it will be a bug in your own code. There are many forums where you can ask for help with your code, such as the tutor mailing list https://mail.python.org/mailman/listinfo/tutor Stackoverflow, Reddit's /r/learnpython, and more. You should check with other, more experienced programmers before reporting things as bugs. Thank you. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:55:57 2019 From: report at bugs.python.org (maak) Date: Thu, 18 Apr 2019 15:55:57 +0000 Subject: [issue36660] TypeError Message-ID: <1555602957.9.0.785158362438.issue36660@roundup.psfhosted.org> New submission from maak : TypeError: coercing to Unicode: need string or buffer, bool found ---------- components: Unicode messages: 340504 nosy: ezio.melotti, maakvol, vstinner priority: normal severity: normal status: open title: TypeError type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 11:58:28 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 15:58:28 +0000 Subject: [issue36660] TypeError In-Reply-To: <1555602957.9.0.785158362438.issue36660@roundup.psfhosted.org> Message-ID: <1555603108.66.0.966650418377.issue36660@roundup.psfhosted.org> STINNER Victor added the comment: Sorry maak, but the Python bug tracker is not the right place to ask questions about Python programming. It seems like you are learning Python. Try to find another place like StackOverflow, python-list mailing list, etc. Thanks ;-) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 12:00:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 16:00:50 +0000 Subject: [issue36657] AttributeError In-Reply-To: <1555598544.39.0.0302839002466.issue36657@roundup.psfhosted.org> Message-ID: <1555603250.34.0.0243508171832.issue36657@roundup.psfhosted.org> STINNER Victor added the comment: ... maak opened a second issue... bpo-36660. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 12:00:50 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 18 Apr 2019 16:00:50 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555603250.62.0.893136366883.issue33608@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +12802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 12:01:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 16:01:20 +0000 Subject: [issue36660] TypeError In-Reply-To: <1555602957.9.0.785158362438.issue36660@roundup.psfhosted.org> Message-ID: <1555603280.55.0.991099564744.issue36660@roundup.psfhosted.org> STINNER Victor added the comment: Note: maak opened a similar issue that has also closed as "not a bug": bpo-36657. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 12:02:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 18 Apr 2019 16:02:57 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1555603377.47.0.372532517765.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: Another test, without my PR 12876. Python compiled without RPATH: $ ./configure --prefix=/opt/py38 $ make $ make install $ /opt/py38/bin/python3.8 -m sysconfig|grep LIBDIR LIBDIR = "/opt/py38/lib" Build lxml manually using "setup.py build_ext --rpath /opt/py38/lib" (which is equal to the Python sysconfig LIBDIR variable): $ /opt/py38/bin/python3.8 -m venv ~/opt_env $ wget https://files.pythonhosted.org/packages/7d/29/174d70f303016c58bd790c6c86e6e86a9d18239fac314d55a9b7be501943/lxml-4.3.3.tar.gz $ tar -xf lxml-4.3.3.tar.gz $ cd lxml-4.3.3/ $ LD_LIBRARY_PATH=/opt/py38/lib ~/opt_env/bin/python setup.py build_ext --rpath /opt/py38/lib $ objdump -a -x build/lib.linux-x86_64-3.8/lxml/etree.cpython-38m-x86_64-linux-gnu.so|grep -i rpath ^^ no output, no RPATH Hum, distutils removed the RPATH because it's equal to Python sysconfig LIBDIR? Without my PR? Strange. New try with a different RPATH: $ rm -rf build $ ~/opt_env/bin/python setup.py build_ext --rpath /custom/rpath $ objdump -a -x build/lib.linux-x86_64-3.8/lxml/etree.cpython-38m-x86_64-linux-gnu.so|grep -i rpath RUNPATH /custom/rpath The RPATH is correctly written in the .so file. ... Now, I'm confused. Is PR 12876 useless? Was distutils already fixed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 13:05:26 2019 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 18 Apr 2019 17:05:26 +0000 Subject: [issue30485] Element.findall(path, dict) doesn't insert null namespace In-Reply-To: <1495803428.74.0.976679303383.issue30485@psf.upfronthosting.co.za> Message-ID: <1555607126.23.0.630499663999.issue30485@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset e8113f51a8bdf33188ee30a1c038a298329e7bfa by Stefan Behnel in branch 'master': bpo-30485: Change the prefix for defining the default namespace in ElementPath from None to '' since there is existing code that uses that and it's more convenient to have an all-string-keys dict (e.g. when sorting items etc.). (#12860) https://github.com/python/cpython/commit/e8113f51a8bdf33188ee30a1c038a298329e7bfa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 13:25:26 2019 From: report at bugs.python.org (Brett Cannon) Date: Thu, 18 Apr 2019 17:25:26 +0000 Subject: [issue32913] Improve regular expression HOWTO In-Reply-To: <1519330200.78.0.467229070634.issue32913@psf.upfronthosting.co.za> Message-ID: <1555608326.64.0.142498698724.issue32913@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 15:36:48 2019 From: report at bugs.python.org (Merlin Fisher-Levine) Date: Thu, 18 Apr 2019 19:36:48 +0000 Subject: [issue36661] Missing import in docs Message-ID: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> New submission from Merlin Fisher-Levine : Dataclasses docs don't mention needing import for @dataclass decorator https://docs.python.org/3/library/dataclasses.html ---------- assignee: docs at python components: Documentation messages: 340510 nosy: docs at python, mfisherlevine priority: normal severity: normal status: open title: Missing import in docs type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 16:31:10 2019 From: report at bugs.python.org (George Sakkis) Date: Thu, 18 Apr 2019 20:31:10 +0000 Subject: [issue36662] asdict/astuple Dataclass methods Message-ID: <1555619470.94.0.171933894359.issue36662@roundup.psfhosted.org> New submission from George Sakkis : I'd like to propose two new optional boolean parameters to the @dataclass() decorator, `asdict` and `astuple`, that if true, the respective methods are generated as equivalent to the module-level namesake functions. In addition to saving an extra imported name, the main benefit is performance. By having access to the specific fields of the decorated class, it should be possible to generate a more efficient implementation than the one in the respective function. To illustrate the difference in performance, the asdict method is 28 times faster than the function in the following PEP 557 example: @dataclass class InventoryItem: '''Class for keeping track of an item in inventory.''' name: str unit_price: float quantity_on_hand: int = 0 def asdict(self): return { 'name': self.name, 'unit_price': self.unit_price, 'quantity_on_hand': self.quantity_on_hand, } In [4]: i = InventoryItem(name='widget', unit_price=3.0, quantity_on_hand=10) In [5]: asdict(i) == i.asdict() Out[5]: True In [6]: %timeit asdict(i) 5.45 ?s ? 14.1 ns per loop (mean ? std. dev. of 7 runs, 100000 loops each) In [7]: %timeit i.asdict() 193 ns ? 0.443 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) Thoughts? ---------- components: Library (Lib) messages: 340511 nosy: gsakkis priority: normal severity: normal status: open title: asdict/astuple Dataclass methods type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 16:50:11 2019 From: report at bugs.python.org (daniel hahler) Date: Thu, 18 Apr 2019 20:50:11 +0000 Subject: [issue36663] pdb: store whole exception information in locals (via user_exception) Message-ID: <1555620611.54.0.476670185148.issue36663@roundup.psfhosted.org> New submission from daniel hahler : Currently Pdb.user_exception does not store the traceback in "user_exception", but only passes it to `interaction`: def user_exception(self, frame, exc_info): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" if self._wait_for_mainpyfile: return exc_type, exc_value, exc_traceback = exc_info frame.f_locals['__exception__'] = exc_type, exc_value ? self.interaction(frame, exc_traceback) I think it would be useful to have the whole exception info at hand in the debugger (via the frame locals) directly. If backward compatible is important it should use a new name for this maybe (`__excinfo__`), i.e. if current code would assume `__exception__` to be of length 2 only. But on the other hand this only affects extensions to the debugger, and not "real" programs, and therefore backward compatibility is not really required here? Currenly pdb extensions (e.g. pdbpp) can get it either by going up in the stack, or grabbing it via `interaction`, but this issue is mainly about making it available in plain pdb for the user to interact with. Code ref: https://github.com/python/cpython/blob/e8113f51a8bdf33188ee30a1c038a298329e7bfa/Lib/pdb.py#L295-L301 ---------- components: Library (Lib) messages: 340512 nosy: blueyed priority: normal severity: normal status: open title: pdb: store whole exception information in locals (via user_exception) versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 17:01:59 2019 From: report at bugs.python.org (Alexander Riccio) Date: Thu, 18 Apr 2019 21:01:59 +0000 Subject: [issue25878] CPython on Windows builds with /W3, not /W4 In-Reply-To: <1450224755.83.0.682115702996.issue25878@psf.upfronthosting.co.za> Message-ID: <1555621319.71.0.560462809846.issue25878@roundup.psfhosted.org> Alexander Riccio added the comment: I decided to come back to this after a python meetup last night. By messing with this a bit, building in VS2019 with /W4, I see that fully 2/3rds of the total warnings are from two specific warnings: C4100 (unreferenced formal parameter) C4127 (conditional expression is constant) ...This seems to be a stylistic thing across the codebase. If it were a new codebase, I'd simply recommend not giving unreferenced formal parameters a variable name - the typical way of doing it - but there's no way anybody is gonna care enough to comment them out across the whole codebase. C4127 is not A Big Deal, since dispatching based on data type sizes in conditionals is just the easiest way to do The Right Thing in C. The rest of the warnings are mostly datatype coercions ('=': conversion from 'int' to 'char', possible loss of data), old style declarators, and a bunch of type indirection mismatches ('function': 'volatile int *' differs in indirection to slightly different base types from 'volatile long *'), type cast truncation ('type cast': truncation from 'volatile __int64' to 'PyThreadState *'), named type declarations in parenthesis ('timeval': named type definition in parentheses), and assignments in conditionals (which I don't like, but are not a huge deal). There really are only a few things that actually look sketchy. For example, in run_child (launcher.c), SetInformationJobObject is passing sizeof(info) as cbJobObjectInformationLength, where it should instead be the local variable rc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 17:12:34 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 18 Apr 2019 21:12:34 +0000 Subject: [issue16520] subprocess.Popen() TypeError message incorrect without args argument In-Reply-To: <1353487512.93.0.371965893186.issue16520@psf.upfronthosting.co.za> Message-ID: <1555621954.0.0.949270739751.issue16520@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 17:54:27 2019 From: report at bugs.python.org (RimacV) Date: Thu, 18 Apr 2019 21:54:27 +0000 Subject: [issue36658] Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory In-Reply-To: <1555599436.89.0.215369051789.issue36658@roundup.psfhosted.org> Message-ID: <1555624467.81.0.431228173828.issue36658@roundup.psfhosted.org> RimacV added the comment: Thanks for your quick response! I will try your suggestion on tuesday and will then let you know, if it worked as expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 18:51:16 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 18 Apr 2019 22:51:16 +0000 Subject: [issue29980] OSError: multiple exceptions should preserve the exception type if it is common In-Reply-To: <1491325941.34.0.941861469291.issue29980@psf.upfronthosting.co.za> Message-ID: <1555627876.39.0.579530308797.issue29980@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 18:57:38 2019 From: report at bugs.python.org (Joshua Bronson) Date: Thu, 18 Apr 2019 22:57:38 +0000 Subject: [issue36054] Way to detect CPU count inside docker container In-Reply-To: <1550681782.39.0.211832814896.issue36054@roundup.psfhosted.org> Message-ID: <1555628258.39.0.915988315243.issue36054@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 19:30:32 2019 From: report at bugs.python.org (Peter McEldowney) Date: Thu, 18 Apr 2019 23:30:32 +0000 Subject: [issue36664] argparse: parser aliases in subparsers stores alias in dest variable Message-ID: <1555630232.08.0.518571967107.issue36664@roundup.psfhosted.org> New submission from Peter McEldowney : I noticed that I have to add a lot more code to handle contexts in subparsers that I was expecting would be necessary. This is something I feel should be handled by the argparse library. What are your thoughts on this? If you run the sample code with the commands below, you can see that although I would want them to do the same thing, I have to add more lines into my code to achieve this. This becomes cumbersome/annoying when dealing with subparser trees. python3 sample.py subsection python3 sample.py s Sample code (also attached): import argparse def get_args(args=None): parser = argparse.ArgumentParser() subparser = parser.add_subparsers(dest='context') sub = subparser.add_parser('subsection', aliases=['s', 'sub', 'subsect']) return parser.parse_args(args) def my_subsection_function(args): print('my subsection was called') def invalid_context(args): print('my functon was not called ') def main(args=get_args()): return { 'subsection': my_subsection_function }.get(args.context, invalid_context)(args) if __name__ == "__main__": main() ---------- components: Library (Lib) files: sample.py messages: 340515 nosy: Peter McEldowney priority: normal severity: normal status: open title: argparse: parser aliases in subparsers stores alias in dest variable type: enhancement versions: Python 3.7 Added file: https://bugs.python.org/file48275/sample.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:01:56 2019 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 19 Apr 2019 01:01:56 +0000 Subject: [issue36665] Dropping __main__ from sys.modules clears the REPL namespace Message-ID: <1555635716.01.0.208381953469.issue36665@roundup.psfhosted.org> New submission from Nick Coghlan : While trying to create an example for a pickle bug discussion, I deliberately dropped `__main__` out of sys.modules, and the REPL session lost all of its runtime state. Simplified reproducer: ``` >>> import sys >>> mod = sys.modules[__name__] >>> sys.modules[__name__] = object() >>> dir() Traceback (most recent call last): File "", line 1, in NameError: name 'dir' is not defined ``` (Initially encountered on Python 2.7, reproduced on Python 3.7) If I'd just dropped the reference to `__main__` entirely, that would make sense (since modules clear their namespaces when they go away), but I didn't: I saved a reference in a local variable first. So it appears the CPython REPL isn't keeping a strong reference to either `__main__` or `__main__.__dict__` between statements, so the cyclic GC kicked in and decided the module could be destroyed. ---------- messages: 340516 nosy: ncoghlan priority: normal severity: normal stage: test needed status: open title: Dropping __main__ from sys.modules clears the REPL namespace type: behavior versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:13:30 2019 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 19 Apr 2019 01:13:30 +0000 Subject: [issue36665] Dropping __main__ from sys.modules clears the REPL namespace In-Reply-To: <1555635716.01.0.208381953469.issue36665@roundup.psfhosted.org> Message-ID: <1555636410.64.0.105087317997.issue36665@roundup.psfhosted.org> Nick Coghlan added the comment: Additional info showing the module getting reset back to the state of a freshly created module namespace: ``` >>> dir() ['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__'] >>> __builtins__ >>> import sys >>> mod = sys.modules[__name__] >>> sys.modules[__name__] = object() >>> __builtins__ Traceback (most recent call last): File "", line 1, in NameError: name '__builtins__' is not defined >>> __annotations__ Traceback (most recent call last): File "", line 1, in NameError: name '__annotations__' is not defined >>> __doc__ >>> __loader__ >>> __name__ '__main__' >>> __package__ >>> __spec__ >>> mod Traceback (most recent call last): File "", line 1, in NameError: name 'mod' is not defined ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:14:27 2019 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 19 Apr 2019 01:14:27 +0000 Subject: [issue36665] Dropping __main__ from sys.modules clears the REPL namespace In-Reply-To: <1555635716.01.0.208381953469.issue36665@roundup.psfhosted.org> Message-ID: <1555636467.53.0.732227308488.issue36665@roundup.psfhosted.org> Nick Coghlan added the comment: The ``sys`` import gets cleared as well (accidentally omitted from the previous comment): ``` >>> sys Traceback (most recent call last): File "", line 1, in NameError: name 'sys' is not defined ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:22:08 2019 From: report at bugs.python.org (mollison) Date: Fri, 19 Apr 2019 01:22:08 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555636928.55.0.643614755074.issue36645@roundup.psfhosted.org> Change by mollison : ---------- keywords: +patch pull_requests: +12803 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:33:26 2019 From: report at bugs.python.org (mollison) Date: Fri, 19 Apr 2019 01:33:26 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555637606.19.0.321256831963.issue36645@roundup.psfhosted.org> mollison added the comment: @brett.cannon: PR is at https://github.com/python/cpython/pull/12879 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:36:15 2019 From: report at bugs.python.org (Joel Croteau) Date: Fri, 19 Apr 2019 01:36:15 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within Message-ID: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> New submission from Joel Croteau : This has been commented on numerous times by others (https://stackoverflow.com/questions/2829329/catch-a-threads-exception-in-the-caller-thread-in-python, http://benno.id.au/blog/2012/10/06/python-thread-exceptions, to name a few), but there is no in-built mechanism in threading to catch an unhandled exception thrown by a thread. The default behavior of dumping to stderr is completely useless for error handling in many scenarios. Solutions do exist, but I have yet to see one that is not exceptionally complicated. It seems like checking for exceptions should be a very basic part of any threading library. The simplest solution would be to just have the Thread store any unhandled exceptions and have them raised by Thread.join(). There could also be additional methods to check if exceptions were raised. ---------- components: Library (Lib) messages: 340520 nosy: Joel Croteau priority: normal severity: normal status: open title: threading.Thread should have way to catch an exception thrown within versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:51:50 2019 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 19 Apr 2019 01:51:50 +0000 Subject: [issue36665] Dropping __main__ from sys.modules clears the REPL namespace In-Reply-To: <1555635716.01.0.208381953469.issue36665@roundup.psfhosted.org> Message-ID: <1555638710.72.0.427698059122.issue36665@roundup.psfhosted.org> Nick Coghlan added the comment: The relevant functions: * PyRun_InteractiveLoopFlags: https://github.com/python/cpython/blob/e8113f51a8bdf33188ee30a1c038a298329e7bfa/Python/pythonrun.c#L89 * PyRun_InteractiveOneObjectEx: https://github.com/python/cpython/blob/e8113f51a8bdf33188ee30a1c038a298329e7bfa/Python/pythonrun.c#L180 So it turns out I was wrong: nothing is getting cleared anywhere, but instead each statement in the REPL is *importing* `__main__` again in order to find the namespace to use for the statement execution. Because of the specific API it uses to do that, a non-module object like the one I injected gets replaced with a regular (empty) module object: https://github.com/python/cpython/blob/027b09c5a13aac9e14a3b43bb385298d549c3833/Python/import.c#L791 However, it *doesn't* have the extra code needed to make the `builtins` available: https://github.com/python/cpython/blob/027b09c5a13aac9e14a3b43bb385298d549c3833/Python/import.c#L932 So I now think the only actual *bug* here is the fact that the REPL isn't making sure that `__builtins__` is set appropriately - the rest can be chalked up to implementation defined behaviour around what happens if `__main__` gets replaced or removed in sys.modules while the REPL is running. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 21:55:51 2019 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 19 Apr 2019 01:55:51 +0000 Subject: [issue36665] REPL doesn't ensure builtins are available when implicitly recreating __main__ In-Reply-To: <1555635716.01.0.208381953469.issue36665@roundup.psfhosted.org> Message-ID: <1555638951.9.0.935132426696.issue36665@roundup.psfhosted.org> Change by Nick Coghlan : ---------- title: Dropping __main__ from sys.modules clears the REPL namespace -> REPL doesn't ensure builtins are available when implicitly recreating __main__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 22:04:58 2019 From: report at bugs.python.org (Alexander Riccio) Date: Fri, 19 Apr 2019 02:04:58 +0000 Subject: [issue25878] CPython on Windows builds with /W3, not /W4 In-Reply-To: <1450224755.83.0.682115702996.issue25878@psf.upfronthosting.co.za> Message-ID: <1555639498.58.0.908054626636.issue25878@roundup.psfhosted.org> Alexander Riccio added the comment: One more thing, after I ran code analysis: This is obviously a potential memory leak: Warning C6308 'realloc' might return null pointer: assigning null pointer to 'arr->items', which is passed as an argument to 'realloc', will cause the original memory block to be leaked. cpython\parser\parsetok.c 38 I found some sketchy code that isn't obviously correct. Here are a few of the warnings: Warning C6294 Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed. \cpython\modules\gcmodule.c 1377 Warning C6011 Dereferencing NULL pointer 'cmdline'. See line 230 for an earlier location where this can occur \cpython\python\preconfig.c 242 (cmdline is checked for nullness after several uses?) And finally there's one warning where I have no clue what's going on: Warning C6386 Buffer overrun while writing to 'x_digits': the writable size is '10' bytes, but '286331156' bytes might be written. \cpython\objects\longobject.c 2972 ---------- Added file: https://bugs.python.org/file48276/cpython_xdigits_overrun.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 22:34:09 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 19 Apr 2019 02:34:09 +0000 Subject: [issue36664] argparse: parser aliases in subparsers stores alias in dest variable In-Reply-To: <1555630232.08.0.518571967107.issue36664@roundup.psfhosted.org> Message-ID: <1555641249.85.0.439230994728.issue36664@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 22:35:44 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 19 Apr 2019 02:35:44 +0000 Subject: [issue36662] asdict/astuple Dataclass methods In-Reply-To: <1555619470.94.0.171933894359.issue36662@roundup.psfhosted.org> Message-ID: <1555641344.49.0.41275106419.issue36662@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 18 22:58:26 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 19 Apr 2019 02:58:26 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within In-Reply-To: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> Message-ID: <1555642706.61.0.100304032063.issue36666@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 01:01:37 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 19 Apr 2019 05:01:37 +0000 Subject: [issue36662] asdict/astuple Dataclass methods In-Reply-To: <1555619470.94.0.171933894359.issue36662@roundup.psfhosted.org> Message-ID: <1555650097.75.0.799396517123.issue36662@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: asdict method in the benchmark does a direct dictionary construction. Meanwhile dataclasses.asdict does more work in https://github.com/python/cpython/blob/e8113f51a8bdf33188ee30a1c038a298329e7bfa/Lib/dataclasses.py#L1023 . Hence in the example i.asdict() and asdict(i) are not equivalent. import timeit from dataclasses import dataclass, asdict @dataclass class InventoryItem: '''Class for keeping track of an item in inventory.''' name: str unit_price: float quantity_on_hand: int = 0 def asdict(self): data = {'name': self.name, 'unit_price': self.unit_price, 'quantity_on_hand': self.quantity_on_hand, } return data i = InventoryItem(name='widget', unit_price=3.0, quantity_on_hand=10) setup = """from dataclasses import dataclass, asdict; @dataclass class InventoryItem: '''Class for keeping track of an item in inventory.''' name: str unit_price: float quantity_on_hand: int = 0 def asdict(self): data = {'name': self.name, 'unit_price': self.unit_price, 'quantity_on_hand': self.quantity_on_hand, } return data i = InventoryItem(name='widget', unit_price=3.0, quantity_on_hand=10)""" print("asdict(i)") print(timeit.Timer("asdict(i)", setup=f"{setup}").timeit(number=1_000_000)) print("i.asdict()") print(timeit.Timer("i.asdict()", setup=f"{setup}").timeit(number=1_000_000)) print("i.inlined_asdict()") print(timeit.Timer("i.inlined_asdict(i)", setup=f"{setup}; i.inlined_asdict = asdict").timeit(number=1_000_000)) i.inlined_asdict = asdict assert asdict(i) == i.asdict() == i.inlined_asdict(i) ./python.exe ../backups/bpo36662.py asdict(i) 11.585838756000001 i.asdict() 0.44129350699999925 i.inlined_asdict() 11.858042807999999 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 01:26:25 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 19 Apr 2019 05:26:25 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555651585.97.0.635825435487.issue36661@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I think the import is implied in the example since the docs page is for dataclasses module but adding an explicit import to InventoryItem at the top won't hurt too. ---------- nosy: +eric.smith, xtreak title: Missing import in docs -> Missing dataclass decorator import in dataclasses module docs versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 01:27:11 2019 From: report at bugs.python.org (paul j3) Date: Fri, 19 Apr 2019 05:27:11 +0000 Subject: [issue36664] argparse: parser aliases in subparsers stores alias in dest variable In-Reply-To: <1555630232.08.0.518571967107.issue36664@roundup.psfhosted.org> Message-ID: <1555651631.56.0.868775451349.issue36664@roundup.psfhosted.org> paul j3 added the comment: I added a `print(args)` to clarify what you are talking about: 2148:~/mypy$ python3 issue36664.py subsection Namespace(context='subsection') my subsection was called 2148:~/mypy$ python3 issue36664.py s Namespace(context='s') my functon was not called 2148:~/mypy$ python3 issue36664.py sub Namespace(context='sub') my functon was not called The value of `args.context` depends on what alias was used, not the primary name of the subparser. The help lists all aliases 2148:~/mypy$ python3 issue36664.py -h usage: issue36664.py [-h] {subsection,s,sub,subsect} ... The sub-parser doesn't actually have a name. In self._name_parser_map each alias is a key with a parser object value. Multiple keys for a single value. The only thing that distinguishes 'subsection' is that was the first key in that dictionary. In effect the subparser Action object does not maintain a mapping from the aliases to the 'subsection' name. I can imagine some ways of deducing that mapping, but it's not going to be a trivial task. Unless someone comes up with a clever patch, I think the best choice is for you maintain your own mapping. For example write a utility that takes a 'name' and alias list, calls sub = subparser.add_parser('subsection', aliases=['s', 'sub', 'subsect']) and saves some sort of mapping from the aliases to 'subsection'. Then use that later when you use `args.context`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 03:40:27 2019 From: report at bugs.python.org (Tom Hale) Date: Fri, 19 Apr 2019 07:40:27 +0000 Subject: [issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions In-Reply-To: <1555577087.92.0.769196427693.issue36656@roundup.psfhosted.org> Message-ID: <1555659627.62.0.0676845139921.issue36656@roundup.psfhosted.org> Tom Hale added the comment: The most correct work-around I believe exists is: (updates at: https://stackoverflow.com/a/55742015/5353461) def symlink_force(target, link_name): ''' Create a symbolic link pointing to target named link_name. Overwrite target if it exists. ''' # os.replace may fail if files are on different filesystems. # Therefore, use the directory of target link_dir = os.path.dirname(target) # os.symlink requires that the target does NOT exist. # Avoid race condition of file creation between mktemp and symlink: while True: temp_pathname = tempfile.mktemp(suffix='.tmp', \ prefix='symlink_force_tmp-', dir=link_dir) try: os.symlink(target, temp_pathname) break # Success, exit loop except FileExistsError: time.sleep(0.001) # Prevent high load in pathological conditions except: raise os.replace(temp_pathname, link_name) An unlikely race condition still remains: the symlink created at the randomly-named `temp_path` could be modified between creation and rename/replacing the specified link name. Suggestions for improvement welcome. ---------- type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:14:08 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 19 Apr 2019 08:14:08 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555661648.18.0.682304787907.issue36607@roundup.psfhosted.org> Andrew Svetlov added the comment: Sorry, I've missed that the loop has hashable requirement already. Would you prepare a patch for number 3? I am afraid we can add another hard-to-debug multi-threaded problem by complicating the data structure. I'm just curious why do you call `all_tasks()` at all? In my mind, the only non-debug usage is `asyncio.run()` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:34:54 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 19 Apr 2019 08:34:54 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555651585.97.0.635825435487.issue36661@roundup.psfhosted.org> Message-ID: <20190419083450.mozqaiwn4qhk6rxb@xps> St?phane Wirtel added the comment: We could change the example with ``` from dataclasses import dataclass @dataclass class InventoryItem: ... ``` Because it's not specified in the documentation (header, that we need to import dataclass from dataclasses). +1 for a small update. You are free to propose a PR. Have a nice day, >I think the import is implied in the example since the docs page is for >dataclasses module but adding an explicit import to InventoryItem at >the top won't hurt too. Yep, but explicit is better than implicit. ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:37:53 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 19 Apr 2019 08:37:53 +0000 Subject: [issue36662] asdict/astuple Dataclass methods In-Reply-To: <1555619470.94.0.171933894359.issue36662@roundup.psfhosted.org> Message-ID: <1555663073.43.0.337436291082.issue36662@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:39:32 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 19 Apr 2019 08:39:32 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555663172.06.0.0965878451432.issue36661@roundup.psfhosted.org> Eric V. Smith added the comment: I think adding "from dataclasses import dataclass" in the first example is fine. There's a similar import in the sqlite3 documentation, just to pick one at random. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:42:09 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 19 Apr 2019 08:42:09 +0000 Subject: [issue36295] Need to yield (sleep(0)) twice in asyncio In-Reply-To: <1552582792.25.0.588312796028.issue36295@roundup.psfhosted.org> Message-ID: <1555663329.18.0.755294868292.issue36295@roundup.psfhosted.org> Andrew Svetlov added the comment: In asyncio `await asyncio.sleep(0)` is for switching execution context from the current task to other code. There is no guarantee for finishing already running tasks before returning from `asyncio.sleep(0)` call etc. Also, your code snippet has a logical error. It should not call regular `time.sleep(123)` from a coroutine but use `loop.run_in_executor()` for performing blocking calls ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:44:14 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 19 Apr 2019 08:44:14 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555663172.06.0.0965878451432.issue36661@roundup.psfhosted.org> Message-ID: <20190419084410.wg5twjhhjzsm6vn5@xps> St?phane Wirtel added the comment: Ok, I suggest to add a "first issue" for the sprint days at PyCon US. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:45:35 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 19 Apr 2019 08:45:35 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555663535.69.0.969649436621.issue36661@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 04:55:08 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 19 Apr 2019 08:55:08 +0000 Subject: [issue36662] asdict/astuple Dataclass methods In-Reply-To: <1555619470.94.0.171933894359.issue36662@roundup.psfhosted.org> Message-ID: <1555664108.69.0.433044301212.issue36662@roundup.psfhosted.org> Eric V. Smith added the comment: I think the best thing to do is write another decorator that adds this method. I've often thought that having a dataclasses_tools third-party module would be a good idea. It could include my add_slots decorator in https://github.com/ericvsmith/dataclasses/blob/master/dataclass_tools.py Such a decorator could then deal with all the complications that I don't want to add to @dataclass. For example, choosing a method name. @dataclass doesn't inject any non-dunder names in the class, but the new decorator could, or it could provide a way to customize the member name. Also, note that your example asdict method doesn't do the same thing as dataclasses.asdict. While you get some speedup by knowing the field names in advance, you also don't do the recursive generation that dataclasses.asdict does. In order to skip the recursive dict generation, you'd either have to test the type of each member (using some heuristic about what doesn't need recursion), or assume the member type matches the type defined in the class. I don't want dataclasses.asdict to make the assumption that the member type matches the declared type. There's nowhere else it does this. I'm not sure how much of the speedup you're seeing is the result of hard-coding the member names, and how much is avoiding recursion. If all of the improvement is by eliminating recursion, then it's not worth doing. I'm not saying the existing dataclasses.asdict can't be sped up: surely it can. But I don't want to remove features or add complexity to do so. ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 05:16:23 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 19 Apr 2019 09:16:23 +0000 Subject: [issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d In-Reply-To: <1552917459.29.0.295748589939.issue36345@roundup.psfhosted.org> Message-ID: <1555665383.46.0.69973458171.issue36345@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 05:16:47 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 19 Apr 2019 09:16:47 +0000 Subject: [issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d In-Reply-To: <1552917459.29.0.295748589939.issue36345@roundup.psfhosted.org> Message-ID: <1555665407.45.0.39268686127.issue36345@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 05:48:55 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 19 Apr 2019 09:48:55 +0000 Subject: [issue35792] Specifying AbstractEventLoop.run_in_executor as a coroutine conflicts with implementation/intent In-Reply-To: <1548039558.68.0.986540752255.issue35792@roundup.psfhosted.org> Message-ID: <1555667335.12.0.504469131259.issue35792@roundup.psfhosted.org> Andrew Svetlov added the comment: I would rather change the implementation by converting it into async function. It can break some code, sure -- but in a very explicit way (coroutine `run_in_executor is never awaited` error). Making existing third-party code forward-compatible is trivial: just push `await` before the call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 06:16:21 2019 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bortzmeyer?=) Date: Fri, 19 Apr 2019 10:16:21 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1555668981.54.0.907952785177.issue34155@roundup.psfhosted.org> St?phane Bortzmeyer added the comment: Note that this bug was used in an actual security attack so it is serious https://medium.com/@fs0c131y/tchap-the-super-not-secure-app-of-the-french-government-84b31517d144 https://twitter.com/fs0c131y/status/1119143946687434753 ---------- nosy: +bortzmeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 06:28:43 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 19 Apr 2019 10:28:43 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1555669723.29.0.0360237648429.issue34155@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Relevant attack from matrix blog post. https://matrix.org/blog/2019/04/18/security-update-sydent-1-0-2/ > sydent uses python's email.utils.parseaddr function to parse the input email address before sending validation mail to it, but it turns out that if you hand parseaddr an malformed email address of form a at b.com@c.com, it silently discards the @c.com prefix without error. The result of this is that if one requested a validation token for 'a at malicious.org@important.com', the token would be sent to 'a at malicious.org', but the address 'a at malicious.org@important.com' would be marked as validated. This release fixes this behaviour by asserting that the parsed email address is the same as the input email address. I am marking this as a security issue. ---------- keywords: +security_issue nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 06:51:51 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 19 Apr 2019 10:51:51 +0000 Subject: [issue14788] Pdb debugs itself after ^C and a breakpoint is set anywhere In-Reply-To: <1336817257.9.0.505200749782.issue14788@psf.upfronthosting.co.za> Message-ID: <1555671111.52.0.206209116685.issue14788@roundup.psfhosted.org> daniel hahler added the comment: I think this issue itself might be fixed already / changed since 3.5. I've came up with something similar in this area though, which is only triggered when using Ctrl-C while pdb is waiting for the next statement: https://github.com/python/cpython/pull/12880 ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 06:53:51 2019 From: report at bugs.python.org (George Sakkis) Date: Fri, 19 Apr 2019 10:53:51 +0000 Subject: [issue36662] asdict/astuple Dataclass methods In-Reply-To: <1555619470.94.0.171933894359.issue36662@roundup.psfhosted.org> Message-ID: <1555671231.43.0.440597437056.issue36662@roundup.psfhosted.org> George Sakkis added the comment: > I think the best thing to do is write another decorator that adds this method. I've often thought that having a dataclasses_tools third-party module would be a good idea. I'd be happy with a separate decorator in the standard library for adding these methods. Not so sure about a third-party module, the added value is probably not high enough to justify an extra dependency (assuming one is aware it exists in the first place). > or assume the member type matches the type defined in the class. This doesn't seem an unreasonable assumption to me. If I'm using a dataclass, I probably care enough about its member types to bother declaring them and I wouldn't mind if a particular method expects that the members actually match the types. This behaviour would be clearly documented. Alternatively, if we go with a separate decorator, whether this assumption holds could be a parameter, something like: def add_asdict(cls, name='asdict', strict=True) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 06:53:55 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 19 Apr 2019 10:53:55 +0000 Subject: [issue22135] allow to break into pdb with Ctrl-C for all the commands that resume execution In-Reply-To: <1407185061.52.0.89159247831.issue22135@psf.upfronthosting.co.za> Message-ID: <1555671235.52.0.985700494348.issue22135@roundup.psfhosted.org> daniel hahler added the comment: Would be nice to have this indeed. Please consider creating a PR with an updated patch then for easier review. ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 07:07:53 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 19 Apr 2019 11:07:53 +0000 Subject: [issue36667] pdb: restore SIGINT handler in sigint_handler already Message-ID: <1555672073.52.0.288169385007.issue36667@roundup.psfhosted.org> New submission from daniel hahler : Without this, and additional SIGINT while waiting for the next statement (e.g. during `time.sleep`) will stop at `sigint_handler`. With this patch: > ?/t-pdb-sigint-in-sleep.py(10)() -> sleep() (Pdb) c ^C Program interrupted. (Use 'cont' to resume). ^CKeyboardInterrupt > ?/t-pdb-sigint-in-sleep.py(6)sleep() -> time.sleep(10) (Pdb) Without this patch: > ?/t-pdb-sigint-in-sleep.py(10)() -> sleep() (Pdb) c ^C Program interrupted. (Use 'cont' to resume). ^C--Call-- > ?/cpython/Lib/pdb.py(188)sigint_handler() -> def sigint_handler(self, signum, frame): (Pdb) This was changed / regressed in https://github.com/python/cpython/commit/10e54aeaa234f2806b367c66e3fb4ac6568b39f6 (3.5.3rc1?), when it was moved while fixing issue 20766. ---------- components: Library (Lib) messages: 340539 nosy: blueyed priority: normal severity: normal status: open title: pdb: restore SIGINT handler in sigint_handler already type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 07:08:26 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 19 Apr 2019 11:08:26 +0000 Subject: [issue36667] pdb: restore SIGINT handler in sigint_handler already In-Reply-To: <1555672073.52.0.288169385007.issue36667@roundup.psfhosted.org> Message-ID: <1555672106.09.0.149217075376.issue36667@roundup.psfhosted.org> Change by daniel hahler : ---------- keywords: +patch pull_requests: +12804 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 07:10:21 2019 From: report at bugs.python.org (daniel hahler) Date: Fri, 19 Apr 2019 11:10:21 +0000 Subject: [issue20766] reference leaks in pdb In-Reply-To: <1393326154.87.0.194575074306.issue20766@psf.upfronthosting.co.za> Message-ID: <1555672221.02.0.874576957748.issue20766@roundup.psfhosted.org> daniel hahler added the comment: Please see https://bugs.python.org/issue36667 for a followup. It does not look like moving it to `interaction` is relevant for fixing the leak, is it? I think it should be restored in both places. ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 07:32:52 2019 From: report at bugs.python.org (Alessandro Cucci) Date: Fri, 19 Apr 2019 11:32:52 +0000 Subject: [issue36461] timeit: Additional changes for autorange In-Reply-To: <1553766568.14.0.657766350537.issue36461@roundup.psfhosted.org> Message-ID: <1555673572.66.0.207145633605.issue36461@roundup.psfhosted.org> Alessandro Cucci added the comment: Hello @Mariatta, if this is simple I would like to work on that, can I? Thanks! ---------- nosy: +Alessandro Cucci _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 08:02:10 2019 From: report at bugs.python.org (=?utf-8?q?Nicolas_=C3=89vrard?=) Date: Fri, 19 Apr 2019 12:02:10 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1555675330.5.0.309232022477.issue34155@roundup.psfhosted.org> Change by Nicolas ?vrard : ---------- nosy: +nicoe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 08:02:34 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 19 Apr 2019 12:02:34 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within In-Reply-To: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> Message-ID: <1555675354.74.0.21233951912.issue36666@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +tim.peters type: -> enhancement versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 08:04:04 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 19 Apr 2019 12:04:04 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within In-Reply-To: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> Message-ID: <1555675444.08.0.72358179934.issue36666@roundup.psfhosted.org> Antoine Pitrou added the comment: The current behavior can't be changed for compatibility reasons (imagine user programs starting to raise on Thread.join()), but we could add an option to the threading.Thread() constructor in order to store and propagate exceptions. ---------- nosy: +giampaolo.rodola, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 09:44:01 2019 From: report at bugs.python.org (Thomas Moreau) Date: Fri, 19 Apr 2019 13:44:01 +0000 Subject: [issue36668] semaphore_tracker is not reused by child processes Message-ID: <1555681441.41.0.870057455059.issue36668@roundup.psfhosted.org> New submission from Thomas Moreau : The current implementation of the semaphore_tracker creates a new process for each children. The easy fix would be to pass the _pid to the children but the current mechanism to check if the semaphore_tracker is alive relies on waitpid which cannot be used in child processes (the semaphore_tracker is only a sibling of these processes). The main issue is to have a reliable check that either: The pipe is open. This is what is done here by sending a message. I don't know if there is a more efficient way to check it. Check that a given pid is alive. As we cannot rely on waitpid, I don't see an efficient mechanism. I propose to add a PROBE command in the semaphore tracker. When the pipe is closed, the send command will fail, meaning that the semaphore tracker is down. ---------- components: Library (Lib) messages: 340543 nosy: tomMoral priority: normal severity: normal status: open title: semaphore_tracker is not reused by child processes type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 09:44:23 2019 From: report at bugs.python.org (Thomas Moreau) Date: Fri, 19 Apr 2019 13:44:23 +0000 Subject: [issue36668] semaphore_tracker is not reused by child processes In-Reply-To: <1555681441.41.0.870057455059.issue36668@roundup.psfhosted.org> Message-ID: <1555681463.57.0.600774492588.issue36668@roundup.psfhosted.org> Change by Thomas Moreau : ---------- keywords: +patch pull_requests: +12805 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 09:54:20 2019 From: report at bugs.python.org (Nick Davies) Date: Fri, 19 Apr 2019 13:54:20 +0000 Subject: [issue36607] asyncio.all_tasks() crashes if asyncio is used in multiple threads In-Reply-To: <1555006368.14.0.78767463153.issue36607@roundup.psfhosted.org> Message-ID: <1555682060.92.0.451766624239.issue36607@roundup.psfhosted.org> Nick Davies added the comment: > Would you prepare a patch for number 3? I will give it a try and see what I come up with. > I am afraid we can add another hard-to-debug multi-threaded problem by complicating the data structure. Yeah this was my concern too, the adding and removing from the WeakDict[AbstractEventLoop, WeakSet[Task]] for `_all_tasks` could still cause issues. Specifically the whole WeakSet class is not threadsafe so I would assume WeakDict is the same, there may not be a nice way of ensuring a combination of GC + the IterationGuard doesn't come and mess up the dict even if I wrap it in a threading lock. Another option would be to have the WeakSet[Task] attached to the loop itself then because using the same loop in multiple threads not at all thread safe already that would contain the problem. You mentioned "third-party loops" which may make this option impossible. > I'm just curious why do you call `all_tasks()` at all? > In my mind, the only non-debug usage is `asyncio.run()` In reality we aren't using `all_tasks()` directly. We are calling `asyncio.run()` from multiple threads which triggers the issue. The repro I provided was just a more reliable way of triggering the issue. I will paste a slightly more real-world example of how this happened below. This version is a little more messy and harder to see exactly what the problem is which is why I started with the other one. ``` import asyncio from threading import Thread async def do_nothing(n=0): await asyncio.sleep(n) async def loop_tasks(): loop = asyncio.get_event_loop() while True: loop.create_task(do_nothing()) await asyncio.sleep(0.01) async def make_tasks(n): loop = asyncio.get_event_loop() for i in range(n): loop.create_task(do_nothing(1)) await asyncio.sleep(1) def make_lots_of_tasks(): while True: asyncio.run(make_tasks(10000)) for i in range(10): t = Thread(target=make_lots_of_tasks) t.start() asyncio.run(loop_tasks()) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 10:02:35 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 19 Apr 2019 14:02:35 +0000 Subject: [issue36668] semaphore_tracker is not reused by child processes In-Reply-To: <1555681441.41.0.870057455059.issue36668@roundup.psfhosted.org> Message-ID: <1555682555.14.0.535681176999.issue36668@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 10:08:57 2019 From: report at bugs.python.org (Dan Snider) Date: Fri, 19 Apr 2019 14:08:57 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator Message-ID: <1555682937.13.0.0196154562382.issue36669@roundup.psfhosted.org> Change by Dan Snider : ---------- nosy: bup priority: normal severity: normal status: open title: weakref proxy doesn't support the matrix multiplication operator _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 10:30:13 2019 From: report at bugs.python.org (Christopher Hunt) Date: Fri, 19 Apr 2019 14:30:13 +0000 Subject: [issue35792] Specifying AbstractEventLoop.run_in_executor as a coroutine conflicts with implementation/intent In-Reply-To: <1548039558.68.0.986540752255.issue35792@roundup.psfhosted.org> Message-ID: <1555684213.05.0.725521334831.issue35792@roundup.psfhosted.org> Christopher Hunt added the comment: My use case is scheduling work against an executor but waiting on the results later (on demand). If converting `BaseEventLoop.run_in_executor(executor, func, *args)` to a coroutine function, I believe there are two possible approaches (the discussion that started this [here](https://stackoverflow.com/questions/54263558/is-asyncio-run-in-executor-specified-ambiguously) only considers [impl.1]): impl.1) `BaseEventLoop.run_in_executor` still returns a future, but we must await the coroutine object in order to get it (very breaking change), or impl.2) `BaseEventLoop.run_in_executor` awaits on the result of `func` itself and returns the result directly In both cases the provided `func` will only be dispatched to `executor` when the coroutine object is scheduled with the event loop. For [impl.1], from the linked discussion, there is an example of user code required to get the behavior of schedule immediately and return future while still using `BaseEventLoop.run_in_executor`: async def run_now(f, *args): loop = asyncio.get_event_loop() started = asyncio.Event() def wrapped_f(): loop.call_soon_threadsafe(started.set) return f(*args) fut = loop.run_in_executor(None, wrapped_f) await started.wait() return fut however this wrapper would only be possible to use in an async function and assumes the executor is running in the same process - synchronous functions (e.g. an implementation of Protocol.data_received) would need to use an alternative `my_run_in_executor`: def my_run_in_executor(executor, f, *args, loop=asyncio.get_running_loop()): return asyncio.wrap_future(executor.submit(f, *args), loop=loop) either of these would need to be discovered by users and live in their code base. Having to use `my_run_in_executor` would be most unfortunate, given the purpose of `run_in_executor` per the PEP is to be a shorthand for this exact function. For [impl.2], we are fine if the use case allows submitting and awaiting the completion of `func` in the same location, and no methods of asyncio.Future (e.g. `add_done_callback`, `cancel`) are used. If not then we still need to either: soln.1) use `my_run_in_executor`, or soln.2) wrap the `BaseEventLoop.run_in_executor` coroutine object/asyncio.Future with `asyncio.ensure_future` [soln.1] is bad for the reason stated above: this is the function we are trying to avoid users having to write. [soln.2] uses the low-level function `asyncio.ensure_future` because both of the suggested alternatives (per the docs) `asyncio.create_task` and `BaseEventLoop.create_task` throw a `TypeError` when provided an `asyncio.Future` as returned by the current implementation of `BaseEventLoop.run_in_executor`. This will have to be discovered by users and exist in their code base. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 10:37:26 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 19 Apr 2019 14:37:26 +0000 Subject: [issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions In-Reply-To: <1555577087.92.0.769196427693.issue36656@roundup.psfhosted.org> Message-ID: <1555684646.57.0.240162704297.issue36656@roundup.psfhosted.org> Serhiy Storchaka added the comment: If the symlink can be recreated, it can also be changed after creation. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 11:52:37 2019 From: report at bugs.python.org (Lorenz Mende) Date: Fri, 19 Apr 2019 15:52:37 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german Message-ID: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> New submission from Lorenz Mende : The test suite fails with the first tests (I assume 1st call of getloadavg of WindowsLoadTracker). Traceback (most recent call last): File "P:\Repos\CPython\cpython\lib\runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "P:\Repos\CPython\cpython\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "P:\Repos\CPython\cpython\lib\test\__main__.py", line 2, in main() File "P:\Repos\CPython\cpython\lib\test\libregrtest\main.py", line 653, in main Regrtest().main(tests=tests, **kwargs) File "P:\Repos\CPython\cpython\lib\test\libregrtest\main.py", line 586, in main self._main(tests, kwargs) File "P:\Repos\CPython\cpython\lib\test\libregrtest\main.py", line 632, in _main self.run_tests() File "P:\Repos\CPython\cpython\lib\test\libregrtest\main.py", line 515, in run_tests self.run_tests_sequential() File "P:\Repos\CPython\cpython\lib\test\libregrtest\main.py", line 396, in run_tests_sequential self.display_progress(test_index, text) File "P:\Repos\CPython\cpython\lib\test\libregrtest\main.py", line 150, in display_progress load_avg_1min = self.getloadavg() File "P:\Repos\CPython\cpython\lib\test\libregrtest\win_utils.py", line 81, in getloadavg typeperf_output = self.read_output() File "P:\Repos\CPython\cpython\lib\test\libregrtest\win_utils.py", line 78, in read_output return response.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 67: invalid start byte ########################################################## The windows 'typeperf "\System\Processor Queue Length" -si 1' command unluckily returns an string with an umlaut which leads to the Decode-Error. This comes up because the for the typeperf is location dependend. (In german the counter would read \System\Prozessor-Warteschlangenl?nge) I see two possible solutions to this issue. 1. Raising an exception earlier on creation of WindowsLoadTracker resulting in the same behaviour as if there is no typeperf available (german pythoneers would have a drawback with this) 2. Getting the typeperf counter correctly from registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\CurrentLanguage, described here https://social.technet.microsoft.com/Forums/de-DE/25bc6907-cf2c-4dc8-8687-974b799ba754/powershell-ausgabesprache-umstellen?forum=powershell_de) environment: Windows 10 x64, 1809, german cpython @e16467af0bfcc9f399df251495ff2d2ad20a1669 commit of assumed root cause of https://bugs.python.org/issue34060 ---------- components: Tests messages: 340547 nosy: LorenzMende priority: normal severity: normal status: open title: test suite broken due to cpu usage feature on win 10/ german type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 11:53:34 2019 From: report at bugs.python.org (Lorenz Mende) Date: Fri, 19 Apr 2019 15:53:34 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555689214.98.0.874446329149.issue36670@roundup.psfhosted.org> Change by Lorenz Mende : ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 11:54:02 2019 From: report at bugs.python.org (Lorenz Mende) Date: Fri, 19 Apr 2019 15:54:02 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555689242.72.0.381534721495.issue36670@roundup.psfhosted.org> Change by Lorenz Mende : ---------- nosy: -ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 12:26:07 2019 From: report at bugs.python.org (Ammar Askar) Date: Fri, 19 Apr 2019 16:26:07 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555691167.63.0.0127089217444.issue36670@roundup.psfhosted.org> Ammar Askar added the comment: What does `typeperf "\System\Processor Queue Length" -si 1` actually return on your non-English system? Does it just return an error with the counter's name or is the umalet just in the first header line, i.e this one for me: "(PDH-CSV 4.0)","\\MSI\System\Processor Queue Length" If it's the latter then I think the correct fix would be to figure out what encoding typeperf is outputting in and then just decode with that. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 12:59:49 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 19 Apr 2019 16:59:49 +0000 Subject: [issue36617] The rich comparison operators are second class citizens In-Reply-To: <1555088825.83.0.858105919161.issue36617@roundup.psfhosted.org> Message-ID: <1555693189.56.0.274158603151.issue36617@roundup.psfhosted.org> Eric V. Smith added the comment: I assume the OP is using the stdlib parser module just to show what is a syntax error and what isn't. But most of the characters in the example strings aren't required, so it can be simplified. Here is a simpler case demonstrating what I think the OP is trying to say. This is not a syntax error: >>> [*0<<1] Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not iterable (Ignore the type error, this shows that it's syntactically valid.) But this is a syntax error: >>> [*0<=1] File "", line 1 [*0<=1] ^ SyntaxError: invalid syntax Both of these are treated the same way, as not syntax errors: >>> f(*0==1) Traceback (most recent call last): File "", line 1, in NameError: name 'f' is not defined >>> f(*0<=1) Traceback (most recent call last): File "", line 1, in NameError: name 'f' is not defined Here's the above, using parser: >>> import parser >>> parser.expr("[*0<<1]") >>> parser.expr("[*0<=1]") Traceback (most recent call last): File "", line 1, in File "", line 1 [*0<=1] ^ SyntaxError: invalid syntax >>> parser.expr("f(*0<<1)") >>> parser.expr("f(*0<=1)") I'm not sure this is worth fixing. Maybe if someone can find where in the grammar this is caused, and understands the side effects of fixing it, it could be addressed. But I expect it to be non-trivial. ---------- components: +Interpreter Core nosy: +eric.smith versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 13:06:37 2019 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 19 Apr 2019 17:06:37 +0000 Subject: [issue36617] The rich comparison operators are second class citizens In-Reply-To: <1555088825.83.0.858105919161.issue36617@roundup.psfhosted.org> Message-ID: <1555693597.57.0.957455157155.issue36617@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 13:11:57 2019 From: report at bugs.python.org (Lorenz Mende) Date: Fri, 19 Apr 2019 17:11:57 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555693917.81.0.0653714626855.issue36670@roundup.psfhosted.org> Lorenz Mende added the comment: Hi Ammar, you are correct. typeperf returns: P:\Repos\CPython\cpython>typeperf "\System\Prozessor-Warteschlangenl?nge" -si 1 "(PDH-CSV 4.0)","\\ZERO\System\Prozessor-Warteschlangenl?nge" "04/19/2019 19:09:14.510","0.000000" "04/19/2019 19:09:15.514","0.000000" So even with correct counter name the outpu needs to be decoded correctly. I already got a solution to get the location specific counter name from registry - if it helps I'll commit it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 13:13:40 2019 From: report at bugs.python.org (Ammar Askar) Date: Fri, 19 Apr 2019 17:13:40 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555694020.67.0.0251613616451.issue36670@roundup.psfhosted.org> Ammar Askar added the comment: Thank you, could you also share the output if you just give it the English name of the counter? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 13:26:15 2019 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 19 Apr 2019 17:26:15 +0000 Subject: [issue35959] math.prod(range(10)) caues segfault In-Reply-To: <1549825733.5.0.0745476001214.issue35959@roundup.psfhosted.org> Message-ID: <1555694775.78.0.676672309607.issue35959@roundup.psfhosted.org> Mark Dickinson added the comment: I think this can be closed; I did look at the PR post-merge (sorry that I didn't get to it before it was merged), and I agree that it should fix the segfault. There's scope for refactoring / improving the implementation, but that would belong in a different issue. I'll close, but @pabolgsal: please feel free to re-open if I've misunderstood. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 13:29:47 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 19 Apr 2019 17:29:47 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator Message-ID: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> New submission from SilentGhost : It's not obvious why it should. Do you care to show a use case you had in mind? ---------- components: +Library (Lib) nosy: +SilentGhost, fdrake type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 14:22:04 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 19 Apr 2019 18:22:04 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555698124.37.0.667850054906.issue36650@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the reproducer code. I've bisected this back to b2b023c657ba8c3f4a24d0c847d10fe8e2a73d44 which fixes other known bugs in the lru_cache in issue 35780. The problem is due to the lines that use a scalar instead of an args tuple for exact ints and strs. I'll work-up a PR to fix it soon (I'm on vacation and have limited connectivity so it may take a few days). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 14:34:38 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 19 Apr 2019 18:34:38 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555698878.64.0.103660076831.issue36650@roundup.psfhosted.org> Jason R. Coombs added the comment: Nice work. Thanks Raymond. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 16:39:51 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 19 Apr 2019 20:39:51 +0000 Subject: [issue33135] Define field prefixes for the various config structs In-Reply-To: <1521958223.34.0.467229070634.issue33135@psf.upfronthosting.co.za> Message-ID: <1555706391.18.0.253231557789.issue33135@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 16:41:38 2019 From: report at bugs.python.org (Joel Croteau) Date: Fri, 19 Apr 2019 20:41:38 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within In-Reply-To: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> Message-ID: <1555706498.54.0.341854467544.issue36666@roundup.psfhosted.org> Joel Croteau added the comment: I agree that we should not change the default behavior of Thread.join(), as that would break existing code, but there are plenty of other ways to do this. I see a couple of possibilities: 1. Add an option to the Thread constructor, something like raise_exc, that defaults to False, but when set to True, causes join() to raise any exceptions. 2. (Better, IMO) Add this option to the join() method instead. 3. Create a new method, join_with_exc(), that acts like join() but raises exceptions from the target. 4. (Should probably do this anyway, regardless of what else we do) Add a new method, check_exc(), that checks if any unhandled exceptions have occurred in the thread and returns and/or raises any that have. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 17:03:42 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 19 Apr 2019 21:03:42 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within In-Reply-To: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> Message-ID: <1555707822.68.0.681092744917.issue36666@roundup.psfhosted.org> Eric Snow added the comment: Here's a basic decorator along those lines, similar to one that I've used on occasion: def as_thread(target): def _target(): try: t.result = target() except Exception as exc: t.failure = exc t = threading.Thread(target=_target) return t Sure, it's border-line non-trivial, but I'd hardly call it "exceptionally complicated". Variations for more flexibility: def as_thread(target=None, **tkwds): # A decorator to create a one-off thread from a function. if target is None: # Used as a decorator factory return lambda target: as_thread(target, **tkwds) def _target(*args, **kwargs): try: t.result = target(*args, **kwargs) except Exception as exc: t.failure = exc t = threading.Thread(target=_target, **tkwds) return t def threaded(target, **tkwds): # A decorator to produce a started thread when the "function" is called. if target is None: # Used as a decorator factory return lambda target: as_thread(target, **tkwds) @functools.wraps(target) def wrapper(*targs, **tkwargs) def _target(*args, *kwargs): try: t.result = target(*args, **kwargs) except Exception as exc: t.failure = exc t = threading.Thread(target=_target, args=targs, kwargs=tkwargs, **tkwds) t.start() return t return wrapper ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 17:07:47 2019 From: report at bugs.python.org (Joel Croteau) Date: Fri, 19 Apr 2019 21:07:47 +0000 Subject: [issue36666] threading.Thread should have way to catch an exception thrown within In-Reply-To: <1555637775.9.0.13238688405.issue36666@roundup.psfhosted.org> Message-ID: <1555708067.29.0.228273823297.issue36666@roundup.psfhosted.org> Joel Croteau added the comment: Yes, I know there are workarounds for it, I have seen many, and everyone seems to have their own version. I'm saying we shouldn't need workarounds though?this should be built in functionality. Ideally, dropping an exception should never be default behavior, but I understand not wanting to break existing code, that's why I'm saying add additional functionality to make these checks easier and not require hacky, un-pythonic wrappers and other methods to find out if your code actually worked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 19:32:44 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 19 Apr 2019 23:32:44 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1555716764.91.0.565410829125.issue36643@roundup.psfhosted.org> Change by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 20:37:23 2019 From: report at bugs.python.org (Windson Yang) Date: Sat, 20 Apr 2019 00:37:23 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555720643.51.0.695993057205.issue36661@roundup.psfhosted.org> Windson Yang added the comment: I can find some example in the docs that didn't `import the correct module` even in the first example. Should we add the `import` statement for all of them? ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 20:55:12 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 20 Apr 2019 00:55:12 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555721712.44.0.719963913104.issue36650@roundup.psfhosted.org> Raymond Hettinger added the comment: For the record, here's what is going on. The method_cache() code uses a slightly different invocation for the first call than for subsequent calls. In particular, the wrapper() uses **kwargs with an empty dict whereas the first call didn't use keyword arguments at all. The C version of the lru_cache() is treating that first call as distinct from the second call, resulting in a cache miss for the both the first and second invocation but not in subsequent invocations. The pure python lru_cache() has a memory saving fast path taken when kwds is an empty dict. The C version is out-of-sync with because it runs the that path only when kwds==NULL and it doesn't check for the case where kwds is an empty dict. Here's a minimal reproducer: @lru_cache() def f(x): pass f(0) f(0, **{}) assert f.cache_info().hits == 1 Here's a possible fix: diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 3f1c01651d..f118119479 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -751,7 +751,7 @@ lru_cache_make_key(PyObject *args, PyObject *kwds, int typed) Py_ssize_t key_size, pos, key_pos, kwds_size; /* short path, key will match args anyway, which is a tuple */ - if (!typed && !kwds) { + if (!typed && (!kwds || PyDict_GET_SIZE(kwds) == 0)) { if (PyTuple_GET_SIZE(args) == 1) { key = PyTuple_GET_ITEM(args, 0); if (PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 21:34:47 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 20 Apr 2019 01:34:47 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555724087.22.0.113349774996.issue36650@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +12806 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 19 22:26:37 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 20 Apr 2019 02:26:37 +0000 Subject: [issue36665] REPL doesn't ensure builtins are available when implicitly recreating __main__ In-Reply-To: <1555635716.01.0.208381953469.issue36665@roundup.psfhosted.org> Message-ID: <1555727197.86.0.935154304195.issue36665@roundup.psfhosted.org> Terry J. Reedy added the comment: To me, the failure of dir() in message 1 is surprising and possibly a bug. I always though of a module globals = locals = dict() instance as continuous across statements, whether in batch or interactive move. In batch mode import sys mod = sys.modules[__name__] sys.modules[__name__] print(dir()) works. Adding '-i' to the command line is supposed to allow one to enter interactive statements to be executed in the same namespace. In IDLE's Shell, dir() in msg 1 executes normally. This is because idlelib.run.Executive() initializes the instance by caching globals(). self.locals = __main__.__dict__ Then self.runcode(self, code) executes user statements with exec(code, self.locals) With exec in the old statement form of 'exec code in self.locals', this pair predates the first patch git has access to, on 5/26/2002 (GvR, committed by Chui Tey). Could and should, python do similarly, and keep a reference to the module namespace? What did Python do in 2002? What do other implementations and simulated Shells do now? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 02:41:05 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 20 Apr 2019 06:41:05 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555742465.66.0.95309657267.issue36670@roundup.psfhosted.org> Terry J. Reedy added the comment: 'crash' mean *nix coredump or Windows equivelent, rather than traceback. ---------- components: +Windows nosy: +paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:02:43 2019 From: report at bugs.python.org (Kadam Parikh) Date: Sat, 20 Apr 2019 07:02:43 +0000 Subject: [issue36671] str.lower() looses character information when working with UTF-8 Message-ID: <1555743763.0.0.340048392729.issue36671@roundup.psfhosted.org> New submission from Kadam Parikh : When converting a particular UTF-8 character "?" to lowercase, it doesn't behave correctly. It returns two lowercase characters instead of one. This is not as desired. Code: >>> print("\u0130") ? >>> print("\u0130".lower()) i? >>> ---------- components: Unicode messages: 340563 nosy: Kadam Parikh, ezio.melotti, vstinner priority: normal severity: normal status: open title: str.lower() looses character information when working with UTF-8 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:10:18 2019 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 20 Apr 2019 07:10:18 +0000 Subject: [issue36672] A compiler warning in winreg.SetValue() Message-ID: <1555744218.52.0.272239256481.issue36672@roundup.psfhosted.org> New submission from Zackery Spytz : The warning can be seen on some buildbots (e.g. https://buildbot.python.org/all/#/builders/12/builds/2269). d:\buildarea\3.x.ware-win81-release\build\pc\winreg.c(1617): warning C4244: 'function': conversion from 'Py_ssize_clean_t' to 'DWORD', possible loss of data ---------- components: Windows messages: 340564 nosy: ZackerySpytz, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: A compiler warning in winreg.SetValue() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:12:46 2019 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 20 Apr 2019 07:12:46 +0000 Subject: [issue36672] A compiler warning in winreg.SetValue() In-Reply-To: <1555744218.52.0.272239256481.issue36672@roundup.psfhosted.org> Message-ID: <1555744366.07.0.17480530334.issue36672@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12807 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:33:22 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 07:33:22 +0000 Subject: [issue36673] Comment/PI parsing support for ElementTree Message-ID: <1555745602.83.0.523900497502.issue36673@roundup.psfhosted.org> New submission from Stefan Behnel : The TreeBuilder in xml.etree.ElementTree ignores comments and processing instructions. It should at least have a way to pass them through, even if there is not currently a way to append comments and PIs to the tree when they appear *outside* of the root element. The pull parser interface would directly benefit from this, because it can then report "comment" and "pi" events. ---------- assignee: scoder components: Library (Lib), XML messages: 340565 nosy: scoder priority: normal severity: normal stage: needs patch status: open title: Comment/PI parsing support for ElementTree type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:35:26 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 07:35:26 +0000 Subject: [issue36673] Comment/PI parsing support for ElementTree In-Reply-To: <1555745602.83.0.523900497502.issue36673@roundup.psfhosted.org> Message-ID: <1555745726.76.0.872186055205.issue36673@roundup.psfhosted.org> Stefan Behnel added the comment: This is related to issue9521 but not a strict duplicate, because fixing that would require actually adding comments and PIs to the tree when they are not within the root element. When they are, it's in line with the current tree model and this change will do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:48:26 2019 From: report at bugs.python.org (SilentGhost) Date: Sat, 20 Apr 2019 07:48:26 +0000 Subject: [issue36671] str.lower() looses character information when working with UTF-8 In-Reply-To: <1555743763.0.0.340048392729.issue36671@roundup.psfhosted.org> Message-ID: <1555746506.32.0.476605345935.issue36671@roundup.psfhosted.org> SilentGhost added the comment: This is the behaviour according to the Unicode standard version 11. This is not an oversight on part of CPython implementation, this character (among others) lowercases to two characters. ---------- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 03:49:38 2019 From: report at bugs.python.org (SilentGhost) Date: Sat, 20 Apr 2019 07:49:38 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1555746578.68.0.192319090866.issue36669@roundup.psfhosted.org> Change by SilentGhost : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 04:52:42 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 08:52:42 +0000 Subject: [issue36673] Comment/PI parsing support for ElementTree In-Reply-To: <1555745602.83.0.523900497502.issue36673@roundup.psfhosted.org> Message-ID: <1555750362.94.0.875966866956.issue36673@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +12808 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 04:58:42 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 08:58:42 +0000 Subject: [issue36673] Comment/PI parsing support for ElementTree In-Reply-To: <1555745602.83.0.523900497502.issue36673@roundup.psfhosted.org> Message-ID: <1555750722.04.0.328036971845.issue36673@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +eli.bendersky, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 05:18:43 2019 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 20 Apr 2019 09:18:43 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555751923.13.0.492597581085.issue36661@roundup.psfhosted.org> Eric V. Smith added the comment: I won't discourage anyone from making such changes, but I don't think it's a real problem. I haven't seen that people are confused about needing to import the module being discussed in the documentation. I don't think there's any expectation that the code in the documentation is actually executable as-is. They're not doctests, after all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 05:20:54 2019 From: report at bugs.python.org (Dieter Maurer) Date: Sat, 20 Apr 2019 09:20:54 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) Message-ID: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> New submission from Dieter Maurer : Currently, "TestCase.run" supports several features to control testing - among others, a test can be skipped via the attribute "__unittest_skip__". "TestCase.debug" ignores all those controls and calls the test method unconditionally. I am using "zope.testrunner" to run test suites. Its "-D" option switches from "TestCase.run" to "TestCase.debug" in order to allow the analysis of the state of a failing test in the Python debugger. "-D" is typically used if a test in a larger suite failed and a detailed analysis is required to determine the failure's cause. It is important that this second run executes the same tests as the first run; it is not helpful when the second run fails in a test skipped in the first run. Therefore, "TestCase.debug" should honour all test controls supported by "TestCase.run". One could argue that the testsuite runner should implement this logic. However, this would force the runner to duplicate the test control logic using internal implementation details of "unittest". Conceptually, it is much nicer to have the test control encapsulated by "unittest". ---------- components: Library (Lib) messages: 340569 nosy: dmaurer priority: normal severity: normal status: open title: "unittest.TestCase.debug" should honour "skip" (and other test controls) type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 05:47:50 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 20 Apr 2019 09:47:50 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1555753670.45.0.829142054236.issue36674@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 06:43:50 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 20 Apr 2019 10:43:50 +0000 Subject: [issue36675] Doctest directives and comments not visible or missing from code samples Message-ID: <1555757030.56.0.8094269644.issue36675@roundup.psfhosted.org> New submission from Steven D'Aprano : (Apologies if this is the wrong place for reporting website bugs.) The website is not rendering doctest directives or comments, either that or the comments have been stripped from the examples. On the doctest page itself, all the comments are missing: https://docs.python.org/3/library/doctest.html#directives The first example says: >>> print(list(range(20))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] but without the directive, the test would fail. Screen shot attached. Doctest directives are also missing from here: https://docs.python.org/3/library/ctypes.html My browser: Firefox 45.1.1 Also checked with text browser "lynx". ---------- assignee: docs at python components: Documentation files: missing_directives.png messages: 340570 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: Doctest directives and comments not visible or missing from code samples type: behavior Added file: https://bugs.python.org/file48277/missing_directives.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 06:48:04 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 20 Apr 2019 10:48:04 +0000 Subject: [issue26219] implement per-opcode cache in ceval In-Reply-To: <1453918500.26.0.0886095278127.issue26219@psf.upfronthosting.co.za> Message-ID: <1555757284.69.0.274888201028.issue26219@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +12809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 06:58:36 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 20 Apr 2019 10:58:36 +0000 Subject: [issue36675] Doctest directives and comments not visible or missing from code samples In-Reply-To: <1555757030.56.0.8094269644.issue36675@roundup.psfhosted.org> Message-ID: <1555757916.61.0.820253344525.issue36675@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 07:06:44 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 11:06:44 +0000 Subject: [issue36676] Make TreeBuilder aware of namespace prefixes Message-ID: <1555758404.88.0.535141671486.issue36676@roundup.psfhosted.org> New submission from Stefan Behnel : The XMLPullParser has 'start-ns' and 'end-ns' events, but the parser targets don't see them. They should have "start_ns()" and "end_ns()" callback methods to allow namespace prefix aware parsing. ---------- assignee: scoder components: Library (Lib), XML messages: 340571 nosy: scoder priority: normal severity: normal status: open title: Make TreeBuilder aware of namespace prefixes type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 07:24:19 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 11:24:19 +0000 Subject: [issue36676] Make ET.XMLParser target aware of namespace prefixes In-Reply-To: <1555758404.88.0.535141671486.issue36676@roundup.psfhosted.org> Message-ID: <1555759459.25.0.718303084421.issue36676@roundup.psfhosted.org> Change by Stefan Behnel : ---------- title: Make TreeBuilder aware of namespace prefixes -> Make ET.XMLParser target aware of namespace prefixes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 07:30:20 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 11:30:20 +0000 Subject: [issue36673] Comment/PI parsing support for ElementTree In-Reply-To: <1555745602.83.0.523900497502.issue36673@roundup.psfhosted.org> Message-ID: <1555759820.63.0.315855528535.issue36673@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: +12811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 07:30:20 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 11:30:20 +0000 Subject: [issue36676] Make ET.XMLParser target aware of namespace prefixes In-Reply-To: <1555758404.88.0.535141671486.issue36676@roundup.psfhosted.org> Message-ID: <1555759820.57.0.84020369689.issue36676@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +12810 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 07:30:51 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 20 Apr 2019 11:30:51 +0000 Subject: [issue36676] Make ET.XMLParser target aware of namespace prefixes In-Reply-To: <1555758404.88.0.535141671486.issue36676@roundup.psfhosted.org> Message-ID: <1555759851.96.0.902259871288.issue36676@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +eli.bendersky, serhiy.storchaka stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 09:00:36 2019 From: report at bugs.python.org (Windson Yang) Date: Sat, 20 Apr 2019 13:00:36 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555765236.26.0.617442480624.issue36661@roundup.psfhosted.org> Windson Yang added the comment: I agreed most of the documents won't need the change, but some documents like https://docs.python.org/3/library/dataclasses.html#dataclasses.field didn't mention we have to run `from typing import List` and I guess most developers not familiar with this package. I suggest we should add the import statement for the uncommon package. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 09:25:45 2019 From: report at bugs.python.org (Manjusaka) Date: Sat, 20 Apr 2019 13:25:45 +0000 Subject: [issue36677] support visual studio multiprocess compile Message-ID: <1555766745.04.0.89455558055.issue36677@roundup.psfhosted.org> New submission from Manjusaka : Support multiprocess compile when the developer uses the Visual studio on the Windows ---------- components: Windows messages: 340573 nosy: Manjusaka, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: support visual studio multiprocess compile versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 09:29:56 2019 From: report at bugs.python.org (Manjusaka) Date: Sat, 20 Apr 2019 13:29:56 +0000 Subject: [issue36677] support visual studio multiprocess compile In-Reply-To: <1555766745.04.0.89455558055.issue36677@roundup.psfhosted.org> Message-ID: <1555766996.95.0.552031428565.issue36677@roundup.psfhosted.org> Change by Manjusaka : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 10:18:31 2019 From: report at bugs.python.org (Christopher Hunt) Date: Sat, 20 Apr 2019 14:18:31 +0000 Subject: [issue35792] Specifying AbstractEventLoop.run_in_executor as a coroutine conflicts with implementation/intent In-Reply-To: <1548039558.68.0.986540752255.issue35792@roundup.psfhosted.org> Message-ID: <1555769911.77.0.116196486702.issue35792@roundup.psfhosted.org> Christopher Hunt added the comment: For impl.1: > (very breaking change) should be > (very breaking change, mitigated some by the fact that the implementation will warn about the unawaited future) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 10:39:46 2019 From: report at bugs.python.org (Steve Dower) Date: Sat, 20 Apr 2019 14:39:46 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555771186.2.0.34852585077.issue36670@roundup.psfhosted.org> Steve Dower added the comment: It'll probably be mbcs or oem encoding. Certainly not UTF-8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 11:09:47 2019 From: report at bugs.python.org (Eryk Sun) Date: Sat, 20 Apr 2019 15:09:47 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555772987.04.0.931298144514.issue36670@roundup.psfhosted.org> Eryk Sun added the comment: > It'll probably be mbcs or oem encoding. Certainly not UTF-8 Unless the system locale's codepage is set to UTF-8 in Windows 10. I stepped through this in the debugger. When writing to a pipe, typeperf.exe calls WideCharToMultiByte(CP_OEMCP, ...), so it's "oem". ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 11:32:40 2019 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 20 Apr 2019 15:32:40 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555774360.9.0.194438054834.issue36661@roundup.psfhosted.org> Eric V. Smith added the comment: I definitely think any missing import from typing should be added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 11:55:28 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 15:55:28 +0000 Subject: [issue36678] duplicate method definitions in Lib/test/test_dataclasses.py Message-ID: <1555775728.19.0.814114535778.issue36678@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following methodes are duplicates: Lib/test/test_dataclasses.py:700 TestCase.test_not_tuple Lib/test/test_dataclasses.py:1406 TestCase.test_helper_asdict_builtin_containers Lib/test/test_dataclasses.py:1579 TestCase.test_helper_astuple_builtin_containers Lib/test/test_dataclasses.py:3245 TestReplace.test_recursive_repr_two_attrs ---------- components: Library (Lib) messages: 340578 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definitions in Lib/test/test_dataclasses.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 11:59:38 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 15:59:38 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py Message-ID: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/test/test_genericclass.py:161 TestClassGetitem.test_class_getitem ---------- components: Library (Lib) messages: 340579 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definition in Lib/test/test_genericclass.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:02:29 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:02:29 +0000 Subject: [issue36680] duplicate method definition in Lib/test/test_importlib/test_util.py Message-ID: <1555776149.55.0.853112327072.issue36680@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/test/test_importlib/test_util.py:755 PEP3147Tests.test_source_from_cache_path_like_arg ---------- components: Library (Lib) messages: 340580 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definition in Lib/test/test_importlib/test_util.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:04:43 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:04:43 +0000 Subject: [issue36681] duplicate method definition in Lib/test/test_logging.py Message-ID: <1555776283.44.0.382290590702.issue36681@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/test/test_logging.py:328 BuiltinLevelsTest.test_regression_29220 ---------- components: Library (Lib) messages: 340581 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definition in Lib/test/test_logging.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:08:20 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:08:20 +0000 Subject: [issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py Message-ID: <1555776500.63.0.359750321582.issue36682@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following methods are duplicates: Lib/test/test_sys_setprofile.py:354 ProfileSimulatorTestCase.test_unbound_method_no_args Lib/test/test_sys_setprofile.py:363 ProfileSimulatorTestCase.test_unbound_method_invalid_args ---------- components: Library (Lib) messages: 340582 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definitions in Lib/test/test_sys_setprofile.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:10:14 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:10:14 +0000 Subject: [issue36683] duplicate method definition in Lib/test/test_utf8_mode.py Message-ID: <1555776614.31.0.832242060156.issue36683@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/test/test_utf8_mode.py: UTF8ModeTests.test_io_encoding ---------- components: Library (Lib) messages: 340583 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definition in Lib/test/test_utf8_mode.py type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:12:39 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 20 Apr 2019 16:12:39 +0000 Subject: [issue36678] duplicate method definitions in Lib/test/test_dataclasses.py In-Reply-To: <1555775728.19.0.814114535778.issue36678@roundup.psfhosted.org> Message-ID: <1555776759.44.0.0784062264259.issue36678@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:18:20 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:18:20 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555777100.85.0.255448151509.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: List of issues entered for all the current duplicate method definitions: #19113 #19119 #36678 #36679 #36680 #36681 #36682 #36683 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:25:57 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:25:57 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555777557.08.0.453718712953.issue16079@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- pull_requests: +12812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:41:45 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 20 Apr 2019 16:41:45 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555778505.49.0.821520393817.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: PR 12886 adds a check on duplicate method definitions to the travis() function of patchcheck.py. False positives must be entered to Tools/scripts/duplicates_ignored.txt. The existing duplicates have been entered to this file (with the corresponding bpo issue number in comment) and no duplicates are found currently by duplicate_meth_defs.py when run with '--ignore duplicates_ignored.txt'. It is expected that these entries would be removed from this file when their issues are closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 12:51:48 2019 From: report at bugs.python.org (Utkarsh Gupta) Date: Sat, 20 Apr 2019 16:51:48 +0000 Subject: [issue36008] [good first issue] Update documentation for 3.8 In-Reply-To: <1550278435.56.0.94881175235.issue36008@roundup.psfhosted.org> Message-ID: <1555779108.12.0.380650487686.issue36008@roundup.psfhosted.org> Change by Utkarsh Gupta : ---------- keywords: +patch pull_requests: +12813 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 13:20:48 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 20 Apr 2019 17:20:48 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555780848.31.0.274311943086.issue36650@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 14adbd45980f705cb6554ca17b8a66b56e105296 by Raymond Hettinger in branch 'master': bpo-36650: Fix handling of empty keyword args in C version of lru_cache. (GH-12881) https://github.com/python/cpython/commit/14adbd45980f705cb6554ca17b8a66b56e105296 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 13:21:08 2019 From: report at bugs.python.org (miss-islington) Date: Sat, 20 Apr 2019 17:21:08 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555780868.15.0.908583465254.issue36650@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12814 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 13:50:35 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 20 Apr 2019 17:50:35 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555782635.21.0.163172529723.issue36650@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 8b30ee843528d0f0e2bfc3307d86658915579c21 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-36650: Fix handling of empty keyword args in C version of lru_cache. (GH-12881) (GH-12888) https://github.com/python/cpython/commit/8b30ee843528d0f0e2bfc3307d86658915579c21 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 13:51:10 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 20 Apr 2019 17:51:10 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555782670.07.0.152466926792.issue36650@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 18:42:57 2019 From: report at bugs.python.org (Matej Cepl) Date: Sat, 20 Apr 2019 22:42:57 +0000 Subject: [issue36650] Cached method implementation no longer works on Python 3.7.3 In-Reply-To: <1555526743.8.0.00197120630523.issue36650@roundup.psfhosted.org> Message-ID: <1555800177.3.0.556702044029.issue36650@roundup.psfhosted.org> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 18:46:46 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 20 Apr 2019 22:46:46 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1555800406.14.0.398737554053.issue28724@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- pull_requests: +12815 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 18:49:26 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 20 Apr 2019 22:49:26 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1555800566.27.0.640418755305.issue28724@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 19:55:19 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sat, 20 Apr 2019 23:55:19 +0000 Subject: [issue36684] codecov.io code coverage has not updated since 2019-04-13 Message-ID: <1555804519.07.0.0840911433327.issue36684@roundup.psfhosted.org> New submission from Gordon P. Hemsley : The last commit available on codecov.io is from a week ago (d28aaa7df8bcd46f4135d240d041b0b171b664cc): https://codecov.io/gh/python/cpython And the widget on the README is showing a status of "unknown". ---------- messages: 340588 nosy: gphemsley priority: normal severity: normal status: open title: codecov.io code coverage has not updated since 2019-04-13 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 20:00:12 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 00:00:12 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1555804812.87.0.221599296251.issue32424@roundup.psfhosted.org> Gordon P. Hemsley added the comment: Taking a step back, I want to make sure I understand the action items for resolving this: * Add copy() as an alias to __copy__() in the C implementation to match the Python implementation. * Deprecate copy() in favor of copy.copy() in both the Python and C implementations, bypassing a PendingDeprecation step because the implementations have been out of sync for so long as it is. Any other issues discussed here are orthogonal to the goal of this ticket. Are we in agreement on this? ---------- versions: +Python 3.8, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 20:07:40 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 00:07:40 +0000 Subject: [issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element Message-ID: <1555805260.45.0.823683701543.issue36685@roundup.psfhosted.org> New submission from Gordon P. Hemsley : In the process of investigating and writing tests for issue32424, I discovered that the C implementation of xml.etree.ElementTree does not make a copy of the attrib argument when creating a new element, allowing the attributes of the element to be modified outside of creation. The Python implementation does not have this problem. ---------- components: Library (Lib), XML messages: 340590 nosy: asvetlov, eli.bendersky, gphemsley, mdk, p-ganssle, r.david.murray, scoder, serhiy.storchaka, thatiparthy priority: normal severity: normal status: open title: C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 20:09:23 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 00:09:23 +0000 Subject: [issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element In-Reply-To: <1555805260.45.0.823683701543.issue36685@roundup.psfhosted.org> Message-ID: <1555805363.18.0.745425632055.issue36685@roundup.psfhosted.org> Gordon P. Hemsley added the comment: My proposed solution to this was to make a copy of the attrib dictionary in the create_new_element() method in the C implementation, which solves the problem. However, this was apparently objected to on the grounds of performance. Not knowing C very well, any guidance on a better way to fix this would be appreciated. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 20:09:57 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 00:09:57 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1555805397.1.0.284920525618.issue32424@roundup.psfhosted.org> Gordon P. Hemsley added the comment: Opened issue36685 for discussion of the attrib copy issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 20:59:53 2019 From: report at bugs.python.org (Windson Yang) Date: Sun, 21 Apr 2019 00:59:53 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1555808393.44.0.47415509448.issue36679@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12816 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:04:45 2019 From: report at bugs.python.org (Simon Bernier St-Pierre) Date: Sun, 21 Apr 2019 01:04:45 +0000 Subject: [issue36686] Docs: asyncio.loop.subprocess_exec documentation is confusing, it's not clear how to inherit stdin, stdout or stderr in the subprocess Message-ID: <1555808685.63.0.20312678962.issue36686@roundup.psfhosted.org> New submission from Simon Bernier St-Pierre : I had trouble figuring out how to simply inherit stdin, stdout, or stderr in the asyncio.create_subprocess_exec / asyncio.subprocess_exec docs. My experiments show that passing either None or `sys.std*` works but the way the docs are written make it hard to figure that out in my opinion. > stdout: either a file-like object representing the pipe to be connected to the subprocess?s standard output stream using connect_read_pipe(), or the subprocess.PIPE constant (default). By default a new pipe will be created and connected. I would add a mention that using None makes the subprocess inherit the file descriptor. ---------- components: asyncio messages: 340593 nosy: asvetlov, sbstp, yselivanov priority: normal severity: normal status: open title: Docs: asyncio.loop.subprocess_exec documentation is confusing, it's not clear how to inherit stdin, stdout or stderr in the subprocess versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:14:55 2019 From: report at bugs.python.org (Simon Bernier St-Pierre) Date: Sun, 21 Apr 2019 01:14:55 +0000 Subject: [issue36687] subprocess encoding Message-ID: <1555809295.79.0.124868679874.issue36687@roundup.psfhosted.org> Change by Simon Bernier St-Pierre : ---------- nosy: sbstp priority: normal severity: normal status: open title: subprocess encoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:15:20 2019 From: report at bugs.python.org (Simon Bernier St-Pierre) Date: Sun, 21 Apr 2019 01:15:20 +0000 Subject: [issue36687] subprocess encoding Message-ID: <1555809320.8.0.579053761405.issue36687@roundup.psfhosted.org> Change by Simon Bernier St-Pierre : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:16:37 2019 From: report at bugs.python.org (Windson Yang) Date: Sun, 21 Apr 2019 01:16:37 +0000 Subject: [issue36680] duplicate method definition in Lib/test/test_importlib/test_util.py In-Reply-To: <1555776149.55.0.853112327072.issue36680@roundup.psfhosted.org> Message-ID: <1555809397.37.0.6772185886.issue36680@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12817 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:20:47 2019 From: report at bugs.python.org (Windson Yang) Date: Sun, 21 Apr 2019 01:20:47 +0000 Subject: [issue36681] duplicate method definition in Lib/test/test_logging.py In-Reply-To: <1555776283.44.0.382290590702.issue36681@roundup.psfhosted.org> Message-ID: <1555809647.39.0.612250417279.issue36681@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12818 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:27:37 2019 From: report at bugs.python.org (Simon Bernier St-Pierre) Date: Sun, 21 Apr 2019 01:27:37 +0000 Subject: [issue36686] Docs: asyncio.loop.subprocess_exec documentation is confusing, it's not clear how to inherit stdin, stdout or stderr in the subprocess In-Reply-To: <1555808685.63.0.20312678962.issue36686@roundup.psfhosted.org> Message-ID: <1555810057.67.0.307241265054.issue36686@roundup.psfhosted.org> Simon Bernier St-Pierre added the comment: Could be cool to also mention that `encoding` / `errors` does not work yet. https://bugs.python.org/issue31087 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:49:54 2019 From: report at bugs.python.org (Windson Yang) Date: Sun, 21 Apr 2019 01:49:54 +0000 Subject: [issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py In-Reply-To: <1555776500.63.0.359750321582.issue36682@roundup.psfhosted.org> Message-ID: <1555811394.07.0.930925106835.issue36682@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12819 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:55:31 2019 From: report at bugs.python.org (Windson Yang) Date: Sun, 21 Apr 2019 01:55:31 +0000 Subject: [issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py In-Reply-To: <1555776500.63.0.359750321582.issue36682@roundup.psfhosted.org> Message-ID: <1555811731.77.0.843232864702.issue36682@roundup.psfhosted.org> Change by Windson Yang : ---------- pull_requests: +12820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 21:55:54 2019 From: report at bugs.python.org (Windson Yang) Date: Sun, 21 Apr 2019 01:55:54 +0000 Subject: [issue36683] duplicate method definition in Lib/test/test_utf8_mode.py In-Reply-To: <1555776614.31.0.832242060156.issue36683@roundup.psfhosted.org> Message-ID: <1555811754.9.0.00209183670102.issue36683@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12821 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 20 23:29:55 2019 From: report at bugs.python.org (paul j3) Date: Sun, 21 Apr 2019 03:29:55 +0000 Subject: [issue36664] argparse: parser aliases in subparsers stores alias in dest variable In-Reply-To: <1555630232.08.0.518571967107.issue36664@roundup.psfhosted.org> Message-ID: <1555817395.59.0.651139947319.issue36664@roundup.psfhosted.org> paul j3 added the comment: https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers shows how to use `set_defaults` in a parser to set a 'func' attribute. That method could just as well be used to set the true 'name' or any other kind of attribute that is unique to that parser. I think we should leave the code as is, storing the aliases in the subparsers' 'dest'. It's been that way since aliases were added, and changing it runs the risk of creating backward compatibility issues. There are enough work arounds if you don't want the aliases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 02:05:06 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 21 Apr 2019 06:05:06 +0000 Subject: [issue33777] dummy_threading: .is_alive method returns True after execution has completed In-Reply-To: <1528250405.09.0.592728768989.issue33777@psf.upfronthosting.co.za> Message-ID: <1555826706.44.0.509219781798.issue33777@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: https://bugs.python.org/issue29376#msg286873 . Is this an intentional behavior for dummy_threading to always return True for is_alive? ---------- nosy: +pitrou, xiang.zhang, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 02:20:08 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 21 Apr 2019 06:20:08 +0000 Subject: [issue36688] import dummy_threading causes ImportError Message-ID: <1555827608.59.0.767546227499.issue36688@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : importing dummy_threading causes ImportError. It used to work on 3.6. There are tests at Lib/test/test_dummy_threading.py and rearranging the import so that "import dummy_threading as _threading" is the first line also causes error. This module was deprecated from 3.7 with respect to threading enabled always but I thought to add a report anyway. Looking at git log it seems a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 did some changes where catching the ImportError on Lib/functools.py was removed that could be causing this issue. Importing functools before dummy_threading works. # master with functools imported before dummy_threading ? cpython git:(master) ? ./python.exe -c 'import functools; import dummy_threading; print("hello")' hello # Python 3.6 $ python3.6 -c 'import dummy_threading; print("hello")' hello # Python 3.7 $ python3.7 -c 'import dummy_threading' Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/dummy_threading.py", line 45, in import threading File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 8, in from traceback import format_exc as _format_exc File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/traceback.py", line 5, in import linecache File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/linecache.py", line 8, in import functools File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/functools.py", line 24, in from _thread import RLock ImportError: cannot import name 'RLock' from '_dummy_thread' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_dummy_thread.py) # master $ cpython git:(master) ./python.exe -c 'import dummy_threading' Traceback (most recent call last): File "", line 1, in File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/dummy_threading.py", line 45, in import threading File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/threading.py", line 8, in from traceback import format_exc as _format_exc File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/traceback.py", line 5, in import linecache File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/linecache.py", line 8, in import functools File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/functools.py", line 20, in from _thread import RLock ImportError: cannot import name 'RLock' from '_dummy_thread' (/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/_dummy_thread.py) # Patch to move dummy_threading import as first line diff --git a/Lib/test/test_dummy_threading.py b/Lib/test/test_dummy_threading.py index a0c2972a60..dc40abeda5 100644 --- a/Lib/test/test_dummy_threading.py +++ b/Lib/test/test_dummy_threading.py @@ -1,6 +1,6 @@ +import dummy_threading as _threading from test import support import unittest -import dummy_threading as _threading import time class DummyThreadingTestCase(unittest.TestCase): ? cpython git:(master) ? ./python.exe Lib/test/test_dummy_threading.py Traceback (most recent call last): File "Lib/test/test_dummy_threading.py", line 1, in import dummy_threading as _threading File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/dummy_threading.py", line 45, in import threading File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/threading.py", line 8, in from traceback import format_exc as _format_exc File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/traceback.py", line 5, in import linecache File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/linecache.py", line 8, in import functools File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/functools.py", line 20, in from _thread import RLock ImportError: cannot import name 'RLock' from '_dummy_thread' (/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/_dummy_thread.py) ---------- components: Library (Lib) messages: 340597 nosy: brett.cannon, pitrou, xtreak priority: normal severity: normal status: open title: import dummy_threading causes ImportError type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 02:23:34 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 21 Apr 2019 06:23:34 +0000 Subject: [issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element In-Reply-To: <1555805260.45.0.823683701543.issue36685@roundup.psfhosted.org> Message-ID: <1555827814.59.0.466926558487.issue36685@roundup.psfhosted.org> Stefan Behnel added the comment: Instead of always copying the dict in create_new_element(), we should make sure that all code that calls that function (directly or indirectly) does so with a safely owned dict. If that means that we need to add dict copying in some other place, then that's what's needed to fix this bug. The best fix is to make the copy close to the user input, where we know what we received and how we will continue to use it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 02:28:43 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 21 Apr 2019 06:28:43 +0000 Subject: [issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element In-Reply-To: <1555805260.45.0.823683701543.issue36685@roundup.psfhosted.org> Message-ID: <1555828123.38.0.73576794852.issue36685@roundup.psfhosted.org> Stefan Behnel added the comment: Given that this has probably been like this forever, and thus provably doesn't hurt very much, I would argue that it's not worth fixing this in Py3.7. Not sure about Py2.7, but I think the answer there should be a no, too. ---------- stage: -> needs patch versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 02:36:20 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 21 Apr 2019 06:36:20 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1555828580.4.0.396072785445.issue32424@roundup.psfhosted.org> Stefan Behnel added the comment: We should not add anything to the implementation that we consider legacy elsewhere. Py3 has "always" used the C accelerator module instead of the Python implementation, which suggests that its interface is probably the righter one. So: make sure that the Obvious Ways, copy.copy() and copy.deepcopy(), work nicely for both implementations, and deprecate Element.copy() in Py3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 02:42:33 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 21 Apr 2019 06:42:33 +0000 Subject: [issue22246] add strptime(s, '%s') In-Reply-To: <1408664936.57.0.427329646216.issue22246@psf.upfronthosting.co.za> Message-ID: <1555828953.69.0.0264054667699.issue22246@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 03:17:53 2019 From: report at bugs.python.org (Nate Atkinson) Date: Sun, 21 Apr 2019 07:17:53 +0000 Subject: [issue33777] dummy_threading: .is_alive method returns True after execution has completed In-Reply-To: <1528250405.09.0.592728768989.issue33777@psf.upfronthosting.co.za> Message-ID: <1555831073.49.0.37583781878.issue33777@roundup.psfhosted.org> Nate Atkinson added the comment: To be clear-- is_alive() doesn't *always* return True. It returns True until .join() is called. Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from dummy_threading import Thread >>> def f(): print('foo') ... >>> t = Thread(target=f) >>> t.start() foo >>> t.is_alive() True >>> t.join() >>> t.is_alive() False I would expect is_alive to return True while the target function is executing and return False after the execution has completed. Instead, .is_alive is continuing to return True after execution of the target function has completed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 03:29:50 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 21 Apr 2019 07:29:50 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1555831790.17.0.926098701479.issue32424@roundup.psfhosted.org> Serhiy Storchaka added the comment: Concur with Stefan. Adding the method deprecated from the born looks silly. We should either deprecate the copy() method in the Python implementation, or add an undeprecated method in the C implementation. The latter should be considered as a new feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 03:32:27 2019 From: report at bugs.python.org (Stefan Krah) Date: Sun, 21 Apr 2019 07:32:27 +0000 Subject: [issue26746] struct.pack(): trailing padding bytes on x64 In-Reply-To: <1460536729.2.0.723853097724.issue26746@psf.upfronthosting.co.za> Message-ID: <1555831947.59.0.233138074804.issue26746@roundup.psfhosted.org> Change by Stefan Krah : ---------- nosy: +Eric.Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 03:51:01 2019 From: report at bugs.python.org (Stefan Krah) Date: Sun, 21 Apr 2019 07:51:01 +0000 Subject: [issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs In-Reply-To: <1517894879.39.0.467229070634.issue32780@psf.upfronthosting.co.za> Message-ID: <1555833061.57.0.765505210826.issue32780@roundup.psfhosted.org> Stefan Krah added the comment: Since Terry added me: Yes, this is clearly a bug, but it is a ctypes issue and not a memoryview issue. ctypes issues unfortunately tend to take some time until someone reviews. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 05:09:18 2019 From: report at bugs.python.org (Christoph Reiter) Date: Sun, 21 Apr 2019 09:09:18 +0000 Subject: [issue36689] docs: os.path.commonpath raises ValueError for different drives Message-ID: <1555837758.83.0.507858438764.issue36689@roundup.psfhosted.org> New submission from Christoph Reiter : Since I just got bit by this despite reading the docs: https://docs.python.org/3.8/library/os.path.html#os.path.commonpath It lists various error cases where ValueError is raised but is missing the case where absolute paths on Windows are on different drives and I forgot to handle that: File "C:/building/msys64/mingw64/lib/python3.7\ntpath.py", line 631, in commonpath raise ValueError("Paths don't have the same drive") ValueError: Paths don't have the same drive ---------- assignee: docs at python components: Documentation messages: 340604 nosy: docs at python, lazka priority: normal severity: normal status: open title: docs: os.path.commonpath raises ValueError for different drives type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 06:16:07 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 21 Apr 2019 10:16:07 +0000 Subject: [issue36689] docs: os.path.commonpath raises ValueError for different drives In-Reply-To: <1555837758.83.0.507858438764.issue36689@roundup.psfhosted.org> Message-ID: <1555841767.03.0.829291454594.issue36689@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +easy stage: -> needs patch versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 06:34:03 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 21 Apr 2019 10:34:03 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function In-Reply-To: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> Message-ID: <1555842843.82.0.492541864429.issue36518@roundup.psfhosted.org> Serhiy Storchaka added the comment: Steve, do you mind to create a PEP? I can help with examples and comments, but it is too hard to me to write it myself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 08:52:55 2019 From: report at bugs.python.org (jiawei zhou) Date: Sun, 21 Apr 2019 12:52:55 +0000 Subject: [issue36690] A typing error in demo rpython.py Message-ID: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> New submission from jiawei zhou : Hi. There is an error in file `Tools/demo/rpython.py` at line 22. The original statement is `port = int(port[i+1:])`, but it will crash if the port is specified as parameters. The correct code should be `port = int(host[i+1:])`. Then the program can read specified port from parameter sys.argv[1]. ---------- components: Demos and Tools messages: 340606 nosy: jiawei zhou priority: normal severity: normal status: open title: A typing error in demo rpython.py type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 09:04:32 2019 From: report at bugs.python.org (Thomas Kluyver) Date: Sun, 21 Apr 2019 13:04:32 +0000 Subject: [issue36691] SystemExit & sys.exit : Allow both exit status and message Message-ID: <1555851872.77.0.954312917312.issue36691@roundup.psfhosted.org> New submission from Thomas Kluyver : The SystemExit exception, and consequently the sys.exit() function, take a single parameter which is either an integer exit status for the process, or a message to print to stderr before exiting - in which case the exit status is implicitly 1. In certain situations, it would be useful to pass both an exit status and a message. E.g. when argparse handles '--help', it wants to display a message and exit successfully (status 0). You may also use specific exit codes to indicate different kinds of failure. Printing the message separately before raising SystemExit is not an entirely satisfactory subsitute, because the message attached to the exception is only printed if it is unhandled. E.g. for testing code that may raise SystemExit, it's useful to have the message as part of the exception. I imagine that the trickiest bit of changing this would be ensuring as much backwards compatibility as possible. In particular, SystemExit exceptions have a 'code' attribute which can be either the exit status or the message. ---------- messages: 340607 nosy: takluyver priority: normal severity: normal status: open title: SystemExit & sys.exit : Allow both exit status and message type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 09:25:23 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 21 Apr 2019 13:25:23 +0000 Subject: [issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29 In-Reply-To: <1550225538.04.0.738886867119.issue35998@roundup.psfhosted.org> Message-ID: <1555853123.49.0.389400562006.issue35998@roundup.psfhosted.org> Change by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 09:33:08 2019 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 21 Apr 2019 13:33:08 +0000 Subject: [issue36692] Unexpected stderr output from test_sys_settrace Message-ID: <1555853588.91.0.708286420314.issue36692@roundup.psfhosted.org> New submission from Nick Coghlan : The test output from test_sys_settrace makes it look like a couple of the async tracing tests aren't cleaning up after themselves properly: ``` [ncoghlan at localhost cpython]$ ./python -m test test_sys_settrace Run tests sequentially 0:00:00 load avg: 1.27 [1/1] test_sys_settrace unhandled exception during asyncio.run() shutdown task: ()> exception=RuntimeError("can't send non-None value to a just-started coroutine")> RuntimeError: can't send non-None value to a just-started coroutine unhandled exception during asyncio.run() shutdown task: ()> exception=RuntimeError("can't send non-None value to a just-started coroutine")> RuntimeError: can't send non-None value to a just-started coroutine == Tests result: SUCCESS == 1 test OK. Total duration: 102 ms Tests result: SUCCESS ``` If that output is actually expected as part of the test, it would be helpful if the test printed a message beforehand saying to expect it. Otherwise, it would be desirable for the test to clean up after itself and keep the messages from being displayed in the first place. ---------- components: Tests messages: 340608 nosy: asvetlov, ncoghlan, yselivanov priority: low severity: normal stage: needs patch status: open title: Unexpected stderr output from test_sys_settrace type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 10:13:00 2019 From: report at bugs.python.org (SilentGhost) Date: Sun, 21 Apr 2019 14:13:00 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555855980.64.0.00171203638257.issue36690@roundup.psfhosted.org> SilentGhost added the comment: Would you be interested in submitting a PR on github? Guidelines can be found on https://devguide.python.org/pullrequest/ if you're not sure how to proceed. ---------- nosy: +SilentGhost stage: -> needs patch type: crash -> behavior versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 10:13:21 2019 From: report at bugs.python.org (SilentGhost) Date: Sun, 21 Apr 2019 14:13:21 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555856001.8.0.224810844322.issue36690@roundup.psfhosted.org> Change by SilentGhost : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 11:19:45 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 21 Apr 2019 15:19:45 +0000 Subject: [issue36691] SystemExit & sys.exit : Allow both exit status and message In-Reply-To: <1555851872.77.0.954312917312.issue36691@roundup.psfhosted.org> Message-ID: <1555859985.43.0.535896029589.issue36691@roundup.psfhosted.org> Serhiy Storchaka added the comment: The default handler writes the message of non-integer code to stderr, but in case of '--help', the message should be written to stdout. So this feature is not applicable for it. Are there other examples where this feature can be used? In such cases it is better to write the message explicitly and call sys.exit() with the required exit code. For tests you can use contextlib.redirect_stderr() (or manually replace sys.stderr) to capture the stderr output. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 11:53:48 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 15:53:48 +0000 Subject: [issue36684] codecov.io code coverage has not updated since 2019-04-13 In-Reply-To: <1555804519.07.0.0840911433327.issue36684@roundup.psfhosted.org> Message-ID: <1555862028.19.0.00375627018722.issue36684@roundup.psfhosted.org> Gordon P. Hemsley added the comment: In fact, it seems the last commit on master was 962b028b0c20abcf39594f08b1e5f8c36c4e5f6f 3 months ago, which doesn't even have valid report. The previous commit, 9932a22897ef9905161dac7476e6976370e13515, was the last to have a functioning report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 11:58:25 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 15:58:25 +0000 Subject: [issue36684] codecov.io code coverage has not updated since 2019-04-13 In-Reply-To: <1555804519.07.0.0840911433327.issue36684@roundup.psfhosted.org> Message-ID: <1555862305.54.0.269440511447.issue36684@roundup.psfhosted.org> Gordon P. Hemsley added the comment: It looks like this may be the result of the code coverage being provided by the optional gcc build, which has been failing for quite a while. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 12:03:27 2019 From: report at bugs.python.org (SilentGhost) Date: Sun, 21 Apr 2019 16:03:27 +0000 Subject: [issue36684] codecov.io code coverage has not updated since 2019-04-13 In-Reply-To: <1555804519.07.0.0840911433327.issue36684@roundup.psfhosted.org> Message-ID: <1555862607.54.0.585324228042.issue36684@roundup.psfhosted.org> Change by SilentGhost : ---------- components: +Build nosy: +zach.ware versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 12:09:53 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 16:09:53 +0000 Subject: [issue36684] codecov.io code coverage has not updated since 2019-04-13 In-Reply-To: <1555804519.07.0.0840911433327.issue36684@roundup.psfhosted.org> Message-ID: <1555862993.98.0.282457617244.issue36684@roundup.psfhosted.org> Gordon P. Hemsley added the comment: I'm not sure when the gcc build started failing, but it looks like the commits at the boundary failed due to max build time. Something is apparently too slow to run. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 12:28:47 2019 From: report at bugs.python.org (Donald Hobson) Date: Sun, 21 Apr 2019 16:28:47 +0000 Subject: [issue36693] Minor inconsistancy with types. Message-ID: <1555864127.32.0.643984814529.issue36693@roundup.psfhosted.org> New submission from Donald Hobson : Almost all of python makes the abstraction that ints are a single type of thing, the fact that some ints are too big to store in 8 bytes of memory is abstracted away. This abstraction fails when you try to reverse large ranges. >>> reversed(range(1<<63)) >>> reversed(range(1<<63-1)) >>> type(reversed(range(1<<63-1))) >>> type(reversed(range(1<<63))) >>> type(reversed(range(1<<63-2)))==type(reversed(range(1<<63-1))) True >>> type(reversed(range(1<<63-1)))==type(reversed(range(1<<63))) False ---------- components: Interpreter Core messages: 340614 nosy: Donald Hobson priority: normal severity: normal status: open title: Minor inconsistancy with types. type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 12:44:06 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 16:44:06 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1555865046.37.0.00550194726475.issue32424@roundup.psfhosted.org> Change by Gordon P. Hemsley : ---------- pull_requests: +12822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 13:11:20 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 17:11:20 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects Message-ID: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> New submission from Paul Ellenbogen : Python encounters significant memory fragmentation when unpickling many small objects. I have attached two scripts that I believe demonstrate the issue. When you run "dumpy.py" it will generate a large list of namedtuples, then write that list to a file using pickle. Before it does so, it pauses for user input. Before exiting the script you can view the memory usage in htop or whatever your preferred method is. The "load.py" script loads the file written by dump.py. After loading the data is complete, it waits for user input. The memory usage at the point where the script is waiting for user input is (more than) twice as much in the "load" case as the "dump" case. The small objects in the list I am storing have 3 values, and I have tested three alternative representations: tuple, namedtuple, and a custom class. The namedtuple and custom class both have the memory use/fragmentation issue. The built in tuple type does not have this issue. Using optimize in pickletools doesn't seem to make a difference. Matthew Cowles from the python help list had some good suggestions, and found that the object size themselves, as observed by sys.getsizeof was different before and after pickling. Perhaps this is something other than memory fragmentation, or something in addition to memory fragmentation. Although high water mark is similar for both scripts, the pickling script settles down on a reasonably smaller memory footprint. I would still consider the long run memory waste of unpickling a bug. For example in my use case I will run one instance of the equivalent of pickling script, then run many many instances of the script that unpickles. These scripts were run with Python 3.6.7 (GCC 8.2.0) on Ubuntu 18.10. ---------- components: Library (Lib) files: dump.py messages: 340615 nosy: Ellenbogen, alexandre.vassalotti priority: normal severity: normal status: open title: Excessive memory use or memory fragmentation when unpickling many small objects type: resource usage versions: Python 3.6 Added file: https://bugs.python.org/file48278/dump.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 13:11:38 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 17:11:38 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555866698.43.0.791347362736.issue36694@roundup.psfhosted.org> Change by Paul Ellenbogen : Added file: https://bugs.python.org/file48279/load.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 13:11:43 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 17:11:43 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555866703.52.0.571898528545.issue36694@roundup.psfhosted.org> Change by Paul Ellenbogen : Added file: https://bugs.python.org/file48280/common.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 13:15:37 2019 From: report at bugs.python.org (SilentGhost) Date: Sun, 21 Apr 2019 17:15:37 +0000 Subject: [issue36693] Minor inconsistancy with types. In-Reply-To: <1555864127.32.0.643984814529.issue36693@roundup.psfhosted.org> Message-ID: <1555866937.37.0.705467029705.issue36693@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +christian.heimes versions: +Python 3.7, Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 13:32:32 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 21 Apr 2019 17:32:32 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555867952.13.0.429420832623.issue36694@roundup.psfhosted.org> Serhiy Storchaka added the comment: The difference is because in the first case all floats are the same float object 0.0, but in the second case they are different objects. For more rea?istic comparison use different floats (for example random()). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 14:58:07 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 18:58:07 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555873087.93.0.429278239455.issue36694@roundup.psfhosted.org> Paul Ellenbogen added the comment: Good point. I have created a new version of dump that uses random() instead. float reuse explains the getsizeof difference, but there is still a significant memory usage difference. This makes sense to me because the original code I saw this issue in is more analogous to random() ---------- Added file: https://bugs.python.org/file48281/dump.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 14:58:29 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 18:58:29 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555873109.84.0.708836073458.issue36694@roundup.psfhosted.org> Change by Paul Ellenbogen : Removed file: https://bugs.python.org/file48281/dump.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 14:58:47 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 18:58:47 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555873127.7.0.701680914376.issue36694@roundup.psfhosted.org> Change by Paul Ellenbogen : Added file: https://bugs.python.org/file48282/dump.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 14:58:54 2019 From: report at bugs.python.org (Paul Ellenbogen) Date: Sun, 21 Apr 2019 18:58:54 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1555873134.02.0.0415415566314.issue36694@roundup.psfhosted.org> Change by Paul Ellenbogen : Removed file: https://bugs.python.org/file48278/dump.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 15:18:05 2019 From: report at bugs.python.org (Paul Ganssle) Date: Sun, 21 Apr 2019 19:18:05 +0000 Subject: [issue36693] Reversing large ranges results in a minor type inconsistency In-Reply-To: <1555864127.32.0.643984814529.issue36693@roundup.psfhosted.org> Message-ID: <1555874285.05.0.417826877062.issue36693@roundup.psfhosted.org> Paul Ganssle added the comment: I have edited the title to be a bit more and give more context. Donald, if you feel I have misrepresented your issue, please feel free to tweak it further. ---------- nosy: +p-ganssle title: Minor inconsistancy with types. -> Reversing large ranges results in a minor type inconsistency _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 15:25:42 2019 From: report at bugs.python.org (Paul Ganssle) Date: Sun, 21 Apr 2019 19:25:42 +0000 Subject: [issue36693] Reversing large ranges results in a minor type inconsistency In-Reply-To: <1555864127.32.0.643984814529.issue36693@roundup.psfhosted.org> Message-ID: <1555874742.65.0.359999597113.issue36693@roundup.psfhosted.org> Paul Ganssle added the comment: I believe the relevant code is here: https://github.com/python/cpython/blob/bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d/Objects/rangeobject.c#L1038 It looks like it's a performance enhancement and that for ranges where the beginning and end can fit in a C long, a faster iterator that uses C types under the hood is returned, and for ranges where the boundaries *can't* be represented by a C long, it defaults to the slower `longrange_iterator`, that uses Python integers. It *may* be possible to disguise this from the end user, but I'm not sure if doing so is warranted. I have always treated the specific type returned by `iter()` to be an implementation detail, other than the fact that it is an iterator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 15:26:20 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 21 Apr 2019 19:26:20 +0000 Subject: [issue35149] pip3 show causing Error for ConfigParaser In-Reply-To: <1541179646.4.0.788709270274.issue35149@psf.upfronthosting.co.za> Message-ID: <1555874780.84.0.325305865709.issue35149@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I am able to reproduce this by explicitly setting PYTHONIOENCODING as ascii . But I am not sure about the defaults in Windows (related to your environment, os only?) and perhaps something has changed since 3.6 since it fails when executed under batch script or to close this as a pip related third party issue. (py37-venv) ? cpython git:(master) ? PYTHONIOENCODING=ascii pip3 show ConfigParser Name: configparser Version: 3.7.4 Summary: Updated configparser from Python 3.7 for Python 2.6+. Home-page: https://github.com/jaraco/configparser/ --- Logging error --- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1036, in emit stream.write(msg) UnicodeEncodeError: 'ascii' codec can't encode character '\u0141' in position 8: ordinal not in range(128) Call stack: File "/Users/karthikeyansingaravelan/stuff/python/py37-venv/bin/pip3", line 11, in sys.exit(main()) File "/Users/karthikeyansingaravelan/stuff/python/py37-venv/lib/python3.7/site-packages/pip/_internal/__init__.py", line 78, in main return command.main(cmd_args) File "/Users/karthikeyansingaravelan/stuff/python/py37-venv/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 176, in main status = self.run(options, args) File "/Users/karthikeyansingaravelan/stuff/python/py37-venv/lib/python3.7/site-packages/pip/_internal/commands/show.py", line 47, in run results, list_files=options.files, verbose=options.verbose): File "/Users/karthikeyansingaravelan/stuff/python/py37-venv/lib/python3.7/site-packages/pip/_internal/commands/show.py", line 145, in print_results logger.info("Author: %s", dist.get('author', '')) Message: 'Author: %s' Arguments: ('\u0141ukasz Langa',) Author-email: lukasz at langa.pl License: UNKNOWN ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 15:35:05 2019 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 21 Apr 2019 19:35:05 +0000 Subject: [issue36691] SystemExit & sys.exit : Allow both exit status and message In-Reply-To: <1555851872.77.0.954312917312.issue36691@roundup.psfhosted.org> Message-ID: <1555875305.23.0.423783435128.issue36691@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 16:46:42 2019 From: report at bugs.python.org (Eryk Sun) Date: Sun, 21 Apr 2019 20:46:42 +0000 Subject: [issue35149] pip3 show causing Error for ConfigParaser In-Reply-To: <1541179646.4.0.788709270274.issue35149@psf.upfronthosting.co.za> Message-ID: <1555879602.79.0.247655990559.issue35149@roundup.psfhosted.org> Eryk Sun added the comment: In Windows, Python defaults to the system ANSI codepage (e.g. 1252 in the West) for non-console standard I/O. For the case of a `for /f` loop in CMD, stdout is a pipe, so Python defaults to writing ANSI encoded text to its end of the pipe. I recommend overriding the encoding to UTF-8 using the PYTHONIOENCODING environment variable. CMD uses the console's output codepage to decode bytes read from its end of the pipe, so the batch script should temporarily change the console codepage to UTF-8 via `chcp.com 65001`. Note that this won't work if CMD is running without a console (i.e. a DETACHED_PROCESS), in which case it defaults to ANSI. (I don't recommend running without a console. If no window is required, use CREATE_NO_WINDOW or a hidden window instead.) First save the current console codepage, parsed from the output of running `chcp.com` without arguments. Then you can restore the original console codepage after the loop. After decoding the text, CMD's `echo` command writes to the console using the wide-character WriteConsoleW function, so there's no problem at this stage -- up to the limits of the console's text support. FYI, in lieu of Python getting the blame for this too, the Windows console can only render Basic Multilingual Plane (i.e. UCS-2) text, and it doesn't support automatic font fallback or complex scripts. If the console can't display a character, it displays the font's default glyph (e.g. an empty rectangle), or two default glyphs for a surrogate pair. However, we can still copy text from the console in this case. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 17:41:30 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 21 Apr 2019 21:41:30 +0000 Subject: [issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element In-Reply-To: <1555805260.45.0.823683701543.issue36685@roundup.psfhosted.org> Message-ID: <1555882890.11.0.376073760687.issue36685@roundup.psfhosted.org> Change by Gordon P. Hemsley : ---------- keywords: +patch pull_requests: +12823 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 18:14:50 2019 From: report at bugs.python.org (Berker Peksag) Date: Sun, 21 Apr 2019 22:14:50 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555884890.52.0.213672554411.issue36645@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 5ebfa840a1c9967da299356733da41b532688988 by Berker Peksag (mollison) in branch 'master': bpo-36645: Fix ambiguous formatting in re.sub() documentation (GH-12879) https://github.com/python/cpython/commit/5ebfa840a1c9967da299356733da41b532688988 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 18:15:10 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 21 Apr 2019 22:15:10 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555884910.08.0.557272718851.issue36645@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 18:20:47 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 21 Apr 2019 22:20:47 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555885247.81.0.371463811537.issue36645@roundup.psfhosted.org> miss-islington added the comment: New changeset 71b88827f6ad368eafa17983bd979175d24da888 by Miss Islington (bot) in branch '3.7': bpo-36645: Fix ambiguous formatting in re.sub() documentation (GH-12879) https://github.com/python/cpython/commit/71b88827f6ad368eafa17983bd979175d24da888 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 18:57:32 2019 From: report at bugs.python.org (Berker Peksag) Date: Sun, 21 Apr 2019 22:57:32 +0000 Subject: [issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions In-Reply-To: <1555454579.44.0.38794635257.issue36645@roundup.psfhosted.org> Message-ID: <1555887452.69.0.123137094443.issue36645@roundup.psfhosted.org> Berker Peksag added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 21:10:54 2019 From: report at bugs.python.org (Marcin Niemira) Date: Mon, 22 Apr 2019 01:10:54 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1555895454.1.0.991287949041.issue36523@roundup.psfhosted.org> Marcin Niemira added the comment: Hey, Is there something I can improve in this PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 21:46:24 2019 From: report at bugs.python.org (Windson Yang) Date: Mon, 22 Apr 2019 01:46:24 +0000 Subject: [issue36678] duplicate method definitions in Lib/test/test_dataclasses.py In-Reply-To: <1555775728.19.0.814114535778.issue36678@roundup.psfhosted.org> Message-ID: <1555897584.15.0.98502222074.issue36678@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12826 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 21:47:09 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 01:47:09 +0000 Subject: [issue24011] Add error checks to PyInit_signal() In-Reply-To: <1429471695.96.0.523863138973.issue24011@psf.upfronthosting.co.za> Message-ID: <1555897629.71.0.0849714053006.issue24011@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 9541bd321a94f13dc41163a5d7a1a847816fac84 by Berker Peksag (Joannah Nanjekye) in branch 'master': bpo-24011: Use PyModule_Add{Object,IntMacro} in PyInit__signal() (GH-12765) https://github.com/python/cpython/commit/9541bd321a94f13dc41163a5d7a1a847816fac84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 21:49:13 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 01:49:13 +0000 Subject: [issue24011] Add error checks to PyInit_signal() In-Reply-To: <1429471695.96.0.523863138973.issue24011@psf.upfronthosting.co.za> Message-ID: <1555897753.94.0.381099718383.issue24011@roundup.psfhosted.org> Berker Peksag added the comment: Thank you, Joannah. There's no need to backport PR 12765 to maintenance branches, so I'm closing this issue as 'fixed'. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 21:51:55 2019 From: report at bugs.python.org (Aaron Hurst) Date: Mon, 22 Apr 2019 01:51:55 +0000 Subject: [issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1 In-Reply-To: <1541609240.08.0.788709270274.issue35184@psf.upfronthosting.co.za> Message-ID: <1555897915.34.0.717932204534.issue35184@roundup.psfhosted.org> Change by Aaron Hurst : ---------- keywords: +patch pull_requests: +12827 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 21:56:08 2019 From: report at bugs.python.org (Aaron Hurst) Date: Mon, 22 Apr 2019 01:56:08 +0000 Subject: [issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1 In-Reply-To: <1541609240.08.0.788709270274.issue35184@psf.upfronthosting.co.za> Message-ID: <1555898168.61.0.0207450358984.issue35184@roundup.psfhosted.org> Aaron Hurst added the comment: I can reproduce this issue by uncommenting the pyexpat line in Setup.dist and compiling. The issue is with -DXML_POOR_ENTROPY=1. The equals character causes the line to be incorrectly interpreted as a macro definition by makesetup. This results in an invalid Makefile output. I've submitted a PR, but a quick work-around is to remove the "=1". It is not necessary. ---------- nosy: +ahurst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 22:16:49 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 02:16:49 +0000 Subject: [issue36518] Avoid conflicts when pass arbitrary keyword arguments to Python function In-Reply-To: <1554300842.91.0.496796216897.issue36518@roundup.psfhosted.org> Message-ID: <1555899409.68.0.842119074072.issue36518@roundup.psfhosted.org> Steve Dower added the comment: No, now there is syntax that anyone using built in functions will have already learned I see no reason to create another way to solve the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 22:17:50 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 02:17:50 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1555899470.97.0.200964310219.issue36670@roundup.psfhosted.org> Steve Dower added the comment: If the code page is set to UTF-8 then mbcs will still be the right encoding :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 22:30:26 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 02:30:26 +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: <1555900226.0.0.521014964178.issue23078@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 9b21856b0fcda949de239edc7aa6cf3f2f4f77a3 by Berker Peksag (Xtreak) in branch 'master': bpo-23078: Add support for {class,static}method to mock.create_autospec() (GH-11613) https://github.com/python/cpython/commit/9b21856b0fcda949de239edc7aa6cf3f2f4f77a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 22:31:15 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 02:31:15 +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: <1555900275.61.0.403267858681.issue23078@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: -11349 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 22:47:02 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 02:47:02 +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: <1555901222.49.0.44812114942.issue23078@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12829 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 22:55:38 2019 From: report at bugs.python.org (Aaron Hurst) Date: Mon, 22 Apr 2019 02:55:38 +0000 Subject: =?utf-8?q?=5Bissue35586=5D_Open_pyexpat_compilation=2C_Make_shows_error?= =?utf-8?b?77yIbWlzc2luZyBzZXBhcmF0b3LvvIk=?= In-Reply-To: <1545796783.34.0.712150888896.issue35586@roundup.psfhosted.org> Message-ID: <1555901738.23.0.985865873959.issue35586@roundup.psfhosted.org> Aaron Hurst added the comment: This is the same issue as https://bugs.python.org/issue35184 I can reproduce this issue by uncommenting the pyexpat line in Setup.dist and compiling. The issue is with -DXML_POOR_ENTROPY=1. The equals character causes the line to be incorrectly interpreted as a macro definition by makesetup. This results in an invalid Makefile output. I've submitted a PR, but a quick work-around is to remove the "=1". It is not necessary. ---------- keywords: +patch nosy: +ahurst pull_requests: +12830 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 23:07:58 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 03:07:58 +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: <1555902478.61.0.943297928807.issue23078@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 15a57a3cadb992bb1752302333ff593e7eab284c by Berker Peksag in branch '3.7': bpo-23078: Add support for {class,static}method to mock.create_autospec() (GH-11613) https://github.com/python/cpython/commit/15a57a3cadb992bb1752302333ff593e7eab284c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 21 23:08:29 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 03:08:29 +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: <1555902509.83.0.363465160606.issue23078@roundup.psfhosted.org> Berker Peksag added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 00:40:27 2019 From: report at bugs.python.org (Brian Skinn) Date: Mon, 22 Apr 2019 04:40:27 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning Message-ID: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> New submission from Brian Skinn : In [this project](https://github.com/bskinn/stdio-mgr) of mine, I have a tox matrix set up with Pythons from 3.3. to 3.8. I have pytest set up to run doctest on my [`README.rst`](https://github.com/bskinn/stdio-mgr/blob/6444cce8e5866e2d519c1c0630551d8867f30c9a/README.rst). For Pythons 3.4 to 3.7 (3.4.10, 3.5.7, 3.6.8, 3.7.2), the following doctest example passes: ``` >>> import warnings >>> with stdio_mgr() as (in_, out_, err_): ... warnings.warn("'foo' has no 'bar'") ... err_cap = err_.getvalue() >>> err_cap "...UserWarning: 'foo' has no 'bar'\n..." ``` Under Python 3.8.0a3, though, it fails (actual local paths elided): ``` $ tox -re py38-attrs_latest .package recreate: .../.tox/.package .package installdeps: wheel, setuptools, attrs>=17.1 py38-attrs_latest recreate: .../.tox/py38-attrs_latest py38-attrs_latest installdeps: attrs, pytest py38-attrs_latest inst: .../.tox/.tmp/package/1/stdio-mgr-1.0.2.dev1.tar.gz py38-attrs_latest installed: atomicwrites==1.3.0,attrs==19.1.0,more-itertools==7.0.0,pluggy==0.9.0,py==1.8.0,pytest==4.4.1,six==1.12.0,stdio-mgr==1.0.2.dev1 py38-attrs_latest run-test-pre: PYTHONHASHSEED='2720295779' py38-attrs_latest run-test: commands[0] | pytest =============================================================================================== test session starts ================================================================================================ platform linux -- Python 3.8.0a3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 cachedir: .tox/py38-attrs_latest/.pytest_cache rootdir: ..., inifile: tox.ini collected 6 items README.rst F [ 16%] tests/test_stdiomgr_base.py ..... [100%] ===================================================================================================== FAILURES ===================================================================================================== _______________________________________________________________________________________________ [doctest] README.rst _______________________________________________________________________________________________ 077 078 **Mock** ``stderr``\ **:** 079 080 .. code :: 081 082 >>> import warnings 083 >>> with stdio_mgr() as (in_, out_, err_): 084 ... warnings.warn("'foo' has no 'bar'") 085 ... err_cap = err_.getvalue() 086 >>> err_cap Expected: "...UserWarning: 'foo' has no 'bar'\n..." Got: ':2: UserWarning: \'foo\' has no \'bar\'\n warnings.warn("\'foo\' has no \'bar\'")\n' .../README.rst:86: DocTestFailure ======================================================================================== 1 failed, 5 passed in 0.06 seconds ======================================================================================== ERROR: InvocationError for command .../.tox/py38-attrs_latest/bin/pytest (exited with code 1) _____________________________________________________________________________________________________ summary ______________________________________________________________________________________________________ ERROR: py38-attrs_latest: commands failed ``` If I change the doctest in README to the following, where the expected output is surrounded by single-quotes instead of double-quotes, and the internal single quotes are escaped, it passes fine in 3.8.0a3: ``` >>> import warnings >>> with stdio_mgr() as (in_, out_, err_): ... warnings.warn("'foo' has no 'bar'") ... err_cap = err_.getvalue() >>> err_cap '...UserWarning: \'foo\' has no \'bar\'\n...' ``` But, naturally, it fails in 3.7 and below. It *looks* like this is probably a glitch somewhere in 3.8.0a3, where this string containing single quotes is rendered (at the REPL?) using enclosing single quotes and escaped internal single quotes, rather than enclosing double-quotes and non-escaped internal single-quotes? ---------- components: Library (Lib) messages: 340637 nosy: bskinn priority: normal severity: normal status: open title: Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 00:58:42 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 22 Apr 2019 04:58:42 +0000 Subject: [issue36693] Reversing large ranges results in a minor type inconsistency In-Reply-To: <1555864127.32.0.643984814529.issue36693@roundup.psfhosted.org> Message-ID: <1555909122.67.0.428178108867.issue36693@roundup.psfhosted.org> Raymond Hettinger added the comment: This all seems proper to me. In each case, an iterator is returned -- that is the documented behavior. The specific type of iterator is allowed to vary in ways that are convenient for the implementation. Specifically, reversed() will call __reversed__() which must return an iterator but its type is allowed to vary. That is really convenient for handling extreme ranges separately from the fast, common case of smaller ranges. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 01:10:17 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 22 Apr 2019 05:10:17 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1555909817.22.0.988437644081.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: Steven, as requested I added a documentation note reserving the right to add other interpolation methods. We can make the note stronger if you like. Otherwise, I think we're good to go now. Mark, thanks for the link. I've read all the posts and agree that we might consider changing the default interpolation method prior to the release. For now, matching what Excel and SciPy does seems like a reasonable starting point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 01:42:31 2019 From: report at bugs.python.org (Saba Kauser) Date: Mon, 22 Apr 2019 05:42:31 +0000 Subject: [issue36640] python ibm_db setup.py post install script does not seem to work from Anaconda In-Reply-To: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> Message-ID: <1555911751.94.0.805223478388.issue36640@roundup.psfhosted.org> Saba Kauser added the comment: I have debugged this further. The problem seems be happening due to usage of get_python_lib(). e.g: if('darwin' in sys.platform): class PostInstall(install): """ Post installation - run install_name_tool on Darwin """ def run(self): install.run(self) clipath = os.getenv('IBM_DB_HOME', '@loader_path/clidriver') print("in PostInstall with {}".format(clipath)) for so in glob.glob(get_python_lib()+r'/ibm_db*.so'): os.system("install_name_tool -change libdb2.dylib {}/lib/libdb2.dylib {}".format(clipath, so)) cmd_class = dict(install = PostInstall) The get_python_lib() returns following path and hence my script is never able to fetch the matching lib name. example output of get_python_lib() usage: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/CHANGES /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/LICENSE /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/README.md /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/config.py.sample I have both anaconda and standalone python installations and get_python_lib() seem to get confused with different paths. It sometimes returns the duplicate path as well: e.g: /Users/skauser/anaconda3/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/CHANGES /Users/skauser/anaconda3/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/LICENSE /Users/skauser/anaconda3/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/README.md /Users/skauser/anaconda3/lib/python3.7/site-packages/Users/skauser/anaconda3/lib/python3.7/site-packages/config.py.sample Above examples are taken from one usage of get_python_lib() for copying certain data files while installation to site-packages. My strong belief is that, its the same problem with the post-install script as well. Why is get_python_lib() behavior not consistent? What are the other alternatives to get the current site-package path for the running installation? When I disable cache of pip and install, get_python_lib() path as retrieved while install behaves correctly. e.g: pip --no-cache-dir install ibm_db Kindly help! This is blocking production of many users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 01:54:44 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 22 Apr 2019 05:54:44 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1555912484.84.0.616325282646.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: One other thought: The PR implements both methods 6 and 7 which means that that we can reproduce the results of every major stats tool except for Mathematica. The summary of properties chart of in Hyndman & Fan lists our default as satisfying 5 of 6 desirable properties. This is the same as for method 8 which almost no one uses by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 02:00:04 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 22 Apr 2019 06:00:04 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555912804.36.0.904980263105.issue36695@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Can you please attach a single and standalone file without dependencies like attrs so that it would help in bisecting the issue? ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 02:58:37 2019 From: report at bugs.python.org (Michael Felt) Date: Mon, 22 Apr 2019 06:58:37 +0000 Subject: [issue36696] possible multiple regressions on AIX Message-ID: <1555916317.7.0.351129409796.issue36696@roundup.psfhosted.org> New submission from Michael Felt : My AIX bot has been very consistent - only the multiprocessing tests failing when run by bot, but 4 or 5 days ago 3 to 5 additional tests - that, afaik, had never failed before, are now failing. These may also be compiler related specifics, or the presence (better lack of) 3rd party packages. Anyway - summary of output: INFO: Can't locate Tcl/Tk libs and/or headers building '_pickle' extension xlc_r -O2 -I/opt/include -I/opt/buildaix/include -g -I/opt/include -I/opt/buildaix/include -g -I./Include/internal -I./Include -I. -I/opt/include -I/opt/buildaix/include -I/home/buildbot/cpython-master/Include -I/home/buildbot/cpython-master -c /home/buildbot/cpython-master/Modules/_pickle.c -o build/temp.aix-7.1-3.8-pydebug/home/buildbot/cpython-master/Modules/_pickle.o -D Py_BUILD_CORE_MODULE 1506-261 (W) Suboption Py_BUILD_CORE_MODULE is not valid for option D. "/home/buildbot/cpython-master/Modules/_pickle.c", line 8.4: 1506-205 (S) #error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined" building '_json' extension xlc_r -O2 -I/opt/include -I/opt/buildaix/include -g -I/opt/include -I/opt/buildaix/include -g -I./Include/internal -I./Include -I. -I/opt/include -I/opt/buildaix/include -I/home/buildbot/cpython-master/Include -I/home/buildbot/cpython-master -c /home/buildbot/cpython-master/Modules/_json.c -o build/temp.aix-7.1-3.8-pydebug/home/buildbot/cpython-master/Modules/_json.o -D Py_BUILD_CORE_MODULE 1506-261 (W) Suboption Py_BUILD_CORE_MODULE is not valid for option D. "/home/buildbot/cpython-master/Modules/_json.c", line 8.4: 1506-205 (S) #error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined" "./Include/internal/pycore_accu.h", line 13.4: 1506-205 (S) #error "this header requires Py_BUILD_CORE define" building '_testinternalcapi' extension xlc_r -O2 -I/opt/include -I/opt/buildaix/include -g -I/opt/include -I/opt/buildaix/include -g -I./Include/internal -I./Include -I. -I/opt/include -I/opt/buildaix/include -I/home/buildbot/cpython-master/Include -I/home/buildbot/cpython-master -c /home/buildbot/cpython-master/Modules/_testinternalcapi.c -o build/temp.aix-7.1-3.8-pydebug/home/buildbot/cpython-master/Modules/_testinternalcapi.o -D Py_BUILD_CORE_MODULE 1506-261 (W) Suboption Py_BUILD_CORE_MODULE is not valid for option D. "/home/buildbot/cpython-master/Modules/_testinternalcapi.c", line 6.4: 1506-205 (S) #error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined" "./Include/internal/pycore_coreconfig.h", line 8.4: 1506-205 (S) #error "this header requires Py_BUILD_CORE define" Python build finished successfully! The necessary bits to build these optional modules were not found: _curses_panel _gdbm _tkinter ossaudiodev readline spwd 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: _abc atexit pwd time Failed to build these modules: _json _pickle _testinternalcapi running build_scripts copying and adjusting /home/buildbot/cpython-master/Tools/scripts/pydoc3 -> build/scripts-3.8 copying and adjusting /home/buildbot/cpython-master/Tools/scripts/idle3 -> build/scripts-3.8 copying and adjusting /home/buildbot/cpython-master/Tools/scripts/2to3 -> build/scripts-3.8 changing mode of build/scripts-3.8/pydoc3 from 644 to 755 changing mode of build/scripts-3.8/idle3 from 644 to 755 changing mode of build/scripts-3.8/2to3 from 644 to 755 renaming build/scripts-3.8/pydoc3 to build/scripts-3.8/pydoc3.8 renaming build/scripts-3.8/idle3 to build/scripts-3.8/idle3.8 renaming build/scripts-3.8/2to3 to build/scripts-3.8/2to3-3.8 ./python -E -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform ./python ./Tools/scripts/run_tests.py /home/buildbot/cpython-master/python -u -W default -bb -E -m test -r -w -j 0 -u all,-largefile,-audio,-gui == CPython 3.8.0a3+ (heads/master:3e986de0d6, Apr 21 2019, 17:04:13) [C] ... running: test_venv (3 min 38 sec), test_decimal (2 min 27 sec), test_ftplib (30 sec 50 ms), test_zipfile (1 min 43 sec) 0:04:00 [ 40/420/1] test_ftplib failed -- running: test_venv (3 min 53 sec), test_decimal (2 min 42 sec), test_zipfile (1 min 58 sec) test test_ftplib failed -- Traceback (most recent call last): File "/home/buildbot/cpython-master/Lib/test/test_ftplib.py", line 605, in test_storlines self.client.storlines('stor', f) File "/home/buildbot/cpython-master/Lib/ftplib.py", line 526, in storlines conn.unwrap() File "/home/buildbot/cpython-master/Lib/ssl.py", line 1094, in unwrap s = self._sslobj.shutdown() socket.timeout: The read operation timed out 0:04:05 [ 41/420/1] test_locale passed -- running: test_venv (3 min 58 sec), test_decimal (2 min 47 sec), test_zipfile (2 min 3 sec) ... 0:12:14 [110/420/2] test_embed failed -- running: test_multiprocessing_forkserver (1 min 25 sec), test_compileall (2 min 9 sec) test test_embed failed -- multiple errors occurred; run in verbose mode for details running: test_multiprocessing_forkserver (1 min 55 sec), test_faulthandler (30 sec 42 ms), test_compile (56 sec 571 ms), test_compileall (2 min 39 sec) 0:12:55 [111/420/2] test_faulthandler passed (36 sec 350 ms) -- running: test_multiprocessing_forkserver (2 min 6 sec), test_compile (1 min 7 sec), test_compileall (2 min 50 sec) 0:13:46 [125/420/3] test_json failed -- running: test_multiprocessing_forkserver (2 min 57 sec) test test_json crashed -- Traceback (most recent call last): File "/home/buildbot/cpython-master/Lib/test/libregrtest/runtest.py", line 166, in runtest_inner the_module = importlib.import_module(abstest) File "/home/buildbot/cpython-master/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 777, in exec_module File "", line 219, in _call_with_frames_removed File "/home/buildbot/cpython-master/Lib/test/test_json/__init__.py", line 12, in cjson.JSONDecodeError = cjson.decoder.JSONDecodeError = json.JSONDecodeError AttributeError: 'NoneType' object has no attribute 'JSONDecodeError' ... 0:24:49 [212/420/5] test_pydoc failed -- running: test_pyclbr (1 min 2 sec), test_subprocess (11 min 1 sec) test test_pydoc crashed -- Traceback (most recent call last): File "/home/buildbot/cpython-master/Lib/test/libregrtest/runtest.py", line 166, in runtest_inner the_module = importlib.import_module(abstest) File "/home/buildbot/cpython-master/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 777, in exec_module File "", line 219, in _call_with_frames_removed File "/home/buildbot/cpython-master/Lib/test/test_pydoc.py", line 9, in import _pickle ModuleNotFoundError: No module named '_pickle' ... 0:24:59 [214/420/6] test_pyclbr failed -- running: test_subprocess (11 min 12 sec) *** Pickler test test_pyclbr failed -- Traceback (most recent call last): File "/home/buildbot/cpython-master/Lib/test/test_pyclbr.py", line 227, in test_others cm('pickle', ignore=('partial',)) File "/home/buildbot/cpython-master/Lib/test/test_pyclbr.py", line 144, in checkModule self.assertHaskey(dict, name, ignore) File "/home/buildbot/cpython-master/Lib/test/test_pyclbr.py", line 48, in assertHaskey self.assertIn(key, obj) AssertionError: 'Pickler' not found in {'partial': , 'PickleError': , 'PicklingError': , 'UnpicklingError': , '_Stop': , '_Framer': , '_Unframer': , '_getattribute': , 'whichmodule': , 'encode _long': , 'decode_long': , '_Pickler': , '_Unpickler': , '_dump': , '_dumps': , '_load': , '_loads': , '_test': } ... 1:08:14 [398/420/8] test_inspect failed -- running: test_tools (10 min 44 sec), test_multiprocessing_spawn (11 min 35 sec), test_io (5 min 23 sec) test test_inspect crashed -- Traceback (most recent call last): File "/home/buildbot/cpython-master/Lib/test/libregrtest/runtest.py", line 166, in runtest_inner the_module = importlib.import_module(abstest) File "/home/buildbot/cpython-master/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 777, in exec_module File "", line 219, in _call_with_frames_removed File "/home/buildbot/cpython-master/Lib/test/test_inspect.py", line 11, in import _pickle ModuleNotFoundError: No module named '_pickle' ... 388 tests OK. 9 tests failed: test_embed test_ftplib test_inspect test_json test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn test_pyclbr test_pydoc ---------- messages: 340643 nosy: Michael.Felt priority: normal severity: normal status: open title: possible multiple regressions on AIX _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 03:10:11 2019 From: report at bugs.python.org (Roundup Robot) Date: Mon, 22 Apr 2019 07:10:11 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555917011.63.0.940327074026.issue36690@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12831 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 03:11:41 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 22 Apr 2019 07:11:41 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555917101.14.0.753142459153.issue36695@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I tried bisecting and got to this commit 11a896652ee98aa44e59ed25237f9efb56635dcf (issue33375) . Seems this changes warning reporting output to add filename. I guess it's better to change the doctest to adopt this change. I have added the devs on the issue for confirmation. commit 11a896652ee98aa44e59ed25237f9efb56635dcf (HEAD) Author: Thomas Kluyver Date: Fri Jun 8 21:28:37 2018 +0200 bpo-33375: Get filename for warnings from frame.f_code.co_filename (GH-6622) More consistent with how other parts of Python find the filename (e.g. tracebacks and pdb). $ cat ../backups/bpo36695_1.py def foo(): ''' >>> import warnings, io >>> from contextlib import redirect_stderr >>> f = io.StringIO() >>> with redirect_stderr(f): ... warnings.warn("'foo' has no 'bar'") ... err_cap = f.getvalue() >>> print(err_cap) ''' pass ? cpython git:(11a896652e) ./python.exe -m doctest ../backups/bpo36695_1.py ********************************************************************** File "../backups/bpo36695_1.py", line 9, in bpo36695_1.foo Failed example: print(err_cap) Expected nothing Got: :2: UserWarning: 'foo' has no 'bar' warnings.warn("'foo' has no 'bar'") ********************************************************************** 1 items had failures: 1 of 5 in bpo36695_1.foo ***Test Failed*** 1 failures. # Before 11a896652ee98aa44e59ed25237f9efb56635dcf ? cpython git:(11a896652e) git checkout 11a896652ee98aa44e59ed25237f9efb56635dcf~1 Previous HEAD position was 11a896652e bpo-33375: Get filename for warnings from frame.f_code.co_filename (GH-6622) HEAD is now at 3b0b90c8c3 bpo-33800: Fix default argument for parameter dict_type of ConfigParser/RawConfigParser (GH-7494) ? cpython git:(3b0b90c8c3) make -s -j4 > /dev/null ? cpython git:(3b0b90c8c3) ./python.exe -m doctest ../backups/bpo36695_1.py ********************************************************************** File "../backups/bpo36695_1.py", line 9, in bpo36695_1.foo Failed example: print(err_cap) Expected nothing Got: ../backups/bpo36695_1.py:2: UserWarning: 'foo' has no 'bar' ''' ********************************************************************** 1 items had failures: 1 of 5 in bpo36695_1.foo ***Test Failed*** 1 failures. I can replicate test failure as below with 11a896652ee98aa44e59ed25237f9efb56635dcf and passes with the commit before it. README.rst F [ 20%] tests/test_stdiomgr_base.py .... [100%] ============================================= FAILURES ============================================== _______________________________________ [doctest] README.rst ________________________________________ 077 078 **Mock** ``stderr``\ **:** 079 080 .. code :: 081 082 >>> import warnings 083 >>> with stdio_mgr() as (in_, out_, err_): 084 ... warnings.warn("'foo' has no 'bar'") 085 ... err_cap = err_.getvalue() 086 >>> err_cap Expected: "...UserWarning: 'foo' has no 'bar'\n..." Got: ':2: UserWarning: \'foo\' has no \'bar\'\n warnings.warn("\'foo\' has no \'bar\'")\n' /home/karthi/stdio-mgr/README.rst:86: DocTestFailure ---------- nosy: +brett.cannon, takluyver, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 03:25:49 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 22 Apr 2019 07:25:49 +0000 Subject: [issue29940] Add follow_wrapped=True option to help() In-Reply-To: <1490802065.05.0.49346265762.issue29940@psf.upfronthosting.co.za> Message-ID: <1555917949.16.0.568378113398.issue29940@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger versions: +Python 3.8 -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 04:01:32 2019 From: report at bugs.python.org (SilentGhost) Date: Mon, 22 Apr 2019 08:01:32 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555920092.54.0.149118062279.issue36690@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 04:49:29 2019 From: report at bugs.python.org (Noitul) Date: Mon, 22 Apr 2019 08:49:29 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict Message-ID: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> New submission from Noitul : >>> import inspect >>> a = 0 >>> b = 1 >>> def abc(): >>> return a.b >>> print(inspect.getclosurevars(abc)) ClosureVars(nonlocals={}, globals={'a': 0, 'b': 1}, builtins={}, unbound=set()) Should "'b': 1" be in globals dict? ---------- components: Library (Lib) messages: 340645 nosy: Noitul priority: normal severity: normal status: open title: inspect.getclosurevars returns wrong globals dict versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 04:55:07 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 22 Apr 2019 08:55:07 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict In-Reply-To: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> Message-ID: <1555923307.48.0.233823520468.issue36697@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 07:01:35 2019 From: report at bugs.python.org (Thomas Kluyver) Date: Mon, 22 Apr 2019 11:01:35 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555930895.25.0.564415345559.issue36695@roundup.psfhosted.org> Thomas Kluyver added the comment: It's not obvious to me why that change to finding the source file related to the warning should affect the format of the warning message printed. It might be something that could be fixed in the warning module. But I don't understand where it's going wrong at present. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 07:14:01 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 22 Apr 2019 11:14:01 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1555931641.4.0.879344031899.issue36523@roundup.psfhosted.org> Inada Naoki added the comment: New changeset ab86521a9d9999731e39bd9056420bb7774fd144 by Inada Naoki (Marcin Niemira) in branch 'master': bpo-36523: Add docstring to io.IOBase.writelines (GH-12683) https://github.com/python/cpython/commit/ab86521a9d9999731e39bd9056420bb7774fd144 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 07:27:12 2019 From: report at bugs.python.org (Marcin Niemira) Date: Mon, 22 Apr 2019 11:27:12 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1555932432.14.0.654876684131.issue36523@roundup.psfhosted.org> Change by Marcin Niemira : ---------- pull_requests: +12832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 07:27:29 2019 From: report at bugs.python.org (Brian Skinn) Date: Mon, 22 Apr 2019 11:27:29 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555932449.11.0.970557198285.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: Karthikeyan, my apologies for the slow reply -- I posted this right before I went to bed. To emphasize, the change to the formatting of the string contents, by adding the filename, I think is not problematic: I'm using ellipses to elide everything before and after my custom "warning" message. Rather, I think the problem is that the string is being rendered as a '' string, instead of as a "" string; IOW: 'Test string with \'enclosing\' single quotes' vs "Test string with 'enclosing' double quotes" --- In the interim, as you suggest, Karthikeyan, I can just conditionally skip the doctests on 3.8 with a suitable pytest -k flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 08:08:32 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 22 Apr 2019 12:08:32 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1555934912.02.0.937368696505.issue36523@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 1100ae8f3fb1d5a8f6f5638919196bd8fab66de9 by Inada Naoki (Marcin Niemira) in branch '3.7': bpo-36523: Add docstring to io.IOBase.writelines (GH-12683) https://github.com/python/cpython/commit/1100ae8f3fb1d5a8f6f5638919196bd8fab66de9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 08:09:08 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 22 Apr 2019 12:09:08 +0000 Subject: [issue36523] Add docstring to io.IOBase.writelines In-Reply-To: <1554365037.57.0.454839708261.issue36523@roundup.psfhosted.org> Message-ID: <1555934948.14.0.185083199402.issue36523@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 08:15:22 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 22 Apr 2019 12:15:22 +0000 Subject: [issue36696] possible multiple regressions on AIX In-Reply-To: <1555916317.7.0.351129409796.issue36696@roundup.psfhosted.org> Message-ID: <1555935322.19.0.583267673117.issue36696@roundup.psfhosted.org> Inada Naoki added the comment: Maybe, XLC doesn't support -D name. -Dname should be used instead. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 09:29:09 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 13:29:09 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555939749.64.0.728367428066.issue36690@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 09:29:18 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 13:29:18 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555939758.69.0.461055502817.issue36690@roundup.psfhosted.org> Berker Peksag added the comment: New changeset d59b662e490d3fae662c5f81fa5248f0445d2158 by Berker Peksag (???) in branch 'master': bpo-36690: Fix typo in Tools/demo/rpython.py (GH-12903) https://github.com/python/cpython/commit/d59b662e490d3fae662c5f81fa5248f0445d2158 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 09:52:59 2019 From: report at bugs.python.org (Brian Skinn) Date: Mon, 22 Apr 2019 13:52:59 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555941179.62.0.311102619245.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: Here is warn.py, a minimal no-dependency repro script: ``` import doctest class Tester: r"""Provide docstring for testing. >>> import warnings >>> from contextlib import redirect_stderr >>> from io import StringIO >>> sio = StringIO() >>> with redirect_stderr(sio): ... warnings.warn("Warning 'containing' single quotes") >>> sio.getvalue() "...UserWarning: Warning 'containing' single quotes\n..." """ doctest.run_docstring_examples( Tester(), {}, optionflags=doctest.ELLIPSIS, ) ``` `python3.7 warn.py` (3.7.3) gives no output. `python3.8 warn.py` (3.8.0a3) gives: ``` $ python3.8 warn.py **************************************************************** File "warn.py", line ?, in NoName Failed example: sio.getvalue() Expected: "...UserWarning: Warning 'containing' single quotes\n..." Got: ':2: UserWarning: Warning \'containing\' single quotes\n warnings.warn("Warning \'containing\' single quotes")\n' ``` The problem appears to be centered around *doctest*, as the following script DOES NOT raise AssertionError with either of 3.7 or 3.8: ``` import warnings from contextlib import redirect_stderr from io import StringIO sio = StringIO() with redirect_stderr(sio): warnings.warn("Warning 'containing' single quotes") assert " 'containing' " in sio.getvalue() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 09:54:00 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 13:54:00 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555941240.69.0.180177907534.issue36690@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 5407aaf18b8d33d0a327991db366457ac6fead2d by Berker Peksag (Miss Islington (bot)) in branch '3.7': bpo-36690: Fix typo in Tools/demo/rpython.py (GH-12903) https://github.com/python/cpython/commit/5407aaf18b8d33d0a327991db366457ac6fead2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 09:54:38 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 13:54:38 +0000 Subject: [issue36690] A typing error in demo rpython.py In-Reply-To: <1555851175.4.0.109460284038.issue36690@roundup.psfhosted.org> Message-ID: <1555941278.5.0.0160459378826.issue36690@roundup.psfhosted.org> Berker Peksag added the comment: Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 10:11:30 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 22 Apr 2019 14:11:30 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555942290.63.0.772345679405.issue36695@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > Karthikeyan, my apologies for the slow reply -- I posted this right before I went to bed. No problem, thanks for the simplified program. I wrote a similar one based on doctest that fails with commit and passes before it. I am still confused about the commit impact and warnings also uses C code so hope someone else has some idea over this scenario. As you mentioned it seems to be about doctest that uses exec and compile. I can see the change in output since doctest has it's own internal stdout wrapper like contextlib but using the similar exec and compile statement as a standalone one doesn't reproduce this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 10:47:24 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 14:47:24 +0000 Subject: [issue28113] Remove Py_CreateSymbolicLinkW In-Reply-To: <1473747548.28.0.648303309588.issue28113@psf.upfronthosting.co.za> Message-ID: <1555944444.05.0.576847587542.issue28113@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12834 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 10:48:53 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 14:48:53 +0000 Subject: [issue28113] Remove Py_CreateSymbolicLinkW In-Reply-To: <1473747548.28.0.648303309588.issue28113@psf.upfronthosting.co.za> Message-ID: <1555944533.07.0.349601979444.issue28113@roundup.psfhosted.org> Berker Peksag added the comment: Py_CreateSymbolicLinkW() has been removed in bpo-31512. PR 12907 updates tests to use support.TESTN. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 11:17:36 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 15:17:36 +0000 Subject: [issue29734] os.stat handle leak In-Reply-To: <1488799617.7.0.144245331277.issue29734@psf.upfronthosting.co.za> Message-ID: <1555946256.56.0.373694572486.issue29734@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 11:21:28 2019 From: report at bugs.python.org (Brian Skinn) Date: Mon, 22 Apr 2019 15:21:28 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555946488.63.0.794230566474.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: , it seems like the problem must somehow stem from the new commit using frame.f_code.co_filename (or the C equivalent), instead of using __file__ as previously. Consider this warn2.py, similar to the other but with no single quotes in the warning message: ``` import doctest class Tester: r"""Provide docstring for testing. >>> import warnings >>> from contextlib import redirect_stderr >>> from io import StringIO >>> sio = StringIO() >>> with redirect_stderr(sio): ... warnings.warn("Warning with no quotes") >>> sio.getvalue() '...' """ doctest.run_docstring_examples( Tester(), {}, optionflags=doctest.ELLIPSIS, ) ``` This doctest PASSES for me in both 3.7 and 3.8; note that the expected doctest output from `sio.getvalue()` is *single-quote delimited*. This implies to me that REPL string output is single-quote delimited by default, and that there's some sort of "smart string formatter" functionality involved that is working correctly in 3.7 but not in 3.8, which REPL-prints the single-quote-containing string using enclosing double-quotes, so as to avoid escaping the internal single quotes. Why 11a8966 would break this in this way is ... baffling to me. --- Unfortunately, I don't think it will work to fix the doctest on my end simply by using `print(sio.getvalue())`, as the resulting message is one line long in 3.7, but two lines long in 3.8. Further, doctest gets confused when you try to start a line of output with an ellipsis, as it thinks it's a continuation of the prior command. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 11:46:50 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 15:46:50 +0000 Subject: [issue29734] os.stat handle leak In-Reply-To: <1488799617.7.0.144245331277.issue29734@psf.upfronthosting.co.za> Message-ID: <1555948010.49.0.254853507979.issue29734@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 6ef726af3ec106013c7c4261ddb306854f2b1778 by Berker Peksag in branch 'master': bpo-29734: Cleanup test_getfinalpathname_handles test (GH-12908) https://github.com/python/cpython/commit/6ef726af3ec106013c7c4261ddb306854f2b1778 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:01:49 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 17:01:49 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555952509.8.0.660528303175.issue9194@roundup.psfhosted.org> Steve Dower added the comment: New changeset 56ed86490cb8221c874d432461d77702437f63e5 by Steve Dower (Zackery Spytz) in branch 'master': bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) https://github.com/python/cpython/commit/56ed86490cb8221c874d432461d77702437f63e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:01:54 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 17:01:54 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555952514.72.0.151366633232.issue9194@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:02:00 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 17:02:00 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555952520.86.0.428694174485.issue9194@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:07:12 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 17:07:12 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555952832.62.0.280060629378.issue9194@roundup.psfhosted.org> Steve Dower added the comment: Thanks Zackery! I've merged this main part of the fix (though it requires a manual backport to 2.7). As it's a buffer overrun, I've sent it back to 3.6 as well. Eryk - thanks for the additional detail. I wonder whether it would be just as easy to guarantee an over-allocation in this case and force a null terminator? (In fact, that would probably have handled the same case that Zackery just fixed, but we didn't have a patch ready for that approach) ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:08:10 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 17:08:10 +0000 Subject: [issue36672] A compiler warning in winreg.SetValue() In-Reply-To: <1555744218.52.0.272239256481.issue36672@roundup.psfhosted.org> Message-ID: <1555952890.23.0.959698659794.issue36672@roundup.psfhosted.org> Steve Dower added the comment: New changeset 34366b7f914eedbcc33aebe882098a2199ffaf82 by Steve Dower (Zackery Spytz) in branch 'master': bpo-36672: Fix a compiler warning in winreg.SetValue() (GH-12882) https://github.com/python/cpython/commit/34366b7f914eedbcc33aebe882098a2199ffaf82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:08:16 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 17:08:16 +0000 Subject: [issue36672] A compiler warning in winreg.SetValue() In-Reply-To: <1555744218.52.0.272239256481.issue36672@roundup.psfhosted.org> Message-ID: <1555952896.85.0.111046461265.issue36672@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:15:57 2019 From: report at bugs.python.org (TheMathsGod) Date: Mon, 22 Apr 2019 17:15:57 +0000 Subject: [issue36698] Shell restart when error message contains non-BMP characters Message-ID: <1555953357.75.0.808052597637.issue36698@roundup.psfhosted.org> New submission from TheMathsGod : When attempting to raise an error with a message containing non-BMP characters (Unicode ordinals above U+0xFFFF), the python shell displays a long traceback including several UnicodeEncodeErrors and then restarts. Example: >>> raise Exception('\U0001f603') Traceback (most recent call last): File "", line 1, in raise Exception('\U0001f603') Traceback (most recent call last): File "", line 1, in raise Exception('\U0001f603') Traceback (most recent call last): File "D:\Python37\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "", line 1, in Traceback (most recent call last): File "D:\Python37\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "", line 1, in Exception: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Python37\lib\idlelib\run.py", line 144, in main ret = method(*args, **kwargs) File "D:\Python37\lib\idlelib\run.py", line 486, in runcode print_exception() File "D:\Python37\lib\idlelib\run.py", line 234, in print_exception print_exc(typ, val, tb) File "D:\Python37\lib\idlelib\run.py", line 232, in print_exc print(line, end='', file=efile) File "D:\Python37\lib\idlelib\run.py", line 362, in write return self.shell.write(s, self.tags) File "D:\Python37\lib\idlelib\rpc.py", line 608, in __call__ value = self.sockio.remotecall(self.oid, self.name, args, kwargs) File "D:\Python37\lib\idlelib\rpc.py", line 220, in remotecall return self.asyncreturn(seq) File "D:\Python37\lib\idlelib\rpc.py", line 251, in asyncreturn return self.decoderesponse(response) File "D:\Python37\lib\idlelib\rpc.py", line 271, in decoderesponse raise what UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 11-11: Non-BMP character not supported in Tk During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Python37\lib\idlelib\run.py", line 158, in main print_exception() File "D:\Python37\lib\idlelib\run.py", line 234, in print_exception print_exc(typ, val, tb) File "D:\Python37\lib\idlelib\run.py", line 220, in print_exc print_exc(type(context), context, context.__traceback__) File "D:\Python37\lib\idlelib\run.py", line 232, in print_exc print(line, end='', file=efile) File "D:\Python37\lib\idlelib\run.py", line 362, in write return self.shell.write(s, self.tags) File "D:\Python37\lib\idlelib\rpc.py", line 608, in __call__ value = self.sockio.remotecall(self.oid, self.name, args, kwargs) File "D:\Python37\lib\idlelib\rpc.py", line 220, in remotecall return self.asyncreturn(seq) File "D:\Python37\lib\idlelib\rpc.py", line 251, in asyncreturn return self.decoderesponse(response) File "D:\Python37\lib\idlelib\rpc.py", line 271, in decoderesponse raise what UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 11-11: Non-BMP character not supported in Tk During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "D:\Python37\lib\idlelib\run.py", line 162, in main traceback.print_exception(type, value, tb, file=sys.__stderr__) File "D:\Python37\lib\traceback.py", line 105, in print_exception print(line, file=file, end="") File "D:\Python37\lib\idlelib\run.py", line 362, in write return self.shell.write(s, self.tags) File "D:\Python37\lib\idlelib\rpc.py", line 608, in __call__ value = self.sockio.remotecall(self.oid, self.name, args, kwargs) File "D:\Python37\lib\idlelib\rpc.py", line 220, in remotecall return self.asyncreturn(seq) File "D:\Python37\lib\idlelib\rpc.py", line 251, in asyncreturn return self.decoderesponse(response) File "D:\Python37\lib\idlelib\rpc.py", line 271, in decoderesponse raise what UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 11-11: Non-BMP character not supported in Tk =============================== RESTART: Shell =============================== >>> I presume the error is caused by Tk being unable to display the characters in the error message, but being forced to anyway by the traceback, causing a series of UnicodeEncodeErrors. Perhaps the error handler should use repr() or similar methods to convert the message into a displayable form? ---------- assignee: terry.reedy components: IDLE messages: 340662 nosy: TheMathsGod, terry.reedy priority: normal severity: normal status: open title: Shell restart when error message contains non-BMP characters type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:20:37 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 17:20:37 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555953637.86.0.163042479786.issue9194@roundup.psfhosted.org> miss-islington added the comment: New changeset 7038deed09784a03e2a7bad500f0054d29876ae7 by Miss Islington (bot) in branch '3.7': bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) https://github.com/python/cpython/commit/7038deed09784a03e2a7bad500f0054d29876ae7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:31:02 2019 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 22 Apr 2019 17:31:02 +0000 Subject: [issue32892] Remove specific constant AST types in favor of ast.Constant In-Reply-To: <1519204597.27.0.467229070634.issue32892@psf.upfronthosting.co.za> Message-ID: <1555954262.85.0.487333384003.issue32892@roundup.psfhosted.org> Miro Hron?ok added the comment: Mako (now fixed) https://github.com/sqlalchemy/mako/issues/287 ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:31:56 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 17:31:56 +0000 Subject: [issue36672] A compiler warning in winreg.SetValue() In-Reply-To: <1555744218.52.0.272239256481.issue36672@roundup.psfhosted.org> Message-ID: <1555954316.26.0.294473697779.issue36672@roundup.psfhosted.org> miss-islington added the comment: New changeset 36aecc0079af0ec65add8ffb5bcdea9a594baca4 by Miss Islington (bot) in branch '3.7': bpo-36672: Fix a compiler warning in winreg.SetValue() (GH-12882) https://github.com/python/cpython/commit/36aecc0079af0ec65add8ffb5bcdea9a594baca4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 13:57:25 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 22 Apr 2019 17:57:25 +0000 Subject: [issue29940] Add follow_wrapped=True option to help() In-Reply-To: <1490802065.05.0.49346265762.issue29940@psf.upfronthosting.co.za> Message-ID: <1555955845.78.0.286221568349.issue29940@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:13:24 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:13:24 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1555956804.47.0.481029637081.issue33608@roundup.psfhosted.org> Steve Dower added the comment: New changeset 264490797ad936868c54b3d4ceb0343e7ba4be76 by Steve Dower in branch 'master': bpo-33608: Normalize atomic macros so that they all expect an atomic struct (GH-12877) https://github.com/python/cpython/commit/264490797ad936868c54b3d4ceb0343e7ba4be76 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:24:51 2019 From: report at bugs.python.org (=?utf-8?q?Andreas_K=2E_H=C3=BCttel?=) Date: Mon, 22 Apr 2019 18:24:51 +0000 Subject: [issue36699] building for riscv multilib (patch attached) Message-ID: <1555957491.02.0.328369650892.issue36699@roundup.psfhosted.org> New submission from Andreas K. H?ttel : Hi. I have been trying to install Python on a (well prototype of a) risc-v multilib Gentoo system, where the system library directory is /usr/lib64/lp64d (!). See as reference for the directories https://www.sifive.com/blog/all-aboard-part-5-risc-v-multilib Python as is builds and installs fine but the results are pretty much unuseable. Symptoms are "/usr/lib64/lib64/lp64d/python3.6/site-packages" directory name and distutils installs unable to find Python.h (it is correctly installed in /usr/include/..., but distutils passes /usr/lib64/include as include path). I've tracked this down to bad values in sys.base_prefix and sys.exec_prefix: >>> sys.base_prefix '/usr/lib/python-exec/python3.6/../../../lib64' Even if I set PYTHONHOME=/usr , I get '/usr/lib64' The fix, specific for this directory layout, is to have one more directory component stripped in Modules/getpath.c , see patch below. With this I have been able to install Python with a normal-looking directory layout, and distutils things install fine. Posting this here so it gets your attention, and hoping that you're better in coming up with a general solution than I am... probably the number of components stripped should depend on the number of slashes in the library path, e.g., "lib" versus "lib64/lp64d" diff -ruN Python-3.6.8.orig/Modules/getpath.c Python-3.6.8/Modules/getpath.c --- Python-3.6.8.orig/Modules/getpath.c 2018-12-23 22:37:14.000000000 +0100 +++ Python-3.6.8/Modules/getpath.c 2019-04-21 01:05:35.127440301 +0200 @@ -796,6 +796,7 @@ if (pfound > 0) { reduce(prefix); reduce(prefix); + reduce(prefix); /* The prefix is the root directory, but reduce() chopped * off the "/". */ if (!prefix[0]) @@ -808,6 +809,7 @@ reduce(exec_prefix); reduce(exec_prefix); reduce(exec_prefix); + reduce(exec_prefix); if (!exec_prefix[0]) wcscpy(exec_prefix, separator); } Thanks. ---------- components: Build messages: 340667 nosy: Andreas K. H?ttel priority: normal severity: normal status: open title: building for riscv multilib (patch attached) type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:33:12 2019 From: report at bugs.python.org (Paul Hoffman) Date: Mon, 22 Apr 2019 18:33:12 +0000 Subject: [issue36700] base64 has old references that should be updated Message-ID: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> New submission from Paul Hoffman : The documentation for base64 library has an RFC that is obsolete. ---------- assignee: docs at python components: Documentation messages: 340668 nosy: docs at python, paulehoffman priority: normal pull_requests: 12839 severity: normal status: open title: base64 has old references that should be updated _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:45:40 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:45:40 +0000 Subject: [issue36678] duplicate method definitions in Lib/test/test_dataclasses.py In-Reply-To: <1555775728.19.0.814114535778.issue36678@roundup.psfhosted.org> Message-ID: <1555958740.46.0.807731944839.issue36678@roundup.psfhosted.org> Steve Dower added the comment: New changeset be372d73b4c59026134a7e722ece34367c3bd3b6 by Steve Dower (Windson yang) in branch 'master': bpo-36678: Rename duplicate tests in test_dataclasses (GH-12899) https://github.com/python/cpython/commit/be372d73b4c59026134a7e722ece34367c3bd3b6 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:46:29 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:46:29 +0000 Subject: [issue36683] duplicate method definition in Lib/test/test_utf8_mode.py In-Reply-To: <1555776614.31.0.832242060156.issue36683@roundup.psfhosted.org> Message-ID: <1555958789.36.0.477793008459.issue36683@roundup.psfhosted.org> Steve Dower added the comment: New changeset f51dd4feb0794b7659f281173da9d8a04317d134 by Steve Dower (Windson yang) in branch 'master': bpo-36683: Rename duplicate test_io_encoding to test_pyio_encoding (GH-12896) https://github.com/python/cpython/commit/f51dd4feb0794b7659f281173da9d8a04317d134 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:48:14 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:48:14 +0000 Subject: [issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py In-Reply-To: <1555776500.63.0.359750321582.issue36682@roundup.psfhosted.org> Message-ID: <1555958894.86.0.0842853033462.issue36682@roundup.psfhosted.org> Steve Dower added the comment: New changeset 007d0b0188a16273a5850d89857ecef97c1f4595 by Steve Dower (Windson yang) in branch 'master': bpo-36682: Rename duplicate tests in test_sys_setprofile (GH-12895) https://github.com/python/cpython/commit/007d0b0188a16273a5850d89857ecef97c1f4595 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:49:13 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:49:13 +0000 Subject: [issue36681] duplicate method definition in Lib/test/test_logging.py In-Reply-To: <1555776283.44.0.382290590702.issue36681@roundup.psfhosted.org> Message-ID: <1555958953.62.0.297806224199.issue36681@roundup.psfhosted.org> Steve Dower added the comment: New changeset 3d6f61edb8a6161148b3cf3eeb291408cc91154a by Steve Dower (Windson yang) in branch 'master': bpo-36681: Remove duplicate test_regression_29220 function (GH-12894) https://github.com/python/cpython/commit/3d6f61edb8a6161148b3cf3eeb291408cc91154a ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:50:27 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:50:27 +0000 Subject: [issue36680] duplicate method definition in Lib/test/test_importlib/test_util.py In-Reply-To: <1555776149.55.0.853112327072.issue36680@roundup.psfhosted.org> Message-ID: <1555959027.09.0.673825381745.issue36680@roundup.psfhosted.org> Steve Dower added the comment: New changeset c442b1c486db5cb0aa589b43f73385d9cc5706e3 by Steve Dower (Windson yang) in branch 'master': bpo-36680: Rename duplicate test_source_from_cache_path_like_arg function (GH-12893) https://github.com/python/cpython/commit/c442b1c486db5cb0aa589b43f73385d9cc5706e3 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:51:09 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:51:09 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1555959069.07.0.521116060957.issue36679@roundup.psfhosted.org> Steve Dower added the comment: New changeset d437012cdd4a38b5b3d05f139d5f0a28196e4769 by Steve Dower (Windson yang) in branch 'master': bpo-36679: Rename duplicate test_class_getitem function (GH-12892) https://github.com/python/cpython/commit/d437012cdd4a38b5b3d05f139d5f0a28196e4769 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:52:50 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:52:50 +0000 Subject: [issue36683] duplicate method definition in Lib/test/test_utf8_mode.py In-Reply-To: <1555776614.31.0.832242060156.issue36683@roundup.psfhosted.org> Message-ID: <1555959170.88.0.67300195571.issue36683@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:52:37 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:52:37 +0000 Subject: [issue36678] duplicate method definitions in Lib/test/test_dataclasses.py In-Reply-To: <1555775728.19.0.814114535778.issue36678@roundup.psfhosted.org> Message-ID: <1555959157.35.0.464978859099.issue36678@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:53:40 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:53:40 +0000 Subject: [issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py In-Reply-To: <1555776500.63.0.359750321582.issue36682@roundup.psfhosted.org> Message-ID: <1555959220.62.0.700336526858.issue36682@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:53:52 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:53:52 +0000 Subject: [issue36681] duplicate method definition in Lib/test/test_logging.py In-Reply-To: <1555776283.44.0.382290590702.issue36681@roundup.psfhosted.org> Message-ID: <1555959232.8.0.512450376451.issue36681@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:54:45 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:54:45 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1555959285.58.0.175092637656.issue36679@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 14:54:36 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 18:54:36 +0000 Subject: [issue36680] duplicate method definition in Lib/test/test_importlib/test_util.py In-Reply-To: <1555776149.55.0.853112327072.issue36680@roundup.psfhosted.org> Message-ID: <1555959276.55.0.913020291473.issue36680@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:06:05 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 19:06:05 +0000 Subject: [issue18564] Integer overflow in the socket function parsing a Bluetooth address In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1555959965.91.0.614538764629.issue18564@roundup.psfhosted.org> Steve Dower added the comment: According to a couple of scanf docs I found, the '%x' format expects to write into unsigned int*, just as we already do. So it shouldn't be possible to overflow there. The following line (or-ing all the values and checking that it's less than 256) handles the overflow already. Limiting each %x specifier to two characters has exactly the same effect, and could potentially fix overflow errors in C runtimes that assume a larger destination without the data size prefix ('%zx' or '%llx'), but I don't know of any of those. All that said, I'm not opposed to adding the tests. If the parsing logic is a sticking point, then that can be undone, but I think it's also okay. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:05:27 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 22 Apr 2019 19:05:27 +0000 Subject: [issue22742] IDLE shows traceback when printing non-BMP character In-Reply-To: <1414426704.85.0.168243800807.issue22742@psf.upfronthosting.co.za> Message-ID: <1555959927.89.0.841147745276.issue22742@roundup.psfhosted.org> Terry J. Reedy added the comment: On my puzzlement above: repr(s) is a string of 3 characters -- s bracketed by quote characters. print(repr(s)) fails. I am not sure how s gets expanded to the full escape in IDLE. ascii(s) expands all non-ascii and adds extra quotes. Need to check Shell code. In the python REPL, astral chars are not expanded to escape sequences. >>> s='\U0001f603' >>> s '?' # Windows REPL shows two replacement boxes instead of ? #36698 is about astral chars in exceptions messages. >>> raise Exception(s) results in the Exception traceback, 3 Unicodedecode tracebacks, and a restart. ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:09:13 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 22 Apr 2019 19:09:13 +0000 Subject: [issue36698] Shell restart when error message contains non-BMP characters In-Reply-To: <1555953357.75.0.808052597637.issue36698@roundup.psfhosted.org> Message-ID: <1555960153.24.0.302514421706.issue36698@roundup.psfhosted.org> Terry J. Reedy added the comment: You are correct about reason. This is essentially a duplicate of #22742, but I am leaving it open for now because the behavior is worse and there is additional information in the tracebacks. The lines for IDLE internals are normally removed, but the exception during the exception prevented that. ---------- superseder: -> IDLE shows traceback when printing non-BMP character versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:11:49 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 22 Apr 2019 19:11:49 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555960309.99.0.738860791076.issue36695@roundup.psfhosted.org> Brett Cannon added the comment: If you look at that commit that Thomas made all it did was change where the string was grabbed from, not what type of object was used. So it doesn't make any sense as to why that would cause any specific change, so I think this may be doctest's doing. Probably the next step is for someone to find in doctest where the string representation is being printed out to understand what would potentially shift its representation (and how it's even generating that representation). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:13:57 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 22 Apr 2019 19:13:57 +0000 Subject: [issue36661] Missing dataclass decorator import in dataclasses module docs In-Reply-To: <1555616208.44.0.536731608649.issue36661@roundup.psfhosted.org> Message-ID: <1555960437.18.0.811659624658.issue36661@roundup.psfhosted.org> Brett Cannon added the comment: I also don't think it's critical to make examples within a module's docs work like a doctest. Plus I discourage importing objects directly off of modules anyway and this would actually promote that. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:14:07 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 19:14:07 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1555960447.89.0.507513666573.issue36624@roundup.psfhosted.org> Steve Dower added the comment: I like this, though I don't like using the platform module here and would prefer sys.platform to be canonical (until there's a need to differentiate - e.g. some tests coming for Windows ARM32 will need to be more specific). In general, I'd like fewer tests to be platform specific and make more functionality "just work" across platforms, or at least platform families. I feel like more precise skips don't actually help with that - they make it too easy to say "this functionality just doesn't work here" instead of trying to make it work. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:35:15 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 22 Apr 2019 19:35:15 +0000 Subject: [issue36688] _dummy_thread lacks an RLock implementaiton In-Reply-To: <1555827608.59.0.767546227499.issue36688@roundup.psfhosted.org> Message-ID: <1555961715.05.0.0776676444887.issue36688@roundup.psfhosted.org> Brett Cannon added the comment: Basically _thread.RLock was added without an equivalent in _dummy_thread. Add that and it will fix the issue. It probably wouldn't be too hard since you have to implement it as if it's single-threaded and there's already a lock class in _dummy_thread to work off of. Heck, functools used to have its own dummy version in https://github.com/python/cpython/commit/a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 but it got ripped out, although it was extremely basic so I don't know if it would be the best version to put into _dummy_thread. ---------- keywords: +3.7regression, easy title: import dummy_threading causes ImportError -> _dummy_thread lacks an RLock implementaiton _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:38:04 2019 From: report at bugs.python.org (Mike Auty) Date: Mon, 22 Apr 2019 19:38:04 +0000 Subject: [issue11588] Add "necessarily inclusive" groups to argparse In-Reply-To: <1300377092.03.0.159307937388.issue11588@psf.upfronthosting.co.za> Message-ID: <1555961884.85.0.821068631133.issue11588@roundup.psfhosted.org> Change by Mike Auty : ---------- nosy: +ikelos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 15:49:25 2019 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Mon, 22 Apr 2019 19:49:25 +0000 Subject: [issue36699] building for riscv multilib (patch attached) In-Reply-To: <1555957491.02.0.328369650892.issue36699@roundup.psfhosted.org> Message-ID: <1555962565.15.0.426920839827.issue36699@roundup.psfhosted.org> Change by Arfrever Frehtes Taifersar Arahesis : ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 16:00:37 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 22 Apr 2019 20:00:37 +0000 Subject: [issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close() In-Reply-To: <1483731701.21.0.630358100063.issue29183@psf.upfronthosting.co.za> Message-ID: <1555963237.36.0.0913890453753.issue29183@roundup.psfhosted.org> Change by Berker Peksag : ---------- keywords: +patch pull_requests: +12840 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 16:25:09 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 22 Apr 2019 20:25:09 +0000 Subject: [issue29940] Add follow_wrapped=True option to help() In-Reply-To: <1490802065.05.0.49346265762.issue29940@psf.upfronthosting.co.za> Message-ID: <1555964709.09.0.849700297557.issue29940@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- keywords: +patch pull_requests: +12841 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 16:47:48 2019 From: report at bugs.python.org (Brian Skinn) Date: Mon, 22 Apr 2019 20:47:48 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1555966068.18.0.128252452945.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: TBH, now that I've tweaked tox and CI just not to run the doctests on 3.8, I don't really need this to be fixed. This seems like such an edge case -- a doctest catching a warning with a message containing single quotes -- it might not really be worth the effort to figure out. Unless someone is really invested in tracking this down, I would be content to close. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 18:45:31 2019 From: report at bugs.python.org (daniel hahler) Date: Mon, 22 Apr 2019 22:45:31 +0000 Subject: [issue35824] http.cookies._CookiePattern modifying regular expressions In-Reply-To: <1548385865.75.0.22198302427.issue35824@roundup.psfhosted.org> Message-ID: <1555973131.62.0.231212348658.issue35824@roundup.psfhosted.org> daniel hahler added the comment: Another example of a value that fails to parse is if "-0000" is used instead of "GMT", which is the case with GitHub: > Set-Cookie: has_recent_activity=1; path=/; expires=Mon, 22 Apr 2019 23:27:18 -0000 So using a regular expression here to only parse the sane-cookie-date format (that is recommended for output) is wrong. The last change to it was in 2012 only (https://github.com/python/cpython/commit/aeeba2629aa52e4e73e19a1502b3d3133ea68dec) ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 19:08:19 2019 From: report at bugs.python.org (daniel hahler) Date: Mon, 22 Apr 2019 23:08:19 +0000 Subject: [issue35824] http.cookies._CookiePattern modifying regular expressions In-Reply-To: <1548385865.75.0.22198302427.issue35824@roundup.psfhosted.org> Message-ID: <1555974499.68.0.935130275368.issue35824@roundup.psfhosted.org> daniel hahler added the comment: http.cookiejar parses this correctly, using http2time: >>> import http.cookiejar >>> http.cookiejar.parse_ns_headers(["has_recent_activity=1; path=/; expires=Mon, 22 Apr 2019 23:27:18 -0000"]) [[('has_recent_activity', '1'), ('path', '/'), ('expires', 1555975638), ('version', '0')]] Ref: https://github.com/python/cpython/blob/9f316bd9684d27b7e21fbf43ca86dc5e65dac4af/Lib/http/cookiejar.py#L204-L249 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 19:24:45 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 22 Apr 2019 23:24:45 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555975485.97.0.583967148317.issue9194@roundup.psfhosted.org> Change by Zackery Spytz : ---------- pull_requests: +12842 stage: backport needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 19:36:00 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 22 Apr 2019 23:36:00 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555976160.63.0.207062435537.issue9194@roundup.psfhosted.org> miss-islington added the comment: New changeset 84efbaecaf50b771cc7a95fd9dd9602bd31de305 by Miss Islington (bot) (Zackery Spytz) in branch '2.7': [2.7] bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) (GH-12916) https://github.com/python/cpython/commit/84efbaecaf50b771cc7a95fd9dd9602bd31de305 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 19:40:53 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 22 Apr 2019 23:40:53 +0000 Subject: [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop In-Reply-To: <1278558407.29.0.39315930303.issue9194@psf.upfronthosting.co.za> Message-ID: <1555976453.18.0.631688427967.issue9194@roundup.psfhosted.org> Steve Dower added the comment: Declaring this done - Ned can take the backport to 3.6 if/when he feels like it. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 20:53:02 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 00:53:02 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1555980782.94.0.971258491948.issue16079@roundup.psfhosted.org> Raymond Hettinger added the comment: Should the unittest module grow a feature to scan for duplicate methods? I imagine that duplicate methods are a common problem. Possibly, inheriting from unittest can be accompanied by a metaclass that has __prepare__ with special dictionary that detects and warns about duplicates. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 21:03:12 2019 From: report at bugs.python.org (Paul Monson) Date: Tue, 23 Apr 2019 01:03:12 +0000 Subject: [issue36511] Add Windows ARM32 buildbot In-Reply-To: <1554232161.58.0.393661272603.issue36511@roundup.psfhosted.org> Message-ID: <1555981392.1.0.924989905682.issue36511@roundup.psfhosted.org> Change by Paul Monson : ---------- keywords: +patch pull_requests: +12843 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 22:19:22 2019 From: report at bugs.python.org (MeiK) Date: Tue, 23 Apr 2019 02:19:22 +0000 Subject: [issue35824] http.cookies._CookiePattern modifying regular expressions In-Reply-To: <1548385865.75.0.22198302427.issue35824@roundup.psfhosted.org> Message-ID: <1555985962.33.0.17219270518.issue35824@roundup.psfhosted.org> MeiK added the comment: You are right, I saw the agreed way of parsing in RFC6265[1], it seems that you should not use regular expressions. I used http.cookiejar to update the code, but it failed to pass the test: https://github.com/python/cpython/blob/master/Lib/test/test_http_cookies.py#L19. However, other languages and libraries (JavaScript, Requests, http.cookiejar, etc.) cannot parse it. It seems that the contents of the brackets should be escaped. Is this a wrong test case? I updated the code[2] using http.cookiejar. Is this a good idea? English is not my native language; please excuse typing errors. [1] https://tools.ietf.org/html/rfc6265 [2] https://github.com/python/cpython/pull/11665/commits/a03bc75348a4041c7411da3175689c087a98789f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 22:54:05 2019 From: report at bugs.python.org (MeiK) Date: Tue, 23 Apr 2019 02:54:05 +0000 Subject: [issue35824] http.cookies._CookiePattern modifying regular expressions In-Reply-To: <1548385865.75.0.22198302427.issue35824@roundup.psfhosted.org> Message-ID: <1555988045.21.0.920826645324.issue35824@roundup.psfhosted.org> MeiK added the comment: I found that using http.cookiejar.parse_ns_headers would cause some of the previous tests to fail, and if you think this method is workable, I can follow it to write a new one and pass all the tests. ---------- nosy: -martin.panter, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 22 23:12:37 2019 From: report at bugs.python.org (Nitish) Date: Tue, 23 Apr 2019 03:12:37 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict In-Reply-To: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> Message-ID: <1555989157.09.0.540660765853.issue36697@roundup.psfhosted.org> Change by Nitish : ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 01:56:21 2019 From: report at bugs.python.org (Piyush) Date: Tue, 23 Apr 2019 05:56:21 +0000 Subject: [issue36701] module 'urllib' has no attribute 'request' Message-ID: <1555998981.48.0.859846222459.issue36701@roundup.psfhosted.org> New submission from Piyush : The current way to use one of `urllib.request` APIs is like this: ``` import urllib.request urllib.request.urlretrieve ``` Can we change this to: ``` import urllib urllib.request.urlretrieve ``` This will require adding 1 line at https://github.com/python/cpython/blob/master/Lib/urllib/__init__.py This is required because help on `urllib` says that `request` is part of `urllib` suggesting that `urllib.request` should be available if I `import urllib`. Moreover `import urllib.request` is not at all intuitive. I can submit a PR if other's think what I'm proposing makes sense. ---------- files: Screen Shot 2019-04-23 at 11.22.48 AM.png messages: 340690 nosy: piyush-kgp priority: normal severity: normal status: open title: module 'urllib' has no attribute 'request' versions: Python 3.6 Added file: https://bugs.python.org/file48283/Screen Shot 2019-04-23 at 11.22.48 AM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 02:04:21 2019 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 23 Apr 2019 06:04:21 +0000 Subject: [issue36701] module 'urllib' has no attribute 'request' In-Reply-To: <1555998981.48.0.859846222459.issue36701@roundup.psfhosted.org> Message-ID: <1555999461.12.0.836606512257.issue36701@roundup.psfhosted.org> Senthil Kumaran added the comment: I vaguely recollect the reason for this. It was done with the translation of Python2 code (which had urllib, urllib2, and urlparse, robotparser) etc, combined into a single package. We wanted to keep the import as urllib.request and urllib.response, and urllib.parse That said. If there is no other request currently open for this. Let's keep this, and am +1 to this suggestion. We have to think if there are any potential drawbacks for the old code which is already using 2nd level import. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 02:35:03 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 23 Apr 2019 06:35:03 +0000 Subject: [issue35824] http.cookies._CookiePattern modifying regular expressions In-Reply-To: <1548385865.75.0.22198302427.issue35824@roundup.psfhosted.org> Message-ID: <1556001303.71.0.434874571118.issue35824@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +martin.panter, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 02:48:53 2019 From: report at bugs.python.org (sayno996) Date: Tue, 23 Apr 2019 06:48:53 +0000 Subject: [issue36702] test_dtrace failed Message-ID: <1556002133.06.0.696794109378.issue36702@roundup.psfhosted.org> New submission from sayno996 : I install Python 3.7.3 on CentOS 7.6. However, when I run "make test", I got a failure on test_dtrace as: Ran 8 tests in 4.752s FAILED (failures=6, skipped=2) test test_dtrace failed test_dtrace failed == Tests result: FAILURE == 1 test failed: test_dtrace Total duration: 4 sec 771 ms Tests result: FAILURE ---------- components: Build files: test.log messages: 340692 nosy: sayno996 priority: normal severity: normal status: open title: test_dtrace failed type: compile error versions: Python 3.7 Added file: https://bugs.python.org/file48284/test.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 02:57:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 06:57:54 +0000 Subject: [issue36702] test_dtrace failed In-Reply-To: <1556002133.06.0.696794109378.issue36702@roundup.psfhosted.org> Message-ID: <1556002674.4.0.532074739191.issue36702@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:06:31 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 07:06:31 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556003191.18.0.587020006936.issue36695@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:06:47 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 07:06:47 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1556003207.74.0.344432933645.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 9013ccf6d8037f6ae78145a42d194141cb10d332 by Raymond Hettinger in branch 'master': bpo-36546: Add statistics.quantiles() (#12710) https://github.com/python/cpython/commit/9013ccf6d8037f6ae78145a42d194141cb10d332 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:11:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 07:11:46 +0000 Subject: [issue18564] Integer overflow in the socket function parsing a Bluetooth address In-Reply-To: <1374861545.82.0.430674187566.issue18564@psf.upfronthosting.co.za> Message-ID: <1556003506.89.0.408835173799.issue18564@roundup.psfhosted.org> STINNER Victor added the comment: Hum, maybe I'm just confused by "integer overflow". To me, "integer overflow" means that an operation goes out of the bounds of a C integer type. But here, the problem is more than the parser accepts invalid Bluetooth addresses? Please use a better title than "Fix integer overflow in socketmodule". Maybe "Fix Bluetooth address parser"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:13:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 07:13:33 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1556003613.75.0.592265310625.issue34155@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:15:59 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 07:15:59 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1556003759.23.0.529658703858.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: As requested, I've made the API easily extendable to handle alternative methods if those are deemed necessary. Also, it is easy to change the default. That said, it is my hope that these two methods and the current default get kept. They have several virtues: easy to explain, obviousness, widely adopted (most of the other packages offer at least of these two methods), and they have most of the desired properties listed in Hyndman & Fan. They are a good practical choice. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:45:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 07:45:20 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1556005520.53.0.178502156722.issue34155@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:49:09 2019 From: report at bugs.python.org (Marc) Date: Tue, 23 Apr 2019 07:49:09 +0000 Subject: [issue13968] Support recursive globs In-Reply-To: <1328700146.65.0.884103301197.issue13968@psf.upfronthosting.co.za> Message-ID: <1556005749.77.0.192028699855.issue13968@roundup.psfhosted.org> Marc added the comment: Please review one word documentation change at https://github.com/python/cpython/pull/12918 to clarify that recursive glob ** follows symbolic links to directories. ---------- nosy: +marc-hb pull_requests: +12844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 03:55:09 2019 From: report at bugs.python.org (Berker Peksag) Date: Tue, 23 Apr 2019 07:55:09 +0000 Subject: [issue36701] module 'urllib' has no attribute 'request' In-Reply-To: <1555998981.48.0.859846222459.issue36701@roundup.psfhosted.org> Message-ID: <1556006109.12.0.0286149188999.issue36701@roundup.psfhosted.org> Berker Peksag added the comment: What about other packages in the stdlib? For example, you can see the same behavior in the email package: >>> import email >>> email.message.EmailMessage() Traceback (most recent call last): File "", line 1, in AttributeError: module 'email' has no attribute 'message' IMO, this is how imports work in Python and IIRC os.path is the only exception in the stdlib. I think this needs to be discussed on python-ideas first. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:00:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:00:42 +0000 Subject: [issue36703] [Easy][Windows] test_subprocess: test_close_fds_with_stdio() has a race condition Message-ID: <1556006442.08.0.426230409523.issue36703@roundup.psfhosted.org> New submission from STINNER Victor : test_subprocess: test_close_fds_with_stdio() pass when run alone, but fail when run in parallel. I tagged the issue as "easy" for new contributors to Python. If someone is interested to work on this issue, please contact me in private. https://buildbot.python.org/all/#/builders/3/builds/2446 I can reproduce the issue. The test pass when run alone: > python -m test test_subprocess -m test_close_fds_with_stdio -v Running Debug|x64 interpreter... == CPython 3.7.3+ (heads/3.7:9344d74f7b, Apr 23 2019, 09:53:41) [MSC v.1915 64 bit (AMD64)] == Windows-10-10.0.17763-SP0 little-endian == cwd: C:\vstinner\python\3.7\build\test_python_6116 == CPU count: 2 == encodings: locale=cp1252, FS=utf-8 Run tests sequentially 0:00:00 [1/1] test_subprocess test_close_fds_with_stdio (test.test_subprocess.Win32ProcessTestCase) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.302s OK == Tests result: SUCCESS == 1 test OK. Total duration: 391 ms Tests result: SUCCESS But the test fails when run in parallel: > python -m test test_subprocess -m test_close_fds_with_stdio -F -j4 Running Debug|x64 interpreter... Run tests in parallel using 4 child processes 0:00:01 [ 1/1] test_subprocess failed test test_subprocess failed -- Traceback (most recent call last): File "C:\vstinner\python\3.7\lib\test\test_subprocess.py", line 2930, in test_close_fds_with_stdio self.assertEqual(p.returncode, 1) AssertionError: 0 != 1 0:00:01 [ 2/1] test_subprocess passed 0:00:01 [ 3/2] test_subprocess failed test test_subprocess failed -- Traceback (most recent call last): File "C:\vstinner\python\3.7\lib\test\test_subprocess.py", line 2930, in test_close_fds_with_stdio self.assertEqual(p.returncode, 1) AssertionError: 0 != 1 0:00:01 [ 4/3] test_subprocess failed test test_subprocess failed -- Traceback (most recent call last): File "C:\vstinner\python\3.7\lib\test\test_subprocess.py", line 2942, in test_close_fds_with_stdio self.assertEqual(p.returncode, 1) AssertionError: 0 != 1 0:00:02 [ 5/3] test_subprocess passed 0:00:02 [ 6/3] test_subprocess passed == Tests result: FAILURE == 3 tests OK. 3 tests failed: test_subprocess test_subprocess test_subprocess Total duration: 2 sec 313 ms Tests result: FAILURE ---------- keywords: easy messages: 340698 nosy: vstinner priority: normal severity: normal status: open title: [Easy][Windows] test_subprocess: test_close_fds_with_stdio() has a race condition _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:06:33 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 08:06:33 +0000 Subject: [issue35904] Add statistics.fmean(seq) In-Reply-To: <1549411161.36.0.783593325223.issue35904@roundup.psfhosted.org> Message-ID: <1556006793.12.0.630806841587.issue35904@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +12845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:09:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:09:08 +0000 Subject: [issue27645] Supporting native backup facility of SQLite In-Reply-To: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> Message-ID: <1556006948.2.0.658471137451.issue27645@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:09:07 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:09:07 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1556006947.84.0.479948645845.issue9566@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:09:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:09:08 +0000 Subject: [issue30465] FormattedValue expressions have wrong lineno and col_offset information In-Reply-To: <1495666417.53.0.222363680661.issue30465@psf.upfronthosting.co.za> Message-ID: <1556006948.12.0.491321829229.issue30465@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12847 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:07:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:07:54 +0000 Subject: [issue36703] [Easy][Windows] test_subprocess: test_close_fds_with_stdio() has a race condition In-Reply-To: <1556006442.08.0.426230409523.issue36703@roundup.psfhosted.org> Message-ID: <1556006874.83.0.31737143465.issue36703@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:26:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:26:14 +0000 Subject: [issue9566] Compilation warnings under x64 Windows In-Reply-To: <1281484786.91.0.306555541292.issue9566@psf.upfronthosting.co.za> Message-ID: <1556007974.59.0.0652246178505.issue9566@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8a9a6b443c57e47e9d10ed7775479aada4dac719 by Victor Stinner in branch '3.7': [3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920) https://github.com/python/cpython/commit/8a9a6b443c57e47e9d10ed7775479aada4dac719 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:27:27 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 08:27:27 +0000 Subject: [issue36018] Add a Normal Distribution class to the statistics module In-Reply-To: <1550448059.37.0.914986932061.issue36018@roundup.psfhosted.org> Message-ID: <1556008047.25.0.665385836867.issue36018@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +12849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:26:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:26:14 +0000 Subject: [issue27645] Supporting native backup facility of SQLite In-Reply-To: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> Message-ID: <1556007974.7.0.527180933768.issue27645@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8a9a6b443c57e47e9d10ed7775479aada4dac719 by Victor Stinner in branch '3.7': [3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920) https://github.com/python/cpython/commit/8a9a6b443c57e47e9d10ed7775479aada4dac719 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:26:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:26:14 +0000 Subject: [issue30465] FormattedValue expressions have wrong lineno and col_offset information In-Reply-To: <1495666417.53.0.222363680661.issue30465@psf.upfronthosting.co.za> Message-ID: <1556007974.51.0.656164401851.issue30465@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8a9a6b443c57e47e9d10ed7775479aada4dac719 by Victor Stinner in branch '3.7': [3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920) https://github.com/python/cpython/commit/8a9a6b443c57e47e9d10ed7775479aada4dac719 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:35:18 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 08:35:18 +0000 Subject: [issue35904] Add statistics.fmean(seq) In-Reply-To: <1549411161.36.0.783593325223.issue35904@roundup.psfhosted.org> Message-ID: <1556008518.76.0.697893318723.issue35904@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 7280048690244e73b13f4f68b96c244bcb5434e8 by Raymond Hettinger in branch 'master': bpo-35904: Add missing fmean() entry to the summary table (GH-12919) https://github.com/python/cpython/commit/7280048690244e73b13f4f68b96c244bcb5434e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:50:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:50:47 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1556009447.86.0.0374102087528.issue36635@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:50:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:50:47 +0000 Subject: [issue36696] possible multiple regressions on AIX In-Reply-To: <1555916317.7.0.351129409796.issue36696@roundup.psfhosted.org> Message-ID: <1556009447.92.0.949801368536.issue36696@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12851 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:47:01 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 23 Apr 2019 08:47:01 +0000 Subject: [issue36696] possible multiple regressions on AIX In-Reply-To: <1555935322.19.0.583267673117.issue36696@roundup.psfhosted.org> Message-ID: <840b5380-2151-c9d8-f6c0-70ebffa8e354@felt.demon.nl> Michael Felt added the comment: On 22/04/2019 14:15, Inada Naoki wrote: > Inada Naoki added the comment: > > Maybe, XLC doesn't support -D name. -Dname should be used instead. Excellent hint: the diff between bot run 1013 and run 1014 reveals: diff --git a/setup.py b/setup.py index 9c83914fd9..c470719a6a 100644 --- a/setup.py +++ b/setup.py @@ -725,13 +725,13 @@ class PyBuildExt(build_ext): ???????? # heapq ???????? self.add(Extension("_heapq", ["_heapqmodule.c"])) ???????? # C-optimized pickle replacement -??????? self.add(Extension("_pickle", ["_pickle.c"])) +??????? self.add(Extension("_pickle", ["_pickle.c"], +?????????????????????????? extra_compile_args=['-D Py_BUILD_CORE_MODULE'])) ???????? # atexit ???????? self.add(Extension("atexit", ["atexitmodule.c"])) ???????? # _json speedups ???????? self.add(Extension("_json", ["_json.c"], -?????????????????????????? # pycore_accu.h requires Py_BUILD_CORE_BUILTIN -?????????????????????????? extra_compile_args=['-DPy_BUILD_CORE_BUILTIN'])) +?????????????????????????? extra_compile_args=['-D Py_BUILD_CORE_MODULE'])) ???????? # profiler (_lsprof is for cProfile.py) ???????? self.add(Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c'])) So, some simple editing: and the diff with master (of yesterday): diff --git a/setup.py b/setup.py index 3d6404f89e..58c16e8ba4 100644 --- a/setup.py +++ b/setup.py @@ -726,12 +726,12 @@ class PyBuildExt(build_ext): ???????? self.add(Extension("_heapq", ["_heapqmodule.c"])) ???????? # C-optimized pickle replacement ???????? self.add(Extension("_pickle", ["_pickle.c"], -?????????????????????????? extra_compile_args=['-D Py_BUILD_CORE_MODULE'])) +?????????????????????????? extra_compile_args=['-DPy_BUILD_CORE_MODULE'])) ???????? # atexit ???????? self.add(Extension("atexit", ["atexitmodule.c"])) ???????? # _json speedups ???????? self.add(Extension("_json", ["_json.c"], -?????????????????????????? extra_compile_args=['-D Py_BUILD_CORE_MODULE'])) +?????????????????????????? extra_compile_args=['-DPy_BUILD_CORE_MODULE'])) ???????? # profiler (_lsprof is for cProfile.py) ???????? self.add(Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c'])) @@ -816,7 +816,7 @@ class PyBuildExt(build_ext): ???????? # Python Internal C API test module ???????? self.add(Extension('_testinternalcapi', ['_testinternalcapi.c'], -?????????????????????????? extra_compile_args=['-D Py_BUILD_CORE_MODULE'])) +?????????????????????????? extra_compile_args=['-DPy_BUILD_CORE_MODULE'])) ???????? # Python PEP-3118 (buffer protocol) test module ???????? self.add(Extension('_testbuffer', ['_testbuffer.c'])) And now the modules build as expected. Should I open PR - or is this better fixed in the original PR? What keeps things cleaner? > > ---------- > nosy: +inada.naoki > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:46:24 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 08:46:24 +0000 Subject: [issue36018] Add a Normal Distribution class to the statistics module In-Reply-To: <1550448059.37.0.914986932061.issue36018@roundup.psfhosted.org> Message-ID: <1556009184.89.0.936434234967.issue36018@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset fb8c7d53326d137785ca311bfc48c8284da46770 by Raymond Hettinger in branch 'master': bpo-36018: Make "seed" into a keyword only argument (GH-12921) https://github.com/python/cpython/commit/fb8c7d53326d137785ca311bfc48c8284da46770 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:52:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 08:52:32 +0000 Subject: [issue36696] possible multiple regressions on AIX In-Reply-To: <1555916317.7.0.351129409796.issue36696@roundup.psfhosted.org> Message-ID: <1556009552.77.0.875084410787.issue36696@roundup.psfhosted.org> STINNER Victor added the comment: > Should I open PR - or is this better fixed in the original PR? What keeps things cleaner? I wrote PR 12922. I really hate -Ddefine syntax, but it seems like we have to use it just for AIX :-( I tried to use "-D Py_BUILD_CORE_..." in Modules/Setup, but Module/makesetup is also stupid and doesn't support this syntax :-( I was too lazy to fix Module/makesetup. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 04:57:12 2019 From: report at bugs.python.org (Martin Panter) Date: Tue, 23 Apr 2019 08:57:12 +0000 Subject: [issue36701] module 'urllib' has no attribute 'request' In-Reply-To: <1555998981.48.0.859846222459.issue36701@roundup.psfhosted.org> Message-ID: <1556009832.53.0.950260701474.issue36701@roundup.psfhosted.org> Martin Panter added the comment: The ?urllib? package also contains ?urllib.parse?, which is a lot more lightweight than ?urllib.request?. In a quick experiment, importing ?urllib.request? is more than 2 times slower than importing ?urllib.parse? on its own. And importing ?urllib? by itself is not much faster, so I guess a lot of the time is unavoidable Python startup, and ?urllib.request? is probably many times slower than ?urllib.parse?. The reason for the slowness is the dependencies and initialization. The ?urllib.parse? module only imports a few commonly-used modules. On the other hand, importing ?urllib.request? imports many heavyweight high-level modules directly and indirectly (email submodules in particular, also things like SSL, multithreading, HTTP client, temporary files). Some of these dependencies also compile lots of regular expressions at import time. The slowdown can be a problem for things like command-line programs. Just today I found ?circusd --help? on a Raspberry Pi took ~5 s to produce output. The case of ?os.path? is different: it isn?t a submodule of ?os?. It is just a pointer to ?posixpath?, ?ntpath?, etc, depending on ?os.name?. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 05:23:47 2019 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 23 Apr 2019 09:23:47 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict In-Reply-To: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> Message-ID: <1556011427.42.0.477664191524.issue36697@roundup.psfhosted.org> Eric V. Smith added the comment: I think this is correct. The documentation says globals is "the function?s module globals". I suggest closing this as not a bug. https://docs.python.org/3/library/inspect.html#inspect.getclosurevars ---------- nosy: +eric.smith status: open -> pending type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 05:45:03 2019 From: report at bugs.python.org (Noitul) Date: Tue, 23 Apr 2019 09:45:03 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict In-Reply-To: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> Message-ID: <1556012703.89.0.474292399721.issue36697@roundup.psfhosted.org> Noitul added the comment: Sorry for the misleading snippet above. And how about this one: >>> import inspect >>> a = 0 >>> b = 1 >>> c = 2 >>> def abc(): >>> return a.b >>> print(inspect.getclosurevars(abc)) ClosureVars(nonlocals={}, globals={'a': 0, 'b': 1}, builtins={}, unbound=set()) If this is not a bug, the "globals" is the "function's module globals", but why 'c' not in the "globals"? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:07:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 10:07:03 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556014023.54.0.449571197372.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: > ... Now, I'm confused. Is PR 12876 useless? Was distutils already fixed? My test was wrong, objdump sometimes uses "RUNPATH", sometimes "RPATH": $ objdump -a -x build/lib.linux-x86_64-*/lxml/etree.cpython-*-x86_64-linux-gnu.so|grep -i -E 'rpath|RUNPATH' RUNPATH /opt/py38/lib Wait, they are not the same. Now I'm confused :-) More doc about RPATH and RUNPATH: https://blog.qt.io/blog/2011/10/28/rpath-and-runpath/ "An additional source of confusion is that, depending on your distribution, the -rpath argument in ?ld? behaves differently. For some it generates a DT_RPATH and for others DT_RPATH and DT_RUNPATH." """ Unless loading object has RUNPATH: RPATH of the loading object, then the RPATH of its loader (unless it has a RUNPATH), ..., until the end of the chain, which is either the executable or an object loaded by dlopen Unless executable has RUNPATH: RPATH of the executable LD_LIBRARY_PATH RUNPATH of the loading object ld.so.cache default dirs """ I'm now also confused by UnixCCompiler.runtime_library_dir_option() of distutils.unixccompiler which starts with a long comment: # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library # is sought. GCC on GNU systems (Linux, FreeBSD, ...) has to # be told to pass the -R option through to the linker, whereas # other compilers and gcc on other systems just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. Linux code path: if self._is_gcc(compiler): # gcc on non-GNU systems does not need -Wl, but can # use it anyway. Since distutils has always passed in # -Wl whenever gcc was used in the past it is probably # safest to keep doing so. if sysconfig.get_config_var("GNULD") == "yes": # GNU ld needs an extra option to get a RUNPATH # instead of just an RPATH. return "-Wl,--enable-new-dtags,-R" + dir else: return "-Wl,-R" + dir else: # No idea how --enable-new-dtags would be passed on to # ld if this system was using GNU ld. Don't know if a # system like this even exists. return "-R" + dir When GCC is detected on Linux and GNULD sysconfig variable is equal to "yes", distutils uses "-Wl,--enable-new-dtags,-R " rather than "-Wl,-R " or just "-R ". See also https://wiki.debian.org/RpathIssue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:10:33 2019 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 23 Apr 2019 10:10:33 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict In-Reply-To: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> Message-ID: <1556014233.51.0.159958136165.issue36697@roundup.psfhosted.org> Eric V. Smith added the comment: That is interesting. See these examples. I'm starting a new interpreter each time: >>> import inspect >>> def abc(): pass ... >>> inspect.getclosurevars(abc) ClosureVars(nonlocals={}, globals={}, builtins={}, unbound=set()) >>> >>> import inspect >>> def abc(): a ... >>> inspect.getclosurevars(abc) ClosureVars(nonlocals={}, globals={}, builtins={}, unbound={'a'}) >>> >>> import inspect >>> a=0 >>> def abc(): a ... >>> inspect.getclosurevars(abc) ClosureVars(nonlocals={}, globals={'a': 0}, builtins={}, unbound=set()) >>> >>> import inspect >>> a=0 >>> def abc(): a.b ... >>> inspect.getclosurevars(abc) ClosureVars(nonlocals={}, globals={'a': 0}, builtins={}, unbound={'b'}) >>> >>> import inspect >>> a=0 >>> b=1 >>> def abc(): a.b ... >>> inspect.getclosurevars(abc) ClosureVars(nonlocals={}, globals={'a': 0, 'b': 1}, builtins={}, unbound=set()) >>> It's odd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:21:16 2019 From: report at bugs.python.org (Charles P) Date: Tue, 23 Apr 2019 10:21:16 +0000 Subject: [issue31525] require sqlite3_prepare_v2 In-Reply-To: <1505872064.75.0.0943053140419.issue31525@psf.upfronthosting.co.za> Message-ID: <1556014876.4.0.263941644554.issue31525@roundup.psfhosted.org> Change by Charles P : ---------- pull_requests: +12852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:26:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 10:26:38 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1556015198.75.0.207510906747.issue36635@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 574913479f26b5ff48827861bce68281be01d16e by Victor Stinner in branch 'master': bpo-36635, bpo-36696: Fix setup.py on AIX (GH-12922) https://github.com/python/cpython/commit/574913479f26b5ff48827861bce68281be01d16e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:26:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 10:26:38 +0000 Subject: [issue36696] possible multiple regressions on AIX In-Reply-To: <1555916317.7.0.351129409796.issue36696@roundup.psfhosted.org> Message-ID: <1556015198.69.0.992538126074.issue36696@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 574913479f26b5ff48827861bce68281be01d16e by Victor Stinner in branch 'master': bpo-36635, bpo-36696: Fix setup.py on AIX (GH-12922) https://github.com/python/cpython/commit/574913479f26b5ff48827861bce68281be01d16e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:29:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 10:29:59 +0000 Subject: [issue36696] possible multiple regressions on AIX In-Reply-To: <1555916317.7.0.351129409796.issue36696@roundup.psfhosted.org> Message-ID: <1556015399.8.0.502607097578.issue36696@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Build resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 06:58:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 10:58:36 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556017116.91.0.000574700561681.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: I'm also confused by the diversity of ways to declare runtime paths. I found these linker flags related to rpath: * -rpath=PATH * -rpath-link=PATH * -R FILENAME, --just-symbols=FILENAME: "Read symbol names and their addresses from FILENAME, (...). For compatibility with other ELF linkers, if the -R option is followed by a directory name, rather than a file name, it is treated as the -rpath option." * --enable-new-dtags, --disable-new-dtags: "new dynamic tags in ELF" configure and Makefile manipulates *compiler* flags, not *linker* flags, and so options like "-Wl,-rpath=PATH" is used: "-Wl,OPTION" pas OPTION as an option to the linker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:08:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 11:08:08 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556017688.61.0.809844058374.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-445902 which modified distutils to use "-Wl,-R " rather than "-R ". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:10:40 2019 From: report at bugs.python.org (Michael Felt) Date: Tue, 23 Apr 2019 11:10:40 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555960447.89.0.507513666573.issue36624@roundup.psfhosted.org> Message-ID: <48ca6c94-7fdf-3b59-9d3d-502cf72cbcf1@felt.demon.nl> Michael Felt added the comment: On 22/04/2019 21:14, Steve Dower wrote: > Steve Dower added the comment: > > I like this, though I don't like using the platform module here and would prefer sys.platform to be canonical (until there's a need to differentiate - e.g. some tests coming for Windows ARM32 will need to be more specific). I thought I would try `platform` as that already seemed to be more portable over different versions (e.g., linux3, linux4, linux5, aix4, aix5, aix7 coming from sys.platform while platform.system() was already 'Linux' and 'AIX' respectively). Personally, it makes difference to me. Being 'runtime' rather than 'buildtime' seemed more precise - tests that are not meant to be build-time dependent use run-time status while leaving sys.platform for concerns that are directly related to builds (e.g., cross-platform-builds; when adding modules using eggs or pip where the module may want a "build-platform" dependency; etc). In either case - I do believe in a 'canonical' statement - that could be (later) documented in a PEP (e.g., update to PEP 8 if that is also applicable to test writing). Looking forward - question - should the same canon be applied within the core? Here is "merely" looking at Lib/test > > In general, I'd like fewer tests to be platform specific and make more functionality "just work" across platforms, or at least platform families. I feel like more precise skips don't actually help with that - they make it too easy to say "this functionality just doesn't work here" instead of trying to make it work. Agreed. Although there shall always be some platform differences. Some "platform functions" will be absent or at least different. Not directly related perhaps, but is a function absent as a "platform" function when it is only available after a third-party (aka "asis") library is installed? I, personally, have a hard time identifying what is really "core" - asin - must be present for Python to be Python, versus must be present to support a more (or less) commonly used 'module'. I'll wait a bit for any other comments - and I am curious about thoughts for the platforms 'ignored', e.g., hpux, cygwin, vmax(?), and a few more. Maybe the "common wisdom" is that the exceptions for the special platforms that are here - should just be removed - looking forward. Perhaps being restored because someone working on (supporting) that platform requests it being restored. I would hope this would also help to further clean up the tests. > > ---------- > nosy: +steve.dower > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:26:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 11:26:08 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556018768.26.0.740720267919.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: My understanding of Fedora 00001-rpath.patch is that it ignores -rpath PATH option passed to the setup.py bdist command if PATH is equal to Python sysconfig LIBDIR variable. So it impacts how third party C extensions are built. On my Fedora, LIBDIR is set to: $ python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))" /usr/lib64 Only LIBDIR directory is ignored: other -rpath directories are passed to the linker. --- UnixCCompiler.link() has a runtime_library_dirs parameter which can be modified by the _fix_lib_args() method and then is passed to gen_lib_options(). gen_lib_options() calls compiler.runtime_library_dir_option() on each directory of runtime_library_dirs: this part is responsible to use the proper linker option: -R, -rpath, -L, etc. build_ext.build_extension() method of distutils.commands.build_ext pass Extension.runtime_library_dirs to compiler.link_shared_object() build_ext.check_extensions_list() modify the runtime_library_dirs attribute: # Medium-easy stuff: same syntax/semantics, different names. ext.runtime_library_dirs = build_info.get('rpath') I understand that build_info.get('rpath') comes from -rpath command line option of setup.py bdist_ext command: ('rpath=', 'R', "directories to search for shared C libraries at runtime"), ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:34:33 2019 From: report at bugs.python.org (Kubilay Kocak) Date: Tue, 23 Apr 2019 11:34:33 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556019273.63.0.0341171662824.issue36659@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:38:37 2019 From: report at bugs.python.org (Alan Jenkins) Date: Tue, 23 Apr 2019 11:38:37 +0000 Subject: [issue36704] logging.FileHandler currently hardcodes errors='strict' Message-ID: <1556019517.33.0.109747791974.issue36704@roundup.psfhosted.org> New submission from Alan Jenkins : ## Problem description ``` import os import logging logging.basicConfig(filename='example.log',level=logging.DEBUG) for name in os.listdir(): logging.error('Hypothetical syntax error at line 1 of file: {}'.format(name)) ``` The above program is incorrect.[*] Because it is liable to raise UnicodeEncodeError. This can be reproduced on a standard UTF-8 locale by creating a filename which is not valid UTF-8, e.g. `touch $(printf '\xff')`. Plenty of arguments have been written on this topic, but this is not my problem. The user can report the program error, and it should not be too hard to debug. And there is a fairly straightforward workaround, following Python's IOError: use repr() when outputing filenames. But there is another issue with the above. The docs advise that most programs deployed to production, will want to set `logging.raiseExceptions = false`. My motivating example is the Linux package manager dnf, which followed this advice. Specifically when they wanted to avoid UnicodeEncodeError. [**][***] Link: https://bugzilla.redhat.com/show_bug.cgi?id=1303293#c17 I think UnicodeEncodeError is an important case to handle, but the logging module does not handle it in a good way. When we have `logging.raiseExceptions = false`, the problem messages will be lost. Those messages could be critical to troubleshooting the user's problem. It is even possible that all messages are lost - I think this would be very frustrating to troubleshoot. ## Alternative solutions which have been considered * All debugging problems could of course be avoided, by simply writing correct programs in the first place. The existence of debuggers suggests this is not a practical answer, even for Python :-). * FileHandler can be worked around fairly simply, using StreamHandler instead. However if you wanted to use RotatingFileHandler, there is no (documented) interface that would let you work around it. SyslogHandler also seems important enough to be worth worrying about. ## A possible solution When you set `raiseExceptions = false`, logging.FileHandler and friends should use errors='backslashreplace'. errors='backslashreplace' is already the default for sys.stderr. Matching this seems nice in case the program uses the default stderr logging in some configurations. A log file full of encoding noise will be a specific sign, that can be used in troubleshooting. And in cases similar to my example program, parts of the message could be entirely readable. The end-user might be able to use the log message without noticing the incorrectness at all. This is entirely consistent with the rationale for `logging.raiseExceptions = false`. Previously you could set logging.raiseExceptions *after* you create the logger. It will be a bit inconsistent if FileHandler relies on setting the `errors` parameter of `open()`. It seems fairly easy to document this restriction. But if that is not considered acceptable, we would either need some weird system that calls stream.reconfigure(), or muck around like dnf.i18n.UnicodeStream does: try: stream.write(s) except UnicodeEncodeError: if logging.raiseExceptions: raise else: stream.flush() # make sure nothing gets out of order! s = s.encode(stream.encoding, 'backslashreplace') stream.buffer.write(s) --- [*] C programs which segfault are said to be incorrect (or there is an error in system software or hardware). I am using similar phrasing for python programs which raise unhandled UnicodeError's. I am not sure if it is a good phrase to use for a Python program, but I hope my overall point is fairly clear. [**] dnf developers did not appear to work on the correctness issue they found. It might be a bug in gettext. [***] In the linked case, *none* of dnf's messages were readable. But I sympathize that dnf is so critical, it seems useful for dnf to try and hobble along. Even in cases like this one. As the user attempts to work towards some desired end state... The user might temporarily ignore the non-fatal problem in dnf, because their current problem seems more important, e.g. trying to install some software needed to recover or back up document files. At best, they might know some diagnostic software that knows how to diagnose they have a locale problem :-). Or more serendipitously, installing certain other software that also suffers a locale problem might help them realize what is happening. ---------- components: Library (Lib) messages: 340717 nosy: sourcejedi priority: normal severity: normal status: open title: logging.FileHandler currently hardcodes errors='strict' type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:44:28 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 23 Apr 2019 11:44:28 +0000 Subject: [issue36704] logging.FileHandler currently hardcodes errors='strict' In-Reply-To: <1556019517.33.0.109747791974.issue36704@roundup.psfhosted.org> Message-ID: <1556019868.57.0.627760023327.issue36704@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:56:11 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 23 Apr 2019 11:56:11 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1556020571.78.0.388687690367.issue18372@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 359bd4f61b9e1493081f4f67882554247b53926a by Inada Naoki (Zackery Spytz) in branch 'master': bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505) https://github.com/python/cpython/commit/359bd4f61b9e1493081f4f67882554247b53926a ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 07:56:32 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 23 Apr 2019 11:56:32 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1556020592.83.0.508789709978.issue18372@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 08:18:28 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 23 Apr 2019 12:18:28 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1556021908.27.0.252007554832.issue18372@roundup.psfhosted.org> miss-islington added the comment: New changeset c0f6f5370325459cadd90010530b1d300dce514e by Miss Islington (bot) in branch '3.7': bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505) https://github.com/python/cpython/commit/c0f6f5370325459cadd90010530b1d300dce514e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 08:25:18 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 23 Apr 2019 12:25:18 +0000 Subject: [issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self) In-Reply-To: <1373064790.68.0.920175606727.issue18372@psf.upfronthosting.co.za> Message-ID: <1556022318.68.0.531076325691.issue18372@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 08:47:49 2019 From: report at bugs.python.org (Gavin D'souza) Date: Tue, 23 Apr 2019 12:47:49 +0000 Subject: [issue36705] Unexpected Behaviour of pprint.pprint Message-ID: <1556023669.77.0.896724829798.issue36705@roundup.psfhosted.org> New submission from Gavin D'souza : For a simple string input, pprint would be expected to return an output similar to print. However, the functionality differs ### Code: import time from pprint import pprint start = time.time() time.sleep(0.5) object_made = time.time() time.sleep(0.5) done = time.time() time.sleep(0.5) shown = time.time() pprint( f"Time to create object: {object_made - start}s\n" + f"Time to insert 100000 rows: {done - object_made}s\n" + f"Time to retrieve 100000 rows: {shown - done}s\n" ) ### Output Received: ('Time to create object: 0.5010814666748047s\n' 'Time to insert 100000 rows: 0.5010972023010254s\n' 'Time to retrieve 100000 rows: 0.501101016998291s\n') ### Expected Output: Time to create object: 0.5010814666748047s Time to insert 100000 rows: 0.5010972023010254s Time to retrieve 100000 rows: 0.501101016998291s ---------- components: Library (Lib) messages: 340720 nosy: Gavin D'souza, fdrake priority: normal severity: normal status: open title: Unexpected Behaviour of pprint.pprint type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 08:54:52 2019 From: report at bugs.python.org (Gavin D'souza) Date: Tue, 23 Apr 2019 12:54:52 +0000 Subject: [issue36705] Unexpected Behaviour of pprint.pprint In-Reply-To: <1556023669.77.0.896724829798.issue36705@roundup.psfhosted.org> Message-ID: <1556024092.92.0.855536853534.issue36705@roundup.psfhosted.org> Gavin D'souza added the comment: if pprint is called without parameters, it returns a TypeError >>> pprint() Traceback (most recent call last): File "", line 1, in TypeError: pprint() missing 1 required positional argument: 'object' it would be beneficial however to return an empty string or a new line character instead. An erroneous call would generate an unnecessary run-time error in a huge script ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:04:47 2019 From: report at bugs.python.org (serge g) Date: Tue, 23 Apr 2019 13:04:47 +0000 Subject: [issue36706] Python script on startup stucks at import Message-ID: <1556024687.06.0.0109255005812.issue36706@roundup.psfhosted.org> New submission from serge g : I am not sure if it is python's issue (correct me if this is wrong place for report). But sometimes (probably every 3-4 attempt) when I run script, interpreter just stucks for some time (0.5-3 minutes) and then actually runs the script normally. To figure out what happens I increased verbosity (python -vv) and actually python hangs on import on this line: ... # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/kdf/scrypt.abi3.so # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/kdf/scrypt.so # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py # /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/kdf/__pycache__/scrypt.cpython-37.pyc matches /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py # code object from '/home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/hazmat/primitives/kdf/__pycache__/scrypt.cpython-37.(pyc' (here >>>>>) import 'cryptography.hazmat.primitives.kdf.scrypt' # <_frozen_importlib_external.SourceFileLoader object at 0x7f5c6e3c73c8> import 'cryptography.hazmat.backends.openssl.backend' # <_frozen_importlib_external.SourceFileLoader object at 0x7f5c6c129c88> import 'cryptography.hazmat.backends.openssl' # <_frozen_importlib_external.SourceFileLoader object at 0x7f5c6d30d240> # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/x509/UnsupportedExtension.cpython-37m-x86_64-linux-gnu.so # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/x509/UnsupportedExtension.abi3.so # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/x509/UnsupportedExtension.so # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/x509/UnsupportedExtension.py # trying /home/2kg/spider/venv/lib/python3.7/site-packages/cryptography/x509/UnsupportedExtension.pyc ... I had version 3.5 installed before and didn't notice such issue. Other scripts from my project suffer from this symptom as well. My configuration is: debian 9 python 3.7.3 [GCC 6.3.0 20170516] on linux cryptography module ? version 2.6.1 ---------- components: Library (Lib) messages: 340722 nosy: serge g priority: normal severity: normal status: open title: Python script on startup stucks at import type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:09:46 2019 From: report at bugs.python.org (Florian Weimer) Date: Tue, 23 Apr 2019 13:09:46 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556024986.86.0.181535901006.issue36659@roundup.psfhosted.org> Change by Florian Weimer : ---------- nosy: +fweimer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:17:37 2019 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 23 Apr 2019 13:17:37 +0000 Subject: [issue36705] Unexpected Behaviour of pprint.pprint In-Reply-To: <1556023669.77.0.896724829798.issue36705@roundup.psfhosted.org> Message-ID: <1556025457.68.0.472353591198.issue36705@roundup.psfhosted.org> Eric V. Smith added the comment: pprint.pprint is not designed to be a drop-in replacement for print. At this point, we cannot break existing code to change how pprint works. I suggest you make a pprint.pprint wrapper that does what you want, or maybe subclass pprint.PrettyPrinter. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:18:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 13:18:36 +0000 Subject: [issue36706] Python script on startup stucks at import In-Reply-To: <1556024687.06.0.0109255005812.issue36706@roundup.psfhosted.org> Message-ID: <1556025516.02.0.299857324334.issue36706@roundup.psfhosted.org> STINNER Victor added the comment: It seems like you are using Linux. Please using strace to trace system calls to see where Python is stuck: strace -tt -o trace python3 script.py Once you reproduce the issue using strace, attach created "trace" file to this issue. "-tt" adds timestamp with millisecond resolution. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:26:25 2019 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Tue, 23 Apr 2019 13:26:25 +0000 Subject: [issue36705] Unexpected Behaviour of pprint.pprint In-Reply-To: <1556023669.77.0.896724829798.issue36705@roundup.psfhosted.org> Message-ID: <1556025985.0.0.365428131189.issue36705@roundup.psfhosted.org> Fred L. Drake, Jr. added the comment: Eric nailed it; pprint was not designed as a replacement for print, and was never intended to serve that purpose. Rejecting as out of scope. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:31:48 2019 From: report at bugs.python.org (Alan Jenkins) Date: Tue, 23 Apr 2019 13:31:48 +0000 Subject: [issue36704] logging.FileHandler currently hardcodes errors='strict' In-Reply-To: <1556019517.33.0.109747791974.issue36704@roundup.psfhosted.org> Message-ID: <1556026308.46.0.372148882346.issue36704@roundup.psfhosted.org> Alan Jenkins added the comment: > [**] dnf developers did not appear to work on the correctness issue they found. It might be a bug in gettext. Nitpick: sorry, I read too quickly. dnf *did* fix the specific correctness issue, as well as setting raiseExceptions = false. It is explained by the PR description (and the diff) https://github.com/rpm-software-management/dnf/pull/751 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 09:53:34 2019 From: report at bugs.python.org (Florian Weimer) Date: Tue, 23 Apr 2019 13:53:34 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556027614.83.0.0172932512562.issue36659@roundup.psfhosted.org> Florian Weimer added the comment: Note that linking with -Wl,-rpath,/usr/lib64 (even if it's redundant) disables part of the ld.so cache on Linux. Instead, paths under /usr/lib64 are probed explicitly. This can add quite a few failing open/openat system calls to the process startup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 10:25:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 14:25:42 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556029542.0.0.66394129099.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: > Since 2010, the Fedora packages of Python are using a patch on distutils UnixCCompiler to remove standard library path from rpath. The patch has been written by David Malcolm for Python 2.6.4: https://src.fedoraproject.org/rpms/python2/c/f5df1f834310948b32407933e3b8713e1121105b Hum, in fact the initial patch author is: Ignacio Vazquez-Abrams. The commit message says: "fixup distutils/unixccompiler.py to remove standard library path from rpath (patch 17)" the specfile contains this comment: # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of # super() as it's an old-style class "ivazquez" is Ignacio Vazquez-Abrams who wrote an early version of the Python 3 specfile for Fedora and the rpath patch, but he stopped to contribute to Fedora around 2006. David Malcolm wrote the final specfile using Ignacio's patch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 10:32:38 2019 From: report at bugs.python.org (Charalampos Stratakis) Date: Tue, 23 Apr 2019 14:32:38 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556029958.91.0.564170400578.issue36659@roundup.psfhosted.org> Change by Charalampos Stratakis : ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:02:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 15:02:44 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556031764.42.0.296078449901.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: I'm confused between RPATH and RUNPATH which are *different*. When I configure Python using LDFLAGS="-Wl,-rpath=/opt/py38/lib/" (Python configure and Makefile), Python, libpython, and dynamic libraries ELF of C extensions get a RPATH. When I use setup.py build_ext -rpath (distutils), dynamic libraries ELF of C extensions get a RUNPATH. More details below. -- When I build lxml using patched Fedora Python (/usr/bin/python3), I get: $ python3 setup.py build_ext --rpath /custom/rpath ... $ objdump -a -x build/lib.linux-x86_64-3.7/lxml/etree.cpython-37m-x86_64-linux-gnu.so|grep -Ei 'rpath|runpath' RUNPATH /custom/rpath Note: when I use patched Fedora Python, "--rpath /usr/lib64" of "python3 setup.py build_ext --rpath /usr/lib64" is ignored: the .so file doesn't have RPATH nor RUNPATH. That's the purpose of the patch. -- When I built Python using ./configure --prefix /opt/py38 LDFLAGS="-Wl,-rpath=/opt/py38/lib/" --enable-shared, I got: $ objdump -a -x /opt/py38/bin/python3.8|grep -i rpath RPATH /opt/py38/lib/ $ objdump -a -x /opt/py38/lib/libpython3.8m.so|grep -i rpath RPATH /opt/py38/lib/ If I build lxml without an explicit rpath, it inherits the Python rpath: $ LD_LIBRARY_PATH=/opt/py38/lib ./opt_env/bin/python setup.py build_ext $ objdump -a -x build/lib.linux-x86_64-3.8/lxml/etree.cpython-38m-x86_64-linux-gnu.so|grep -Ei 'rpath|runpath' RPATH /opt/py38/lib/ If I build lxml with an explicit rpath, I get: $ LD_LIBRARY_PATH=/opt/py38/lib ./opt_env/bin/python setup.py build_ext --rpath /custom/rpath $ objdump -a -x build/lib.linux-x86_64-3.8/lxml/etree.cpython-38m-x86_64-linux-gnu.so|grep -Ei 'rpath|runpath' RUNPATH /opt/py38/lib/:/custom/rpath ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:02:50 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 23 Apr 2019 15:02:50 +0000 Subject: [issue36701] module 'urllib' has no attribute 'request' In-Reply-To: <1555998981.48.0.859846222459.issue36701@roundup.psfhosted.org> Message-ID: <1556031770.29.0.628326456557.issue36701@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:04:36 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 15:04:36 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556031876.88.0.927028529747.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: In 2015, Robert Kuska proposed to remove the patch from Fedora: "This check should be covered by rpmlint which MUST be run during the review so I propose to drop this patch." https://bugzilla.redhat.com/show_bug.cgi?id=1287566#c1 But Toshio Ernie Kuratomi explained that the patch is a practical solution to avoid rpath on /usr/lib64 for all Fedora libraries (built by Python): "I would recommend against dropping the patch. Since it's only removing LIBDIR, it's removing an rpath that should never be needed (the dynamic linker will try LIBDIR on its own, no need for an rpath to make it do so). The patch means that distutils does not add the unneeded rpath to any binaries it generates which is what that Debian page recommends (patch the build system). If we were to drop the patch, then package maintainers of C extensions would need to add boilerplate to their packages which strips the unnecessary rpath. Better to do that in a single place (the python package) if we can. If you do decide to drop rpath, you should also coordinate updating all existing C extension packages to include the boilerplate removing rpath. Python packaging guidelines could also be updated to mention it (but not strictly necessary -- the rpath guidelines cover this... it would just be keeping the information in one place)." https://bugzilla.redhat.com/show_bug.cgi?id=1287566#c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:18:53 2019 From: report at bugs.python.org (RimacV) Date: Tue, 23 Apr 2019 15:18:53 +0000 Subject: [issue36658] Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory In-Reply-To: <1555599436.89.0.215369051789.issue36658@roundup.psfhosted.org> Message-ID: <1556032733.68.0.817884103825.issue36658@roundup.psfhosted.org> RimacV added the comment: As you said, I just had to set all paths, when using Py_SetPath. >From my side this issue could be closed. Thank you! :-) ---------- components: +Library (Lib) -Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:18:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 15:18:05 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556032685.03.0.141108701849.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: Ratione from my colleague Carlos O'Donell: "The intent of this patch is to remove the default search paths of the dynamic loader from DT_RPATH/DT_RUNPATH. This allows the default system paths to be searched last as is expected by most programs, and enables LD_LIBRARY_PATH and cache searches to happen first. The patch does not forbid rpath in any form, but forbids promoting default system search paths in this way." He added: If you allow the default library paths in rpath, it bypasses the usual hierarchy of checks -> (a) DT_RPATH -> (b) LD_LIBRARY_PATH -> (c) DT_RUNPATH -> (d) cache -> (e) system defaults. Allowing /usr/lib64 in DT_RPATH moves that path from (e) -> (a). In terms of a search hierarchy. It's not really the behaviour you want in the [Fedora/RHEL] distribution, you want the system defaults to be at the end of the search order instead of being promoted to early searches. The intent of the patch should be documented as such so we remember why we made the change. It's the same problem as adding /usr/lib64 to LD_LIBRARY_PATH, which on RHEL7 actually has a bug in some cases which can lead to crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:26:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 15:26:25 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556033185.6.0.894512710342.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: To come back to RPATH vs RUNPATH: these 2 are very different in term of priorities in search (see other comments). distutils uses an heuristic to opt-in for RUNPATH using GNU ld --enable-new-dtags option. This option is only used if the following 3 conditions are met: (1) the OS is not macOS, not FreeBSD, nor HP-UX (2) the C compiler is detected as GCC (3) Python detected the linker as being GNU ld Problem: the heuristic is not very reliable: (3) only checks the linker when Python is build, it's implemented as: sysconfig.get_config_var("GNULD") == "yes". In practice, the linker can be changed at runtime using environment variables and so Python may miss the oportunity for opt-in for --enable-new-dtags, or pass this option which is unknown to another linker. (2) The detection of GCC checks for "gcc" or "g++" string if the name of the compiler program name. If you use "cc", it's not detected as GCC. I'm not sure that these 2 problems are real problems "in practice". My main concern is that you might get RPATH or RUNPATH depending on operating system, the C compiler and the linker, whereas RPATH semantics is very different from RUNPATH semantics (search priority). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:37:21 2019 From: report at bugs.python.org (Chun-Yu Tseng) Date: Tue, 23 Apr 2019 15:37:21 +0000 Subject: [issue22135] allow to break into pdb with Ctrl-C for all the commands that resume execution In-Reply-To: <1407185061.52.0.89159247831.issue22135@psf.upfronthosting.co.za> Message-ID: <1556033841.49.0.407760706559.issue22135@roundup.psfhosted.org> Chun-Yu Tseng added the comment: My bad, I totally forget this patch. Need to spend some time to retest my code and catch up with current development flow. Thanks for reminding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:39:17 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 23 Apr 2019 15:39:17 +0000 Subject: [issue36658] Py_Initialze() throws error 'unable to load the file system encoding' when calling Py_SetPath with a path to a directory In-Reply-To: <1555599436.89.0.215369051789.issue36658@roundup.psfhosted.org> Message-ID: <1556033957.62.0.849505065827.issue36658@roundup.psfhosted.org> Steve Dower added the comment: Glad to hear it. Hopefully as we redesign the embedding initialization APIs this kind of problem will become easier to solve (it's certainly one of my concerns with the current API). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:44:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 15:44:29 +0000 Subject: [issue36635] Add _testinternalcapi module In-Reply-To: <1555339880.27.0.999764272678.issue36635@roundup.psfhosted.org> Message-ID: <1556034269.49.0.75522741774.issue36635@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:48:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 15:48:50 +0000 Subject: [issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 In-Reply-To: <1553738093.66.0.485436393765.issue36454@roundup.psfhosted.org> Message-ID: <1556034530.08.0.143589618906.issue36454@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12854 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 11:53:32 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 23 Apr 2019 15:53:32 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1555158343.77.0.950141438455.issue36624@roundup.psfhosted.org> Message-ID: <1556034812.27.0.620139702453.issue36624@roundup.psfhosted.org> Steve Dower added the comment: > Being 'runtime' rather than 'buildtime' seemed more precise - tests that > are not meant to be build-time dependent use run-time status while > leaving sys.platform for concerns that are directly related to builds This is a good point - perhaps we need both? Many of the current test skips are related to build-time switches, but indeed, some relate to the runtime environment. One aspect I'm keeping in mind here is that with the Windows Subsystem for Linux, many lines are becoming blurred with respect to which build of Python people are using (I'm already getting bug reports from people who thought they were getting the Windows build but actually the Linux one, or vice versa). And mismatching builds causes some weird problems. Being able to clearly identify "Windows build + WSL environment" or "Linux build + WSL environment" will likely matter more over time. It would be nice to have all the checks centralized, perhaps a set of decorators in a test.requires module? @test.requires.linux_platform @test.requires.darwin_platform @test.requires.macos_runtime(10, 9) def test_my_test(self): ... (It would require some clever decorator design, but we can make those work like "ORs" rather than "ANDs".) Does it provide any benefit? I think it's clever, but that doesn't mean it's worthwhile :) Using skipIf and skipUnless with test.support.CONSTANTS is just as readable and just as obvious (once we're using them consistently). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 13:08:29 2019 From: report at bugs.python.org (Brett Cannon) Date: Tue, 23 Apr 2019 17:08:29 +0000 Subject: [issue36701] module 'urllib' has no attribute 'request' In-Reply-To: <1555998981.48.0.859846222459.issue36701@roundup.psfhosted.org> Message-ID: <1556039309.39.0.317427172926.issue36701@roundup.psfhosted.org> Brett Cannon added the comment: I'm -1 on pulling `request` up to implicitly be part of the `urllib` namespace without an import. `os.path` is the only exception that I know of in the stdlib and that's historical (it predates packages existing in the language). Otherwise the proposed change is suggesting that we automatically import all submodules to the top of a package which is expensive (as Martin pointed out), and simply not how Python's import is meant to be used. And the statement that "`request` is part of `urllib`" is true today, just like saying any submodule is part of a package. If that wording is confusing then a PR to tweak the wording could be considered. Since there are 3 core devs who are against this idea I'm closing this as "not a bug". Thanks for the idea regardless, Piyush! ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 14:07:29 2019 From: report at bugs.python.org (Billy McCulloch) Date: Tue, 23 Apr 2019 18:07:29 +0000 Subject: [issue22107] tempfile module misinterprets access denied error on Windows In-Reply-To: <1406724041.52.0.0365391579019.issue22107@psf.upfronthosting.co.za> Message-ID: <1556042849.9.0.353830807439.issue22107@roundup.psfhosted.org> Billy McCulloch added the comment: I stand by the patch file I previously submitted on 2016-05-04. A more detailed analysis / description of my reasoning follows. Change 1 in _get_default_tempdir: A PermissionError is thrown on Windows if you attempt to create a file whose filename matches an existing directory. As the code currently stands, the `if` statement checks whether the proposed file's *parent* directory is a directory (which it is, or a FileNotFoundError would have been thrown), instead of whether the proposed filename conflicts with an existing directory. The edited expression is really a typo that, in the context of the code block, always evaluates `True`. Here?s what we?re now saying in the `if` block: when a PermissionError is raised, if we?re on Windows (the only currently supported platform to throw nonsense errors at us) AND the filename we chose simply conflicts with an existing directory AND we supposedly have write access to the parent directory, then we were just unlucky with the chosen name and should try again in the same parent directory. (I say supposedly because Windows seems to erroneously report True on this check, even when we don?t have write access. I wouldn?t be surprised if this last check does something useful in certain contexts, I just don?t know what they are.) Change 2 in _mkstemp_inner: Same as above for Change 1. While _get_default_tempdir uses this code block to make sure the system tempdir is really writable, and _mkstemp_inner does it so that a file descriptor can be returned, the result and arguments are the same. Change 3 in mkdtemp: For _get_default_tempdir and _mkstemp_inner, the blocks of code in question are creating temporary files. As such, they need to handle the oddball case for Windows where attempts to create a file with a filename which conflicts with an existing directory name result in a PermissionError. The same block of error handling code is copied in mkdtemp, even though this function never tries to create a file ? it only tries to create a directory. As such, in the case that we try to create a directory with a name that already exists (whether as a file or a directory), we wouldn't be dealing with a PermissionError, we'd have a FileExistsError, which is already handled in mkdtemp by the preceding lines. The only way I?ve seen a PermissionError crop up for a call to mkdir on Windows is if the user doesn?t have permission to create filesystem objects in the parent directory. This is the intended usage of a PermissionError, so no special handling needed is required. Remember, a PermissionError shouldn?t happen if mkdtemp is called without a `dir` kwarg, because the _sanitize_params will invoke _get_default_tempdir, which will check to ensure that the parent directory is writable. As such, this block of code was superfluous, and the patch should not raise PermissionError in user code where it previously was caught. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 14:25:22 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 23 Apr 2019 18:25:22 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1556043922.99.0.58094619179.issue36700@roundup.psfhosted.org> Serhiy Storchaka added the comment: base64 supports RFC 3548, but not RFC 4648. ===================================================================== 13. Changes Since RFC 3548 Added the "base32 extended hex alphabet", needed to preserve sort order of encoded data. Referenced IMAP for the special Base64 encoding used there. Fixed the example copied from RFC 2440. Added security consideration about providing a signature for cryptoanalysis. Added test vectors. Fixed typos. ===================================================================== To support RFC 4648 we need to add support for base 32 encoding with extended hex alphabet (see 16995). Check also that RFC 4648 test vectors are used in the module tests. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 14:25:43 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 23 Apr 2019 18:25:43 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1556043943.96.0.102352078683.issue36700@roundup.psfhosted.org> Serhiy Storchaka added the comment: See issue16995. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 14:47:48 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 23 Apr 2019 18:47:48 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556045268.63.0.998234124343.issue36695@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I did some more debugging. doctest patches linecache which does some regex matching when filename is of the form [examplenumber]> to return example source. Before the commit seems absolute path was present in warning and hence this regex didn't match. With the commit returning the filename of this format that matches the regex the example line is again returned. This happens with warnings inside doctest because doctest patches linecache which is used by warnings.py during formatting the warning. In CPython for some reason presence of both single quote and double quote inside a triple quoted string causes the single quote to be escaped. Any concatenation with the escaped triple quoted string also escapes the resulting text. doctest seems to store the examples as single quoted strings that are escaped and escaping them during _formatwarnmsg_impl causes the other one also to be escaped. It also happens with a normal string that has an escaped double quote. >>> a = """Test '' b""" # Two single quotes >>> a "Test '' b" >>> a = """Test " b'""" # One single and double quote >>> a 'Test " b\'' >>> a + "'c'" 'Test " b\'\'c\'' >>> a = """Test ' b""" # Only single quote >>> a "Test ' b" >>>> a + "'c'" "Test ' b'c'" >>>> a = "Test ' b\"" # Escaped double quote >>>> a 'Test \' b"' >>>> a + "'a'" 'Test \' b"\'a\'' Does anyone know why this happens with escaped quotes and single quote being escaped? Is this expected and is it part of spec about how single and double quote are swapped over representation? Longer explanation : Take the below sample doctest file $ cat ../backups/bpo36695.rst >>> import warnings # line 0 >>> warnings.warn("Test 'a'") # line 1 doctest patches linecache.getlines to a custom function `__patched_linecache_getlines` [0] linecache.getlines = __patched_linecache_getlines __LINECACHE_FILENAME_RE = re.compile(r'.+)' r'\[(?P\d+)\]>$') def __patched_linecache_getlines(self, filename, module_globals=None): m = self.__LINECACHE_FILENAME_RE.match(filename) if m and m.group('name') == self.test.name: example = self.test.examples[int(m.group('examplenum'))] return example.source.splitlines(keepends=True) else: return self.save_linecache_getlines(filename, module_globals) doctest forms a special filename as below that is passed to exec(compile()) and hence as per the commit warning is now raised as the filename "" in the warning. doctest also mocks sys.stdout internally to have the output captured to a StringIO buffer. [1] # Use a special filename for compile(), so we can retrieve # the source code during interactive debugging (see # __patched_linecache_getlines). filename = '' % (test.name, examplenum) # Before commit cpython git:(3b0b90c8c3) ./python.exe -m doctest ../backups/bpo36695.rst /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/doctest.py:1: UserWarning: Test 'a' # Module doctest. # After commit $ cpython git:(11a896652e) ./python.exe -m doctest ../backups/bpo36695.rst :1: UserWarning: Test 'a' warnings.warn("Test 'a'") formatting warning message [2] calls linecache.getline with filename as "" after commit which in turn calls linecache.getlines that is patched above by doctest and hence it matches the regex and returns the example.source "warnings.warn("Test 'a'")". It seems to be a triple quoted string that is already escaped and hence in the below line calling s += " %s\n" % line causes the actual warning message and the example source line to be escaped. def _formatwarnmsg_impl(msg): s = ("%s:%s: %s: %s\n" % (msg.filename, msg.lineno, msg.category.__name__, msg.message)) if msg.line is None: try: import linecache line = linecache.getline(msg.filename, msg.lineno) except Exception: # When a warning is logged during Python shutdown, linecache # and the import machinery don't work anymore line = None linecache = None else: line = msg.line if line: line = line.strip() s += " %s\n" % line [0] https://github.com/python/cpython/blob/29d018aa63b72161cfc67602dc3dbd386272da64/Lib/doctest.py#L1468 [1] https://github.com/python/cpython/blob/29d018aa63b72161cfc67602dc3dbd386272da64/Lib/doctest.py#L1452 [2] https://github.com/python/cpython/blob/29d018aa63b72161cfc67602dc3dbd386272da64/Lib/warnings.py#L35 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 15:16:32 2019 From: report at bugs.python.org (Paul Hoffman) Date: Tue, 23 Apr 2019 19:16:32 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1556046992.93.0.470968797178.issue36700@roundup.psfhosted.org> Paul Hoffman added the comment: We can update the references without supporting every mode given in the new document. It is common for people to support RFC X without supporting every possible option of RFC X. Having said that, I think adding extended hex makes good sense, if possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 15:30:24 2019 From: report at bugs.python.org (Brian Skinn) Date: Tue, 23 Apr 2019 19:30:24 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556047824.27.0.888013341474.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: It looks to me like it's a standard feature of the CPython string rendering routines, where if single and double quotes are present in any string, the preferred rendering is enclosure with single quotes with escaped internal single quotes. On 3.6.6, regardless how I enter the following, it always returns enclosed in single quotes: >>> """ ' " """ ' \' " ' >>> ''' ' " ''' ' \' " ' >>> ' \' " ' ' \' " ' >>> " ' \" " ' \' " ' For my particular situation, then, the problem is that my warning message, as it sits in the source, consists of a double-quoted string that contains single quotes. Then, when 3.8 doctest goes to print the source line, it has to print a string containing both single and double quotes, so the above default rendering rule kicks in and it gets printed with enclosing single-quotes. For 3.7 doctest, where the regex doesn't match, the source line doesn't get printed, and so the resulting string contains no double quotes, and thus the string gets printed with enclosing double quotes. Clearly, the solution is just for me to change the warning message! And indeed, changing to `warnings.warn("foo has no bar")` and updating the expected result to `'...UserWarning: foo has no bar\n...'` yields a passing test on both 3.7 and 3.8 now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 15:44:30 2019 From: report at bugs.python.org (Brian Skinn) Date: Tue, 23 Apr 2019 19:44:30 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556048670.73.0.131962052711.issue36695@roundup.psfhosted.org> Change by Brian Skinn : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 18:15:30 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 23 Apr 2019 22:15:30 +0000 Subject: [issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 In-Reply-To: <1553738093.66.0.485436393765.issue36454@roundup.psfhosted.org> Message-ID: <1556057730.42.0.113674962817.issue36454@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 18:15:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 22:15:33 +0000 Subject: [issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 In-Reply-To: <1553738093.66.0.485436393765.issue36454@roundup.psfhosted.org> Message-ID: <1556057733.43.0.515263683643.issue36454@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d246a6766b9d8cc625112906299c4cb019944300 by Victor Stinner in branch 'master': bpo-36454: Fix test_time.test_monotonic() (GH-12929) https://github.com/python/cpython/commit/d246a6766b9d8cc625112906299c4cb019944300 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 18:35:59 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 23 Apr 2019 22:35:59 +0000 Subject: [issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 In-Reply-To: <1553738093.66.0.485436393765.issue36454@roundup.psfhosted.org> Message-ID: <1556058959.24.0.92178828176.issue36454@roundup.psfhosted.org> miss-islington added the comment: New changeset e1a6cf2824acb43dc80473e0d938db99856daa97 by Miss Islington (bot) in branch '3.7': bpo-36454: Fix test_time.test_monotonic() (GH-12929) https://github.com/python/cpython/commit/e1a6cf2824acb43dc80473e0d938db99856daa97 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 19:09:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 23:09:32 +0000 Subject: [issue36465] No longer enable Py_TRACE_REFS by default in debug build In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556060972.86.0.468713379949.issue36465@roundup.psfhosted.org> STINNER Victor added the comment: Since my goal here is to support a C extension compiled in release mode on a Python compiled in debug mode, Py_TRACE_REFS should be a new separated ABI since it modify Py_INCREF/Py_DECREF. Maybe a new configure option should be added to opt-in for Py_TRACE_REFS and add "t" (T stands for Trace references) to SOABI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 19:46:23 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 23 Apr 2019 23:46:23 +0000 Subject: [issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 In-Reply-To: <1553738093.66.0.485436393765.issue36454@roundup.psfhosted.org> Message-ID: <1556063183.79.0.165658157677.issue36454@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 20:09:15 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 24 Apr 2019 00:09:15 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556064555.48.0.486926444546.issue36695@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the update and report, Brian. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 20:27:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 00:27:25 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed Message-ID: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> New submission from STINNER Victor : In Python 2.7, the WITH_PYMALLOC define (defined by ./configure --with-pymalloc which is the default) modified the Python API. For example, PyObject_MALLOC() is a macro replaced with PyObject_Malloc() with pymalloc but replaced with PyMem_MALLOC() without pymalloc. In Python 3.8, it's no longer the case, PyObject_MALLOC is no longer modified by WITH_PYMALLOC, it's always an alias to PyObject_Malloc() for backward compatibility. #define PyObject_MALLOC PyObject_Malloc More generally, WITH_PYMALLOC has no impact on the Python headers nor on the ABI in any way. Memory allocators can be switched at runtime using PYTHONMALLOC environment variable and -X dev command line option. For example, PYTHONMALLOC=malloc disables pymalloc (forces the usage of malloc() of the C library). I propose attached PR which removes the "m" flag from SOABI in Python 3.8 when pymalloc is enabled. ---------- messages: 340748 nosy: vstinner priority: normal severity: normal status: open title: The "m" ABI flag of SOABI for pymalloc is no longer needed versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 20:33:53 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 00:33:53 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556066033.99.0.529759830561.issue36707@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12856 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 20:36:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 00:36:49 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556066209.46.0.199020240035.issue36707@roundup.psfhosted.org> STINNER Victor added the comment: I modified PyObject_MALLOC and other macros when I implemented the PEP 445 "Add new APIs to customize Python memory allocators": https://www.python.org/dev/peps/pep-0445/ ABI tags are defined by the PEP 3149: https://www.python.org/dev/peps/pep-3149/#proposal "--with-pymalloc (flag: m)" The PEP 393 already made "--with-wide-unicode (flag: u)" useless in Python 3.3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 20:51:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 00:51:29 +0000 Subject: [issue36465] No longer enable Py_TRACE_REFS by default in debug build In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556067089.08.0.593805362108.issue36465@roundup.psfhosted.org> STINNER Victor added the comment: I started a thread on python-dev to discuss this issue: "[Python-Dev] Use C extensions compiled in release mode on a Python compiled in debug mode" https://mail.python.org/pipermail/python-dev/2019-April/157178.html It's a follow-up of my previous thread: "[Python-Dev] No longer enable Py_TRACE_REFS by default in debug build" https://mail.python.org/pipermail/python-dev/2019-April/157015.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 20:52:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 00:52:03 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556067123.19.0.210220170853.issue36465@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: No longer enable Py_TRACE_REFS by default in debug build -> Make release and debug ABI compatible _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 21:02:10 2019 From: report at bugs.python.org (=?utf-8?b?5p6X6Ieq5Z2H?=) Date: Wed, 24 Apr 2019 01:02:10 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1556067730.61.0.284606969332.issue36639@roundup.psfhosted.org> ??? added the comment: >From the discussion in https://mail.python.org/pipermail/python-ideas/2019-April/056416.html, Guido said: > Some use cases for rindex() on strings that I found in a large codebase here include searching a pathname for the final slash, a list of comma-separated items for the last comma, a fully-qualified module name for the last period, and some ad-hoc parsing of other things. The "last separator" use cases are the most common and here rindex() sounds very useful. I guess that's strong enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 21:09:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 01:09:58 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1556068198.93.0.0174773231191.issue36639@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 21:22:49 2019 From: report at bugs.python.org (daniel hahler) Date: Wed, 24 Apr 2019 01:22:49 +0000 Subject: [issue5215] change value of local variable in debug In-Reply-To: <1234338182.69.0.0258607971835.issue5215@psf.upfronthosting.co.za> Message-ID: <1556068969.71.0.775695868205.issue5215@roundup.psfhosted.org> daniel hahler added the comment: @Andrei That is something different, caused by "y" only being defined later. But it would be nice if it would work. Should be a separate/new issue though. ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 21:50:24 2019 From: report at bugs.python.org (Noitul) Date: Wed, 24 Apr 2019 01:50:24 +0000 Subject: [issue36697] inspect.getclosurevars returns wrong globals dict In-Reply-To: <1555922969.45.0.450842121898.issue36697@roundup.psfhosted.org> Message-ID: <1556070624.84.0.577742168334.issue36697@roundup.psfhosted.org> Noitul added the comment: Look at this https://github.com/python/cpython/blob/3.6/Lib/inspect.py#L1412 We are taking names from func.__code__.co_names, which also contains names of object's attributes we visited. As a result, we may get more names unexpectedly in 'globals', 'builtins', and even 'unbound'. And this example might be another case of this potentially bug >>> import inspect >>> def abc(): ... import os ... sys = None ... >>> inspect.getclosurevars(abc) ClosureVars(nonlocals={}, globals={}, builtins={}, unbound={'os'}) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 21:53:04 2019 From: report at bugs.python.org (daniel hahler) Date: Wed, 24 Apr 2019 01:53:04 +0000 Subject: [issue5215] change value of local variable in debug In-Reply-To: <1234338182.69.0.0258607971835.issue5215@psf.upfronthosting.co.za> Message-ID: <1556070784.71.0.245432902403.issue5215@roundup.psfhosted.org> daniel hahler added the comment: This works however (Python 3.7), but is just buggy in pdbpp (another project). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 22:22:38 2019 From: report at bugs.python.org (Brian Skinn) Date: Wed, 24 Apr 2019 02:22:38 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556072558.74.0.2287925081.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: Thank you for taking the time to dig into it so deeply! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 22:45:55 2019 From: report at bugs.python.org (daniel hahler) Date: Wed, 24 Apr 2019 02:45:55 +0000 Subject: [issue9633] pdb go stack up/down In-Reply-To: <1282133837.82.0.171010459939.issue9633@psf.upfronthosting.co.za> Message-ID: <1556073955.96.0.78593046613.issue9633@roundup.psfhosted.org> Change by daniel hahler : ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 22:54:29 2019 From: report at bugs.python.org (Patrick Artman) Date: Wed, 24 Apr 2019 02:54:29 +0000 Subject: [issue36689] docs: os.path.commonpath raises ValueError for different drives In-Reply-To: <1555837758.83.0.507858438764.issue36689@roundup.psfhosted.org> Message-ID: <1556074469.18.0.389746469118.issue36689@roundup.psfhosted.org> Patrick Artman added the comment: If this isn't taken I'd be happy to give it a go as my first contribution ---------- nosy: +pjartman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 23 23:13:17 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 24 Apr 2019 03:13:17 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556075597.16.0.0340251423086.issue36707@roundup.psfhosted.org> Serhiy Storchaka added the comment: If --with-pymalloc does not impact the API, why we need this option? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 03:05:10 2019 From: report at bugs.python.org (SilentGhost) Date: Wed, 24 Apr 2019 07:05:10 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1556089510.56.0.514424800775.issue36639@roundup.psfhosted.org> SilentGhost added the comment: > I guess that's strong enough. As a str.rindex use case. I don't read it as Guido's endorsing list.rindex proposal, johnlinp. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 03:27:44 2019 From: report at bugs.python.org (Thomas Kluyver) Date: Wed, 24 Apr 2019 07:27:44 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556090864.62.0.98443452731.issue36695@roundup.psfhosted.org> Thomas Kluyver added the comment: I'm still a bit confused why it gets escaped - as far as I know, the escaping only happens when you repr() a string, as the displayhook does automatically: >>> a = """ a ' single and " double quote """ >>> a ' a \' single and " double quote ' >>> print(repr(a)) ' a \' single and " double quote ' >>> print("%r" % a) ' a \' single and " double quote ' >>> print(a) a ' single and " double quote The warnings code doesn't appear to ever repr() the message. So I guess it's some further bit of interaction with doctest. But unfortunately I don't have time to dig through doctest to try and understand it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 03:36:28 2019 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 24 Apr 2019 07:36:28 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556091388.33.0.659080656801.issue36669@roundup.psfhosted.org> Mark Dickinson added the comment: > It's not obvious why it should. I'd say that it's not obvious why it shouldn't. The "weakproxy" type currently supports every single "PyNumberMethods" slot *except* matrix multiplication: see https://github.com/python/cpython/blob/bf94cc7b496a379e1f604aa2e4080bb70ca4020e/Objects/weakrefobject.c#L610-L645 It seems likely that this was an unintentional omission when matrix multiplication was added. I can't think of any good reason to support all but one (well, two, including the in-place method) of those PyNumberMethods. Supporting all of them gives a (conceptually) smaller, simpler object. I think this is a consistency bug that should be fixed. ---------- nosy: +mark.dickinson status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 03:50:35 2019 From: report at bugs.python.org (sakamotoaya) Date: Wed, 24 Apr 2019 07:50:35 +0000 Subject: [issue36708] can not execute the python + version, to launch python under windows. Message-ID: <1556092235.7.0.350859031075.issue36708@roundup.psfhosted.org> New submission from sakamotoaya : I am sorry if it is existing problem to launch Python 3.6, execute the command in Command Prompt under windows py -3.6?Success python3.6?Fail to launch Python 3.6, execute the command in Command Prompt under Linux py -3.6?Fail python3.6?Success I would like to unify the command. What are your thoughts on that? ---------- components: Windows messages: 340761 nosy: HiyashiChuka, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: can not execute the python + version, to launch python under windows. type: enhancement versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 04:12:37 2019 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 24 Apr 2019 08:12:37 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556093557.26.0.698847383156.issue36669@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +12857 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 04:32:51 2019 From: report at bugs.python.org (=?utf-8?b?5p6X6Ieq5Z2H?=) Date: Wed, 24 Apr 2019 08:32:51 +0000 Subject: [issue36639] Provide list.rindex() In-Reply-To: <1555397184.25.0.31391745163.issue36639@roundup.psfhosted.org> Message-ID: <1556094771.9.0.582390874889.issue36639@roundup.psfhosted.org> ??? added the comment: Hi @SilentGhost, Yes, sorry I didn't make it clear. I was just posting the discussion here for some reference, not claiming that this issue should be reopened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 04:35:18 2019 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 24 Apr 2019 08:35:18 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556094918.62.0.814101168117.issue36669@roundup.psfhosted.org> Mark Dickinson added the comment: Adding Nathaniel Smith (the matrix multiplication PEP author), just in case he knows some reason why weakref.proxy objects should _not_ support the matrix multiplication operator. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 04:37:47 2019 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 24 Apr 2019 08:37:47 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556095067.83.0.811803602103.issue36669@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: -> mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 04:48:27 2019 From: report at bugs.python.org (Tom Christie) Date: Wed, 24 Apr 2019 08:48:27 +0000 Subject: [issue36709] Asyncio SSL keep-alive connections raise errors after loop close. Message-ID: <1556095707.61.0.53219784779.issue36709@roundup.psfhosted.org> New submission from Tom Christie : If an asyncio SSL connection is left open (eg. any kind of keep-alive connection) then after closing the event loop, an exception will be raised... Python: ``` import asyncio import ssl import certifi async def f(): ssl_context = ssl.create_default_context() ssl_context.load_verify_locations(cafile=certifi.where()) await asyncio.open_connection('example.org', 443, ssl=ssl_context) loop = asyncio.get_event_loop() loop.run_until_complete(f()) loop.close() ``` Traceback: ``` $ python example.py Fatal write error on socket transport protocol: transport: <_SelectorSocketTransport fd=8> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 868, in write n = self._sock.send(data) OSError: [Errno 9] Bad file descriptor Fatal error on SSL transport protocol: transport: <_SelectorSocketTransport closing fd=8> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 868, in write n = self._sock.send(data) OSError: [Errno 9] Bad file descriptor During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py", line 676, in _process_write_backlog self._transport.write(chunk) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 872, in write self._fatal_error(exc, 'Fatal write error on socket transport') File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 681, in _fatal_error self._force_close(exc) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/selector_events.py", line 693, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 677, in call_soon self._check_closed() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 469, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed ``` It looks to me like the original "OSError: [Errno 9] Bad file descriptor" probably shouldn't be raised in any case - if when attempting to tear down the SSL connection, then we should probably pass silently in the case that the socket has already been closed uncleanly. Bought to my attention via: https://github.com/encode/httpcore/issues/16 ---------- assignee: christian.heimes components: SSL, asyncio messages: 340764 nosy: asvetlov, christian.heimes, tomchristie, yselivanov priority: normal severity: normal status: open title: Asyncio SSL keep-alive connections raise errors after loop close. versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 05:01:58 2019 From: report at bugs.python.org (sakamotoaya) Date: Wed, 24 Apr 2019 09:01:58 +0000 Subject: [issue36708] can not execute the python + version, to launch python under windows. In-Reply-To: <1556092235.7.0.350859031075.issue36708@roundup.psfhosted.org> Message-ID: <1556096518.23.0.447374658904.issue36708@roundup.psfhosted.org> Change by sakamotoaya : ---------- nosy: +CuriousLearner, docs at python, ncoghlan, ronaldoussoren, serhiy.storchaka, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 05:10:09 2019 From: report at bugs.python.org (Tom Christie) Date: Wed, 24 Apr 2019 09:10:09 +0000 Subject: [issue36709] Asyncio SSL keep-alive connections raise errors after loop close. In-Reply-To: <1556095707.61.0.53219784779.issue36709@roundup.psfhosted.org> Message-ID: <1556097009.14.0.33902052801.issue36709@roundup.psfhosted.org> Tom Christie added the comment: This appears somewhat related: https://bugs.python.org/issue34506 As it *also* logs exceptions occuring during `_fatal_error` and `_force_close`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 05:16:07 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 24 Apr 2019 09:16:07 +0000 Subject: [issue36708] can not execute the python + version, to launch python under windows. In-Reply-To: <1556092235.7.0.350859031075.issue36708@roundup.psfhosted.org> Message-ID: <1556097367.05.0.0835855030071.issue36708@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: -serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 05:44:22 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 09:44:22 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556075597.16.0.0340251423086.issue36707@roundup.psfhosted.org> Message-ID: STINNER Victor added the comment: pymalloc is enabled by default. --without-pymalloc allows to build Python without pymalloc and use malloc by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 06:22:02 2019 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 24 Apr 2019 10:22:02 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556101322.73.0.262066640154.issue36669@roundup.psfhosted.org> Nathaniel Smith added the comment: Yeah, seems like a simple oversight to me. (Actually this is the first I've heard of weakref.proxy...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 06:50:07 2019 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 24 Apr 2019 10:50:07 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556103007.22.0.810864439214.issue36707@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 06:51:29 2019 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 24 Apr 2019 10:51:29 +0000 Subject: [issue36454] test_time: test_monotonic() failed on AMD64 FreeBSD 10-STABLE Non-Debug 3.7 In-Reply-To: <1553738093.66.0.485436393765.issue36454@roundup.psfhosted.org> Message-ID: <1556103089.85.0.34262141997.issue36454@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 06:54:33 2019 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 24 Apr 2019 10:54:33 +0000 Subject: [issue35755] On Unix, shutil.which() and subprocess no longer look for the executable in the current directory if PATH environment variable is not set In-Reply-To: <1547682106.56.0.245747157525.issue35755@roundup.psfhosted.org> Message-ID: <1556103273.12.0.802082531666.issue35755@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 06:55:14 2019 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 24 Apr 2019 10:55:14 +0000 Subject: [issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x In-Reply-To: <1555326100.12.0.0433329524894.issue36632@roundup.psfhosted.org> Message-ID: <1556103314.27.0.377212267383.issue36632@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 07:05:25 2019 From: report at bugs.python.org (Kubilay Kocak) Date: Wed, 24 Apr 2019 11:05:25 +0000 Subject: [issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed. In-Reply-To: <1527017681.69.0.682650639539.issue33608@psf.upfronthosting.co.za> Message-ID: <1556103925.01.0.512629810254.issue33608@roundup.psfhosted.org> Kubilay Kocak added the comment: @Eric Happy to give you SSH access to one of the FreeBSD buildbots that's experienced the crash if it helps. Just flick me a pubkey, I'm on IRC (koobs @ freenode / #python-dev) ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 07:12:49 2019 From: report at bugs.python.org (Matej Cepl) Date: Wed, 24 Apr 2019 11:12:49 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556104369.5.0.912196616294.issue36659@roundup.psfhosted.org> Matej Cepl added the comment: Just to add my CZK 0.02 (or ?0,0008 ;)). We don't have this patch in openSUSE Python packages, we run rpmlint on all submissions to our build system (so unwanted rpath shouldn't sneak into the distribution), and yet the only Python C extension which needs RPATH manipulation is cx_Freeze, and that is apparently somehow strange package. ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 07:32:57 2019 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 24 Apr 2019 11:32:57 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556105577.83.0.194775623942.issue35224@roundup.psfhosted.org> Ned Batchelder added the comment: 3.8.0a3 is out, and the What's New still doesn't mention this work yet. ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 07:39:47 2019 From: report at bugs.python.org (Matej Cepl) Date: Wed, 24 Apr 2019 11:39:47 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556105986.99.0.448733541063.issue36659@roundup.psfhosted.org> Matej Cepl added the comment: OK, vstinner asked me for more explanation: * we at openSUSE are as opposed to rpath as Fedora developers (actually, https://en.opensuse.org/openSUSE:Packaging_checks#Beware_of_Rpath is stolen from Fedora wiki, apparently) * none of Python packages (python2, python3 in all various *SUSE related distributions) has the mentioned patch * in all 11794 SPEC files in openSUSE Factory only 36 packages use chrpath (many other packages either patch ./configure or use various --disable-rpath options), and there is only one Python related package, python-cx_Freeze among them. Its SPEC file is https://build.opensuse.org/package/view_file/devel:languages:python/python-cx_Freeze/python-cx_Freeze.spec?expand=1 , but I would think that is (being a compiler) quite specialized package which may do something strange. * We run rpmlint with checks for rpath enabled on all submissions to our build systems, so it shouldn't go unnoticed. * generally, it seems to me, that the patch is really unnecessary for us. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 08:58:00 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 12:58:00 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable Message-ID: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> New submission from STINNER Victor : Eric Snow moved global variables into a _PyRuntimeState structure which is made of sub-structures. There is a single instance of _PyRuntimeState: the _PyRuntime global variable. I would like to add "_PyRuntimeState *" parameters to functions to avoid relying directly on _PyRuntime global variable. The long term goal is to have "stateless" code: don't rely on global variables, only on input parameters. In practice, we will continue to use thread local storage (TLS) to get the "current context" like the current interpreter and the current Python thread state. ---------- components: Interpreter Core messages: 340772 nosy: vstinner priority: normal severity: normal status: open title: Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:02:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:02:02 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556114522.89.0.492059845527.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12858 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:08:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:08:13 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1556114893.26.0.0808378807014.issue36475@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:10:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:10:38 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556115038.6.0.0321055748274.issue36707@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6c44fde3e03079e0c69f823dafbe04af50b5bd0d by Victor Stinner in branch 'master': bpo-36707: Remove the "m" flag (pymalloc) from SOABI (GH-12931) https://github.com/python/cpython/commit/6c44fde3e03079e0c69f823dafbe04af50b5bd0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:11:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:11:15 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556115075.68.0.391830543178.issue36707@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Build resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:30:25 2019 From: report at bugs.python.org (Emily Morehouse) Date: Wed, 24 Apr 2019 14:30:25 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556116225.75.0.649823600844.issue35224@roundup.psfhosted.org> Emily Morehouse added the comment: Ned is correct! I will be sprinting on docs for this at PyCon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:32:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:32:39 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556116359.21.0.147113025655.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:47:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:47:50 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556117270.18.0.648400230694.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8bb3230149538c25c1bacced5e64a3c071475f73 by Victor Stinner in branch 'master': bpo-36710: Add runtime parameter to _PyThreadState_Init() (GH-12935) https://github.com/python/cpython/commit/8bb3230149538c25c1bacced5e64a3c071475f73 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:50:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:50:13 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556117413.17.0.800468942243.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:50:35 2019 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 24 Apr 2019 14:50:35 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556117435.11.0.0825376823375.issue35224@roundup.psfhosted.org> Ned Batchelder added the comment: Maybe we could update the What's New quickly now, and then get the longer more complex docs done later? People have been asking if this feature is in 3.8 because they don't see it mentioned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 10:58:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 14:58:47 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556117927.47.0.900245513398.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:01:15 2019 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 24 Apr 2019 15:01:15 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556118075.0.0.890003989125.issue35224@roundup.psfhosted.org> Vedran ?a?i? added the comment: ... and probably also because they start Python, type x := 2 and get SyntaxError (as explained above). ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:14:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 15:14:42 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556118882.87.0.185507763041.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b930a2d2b1247bdba560db341ba90a9cbb538eb3 by Victor Stinner in branch 'master': bpo-36710: PyOS_AfterFork_Child() pass runtime parameter (GH-12936) https://github.com/python/cpython/commit/b930a2d2b1247bdba560db341ba90a9cbb538eb3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:17:17 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:17:17 +0000 Subject: [issue36712] duplicate method definition in Lib/email/test/test_email_renamed.py Message-ID: <1556119037.17.0.0080436933891.issue36712@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/email/test/test_email_renamed.py:521 TestEncoders.test_default_cte ---------- components: Library (Lib) messages: 340781 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definition in Lib/email/test/test_email_renamed.py type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:14:24 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:14:24 +0000 Subject: [issue36711] duplicate method definition in Lib/email/feedparser.py Message-ID: <1556118864.95.0.640018454718.issue36711@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/email/feedparser.py:140 BufferedSubFile.pushlines ---------- components: Library (Lib) messages: 340778 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: duplicate method definition in Lib/email/feedparser.py type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:14:57 2019 From: report at bugs.python.org (miss-islington) Date: Wed, 24 Apr 2019 15:14:57 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1556118897.72.0.255567500677.issue30840@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:14:46 2019 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 24 Apr 2019 15:14:46 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1556118886.88.0.304365422226.issue30840@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset 70bf713617e15fad390ed953e48b3c65d9bc90ec by Nick Coghlan (Joannah Nanjekye) in branch 'master': bpo-30840: Document relative imports (#12831) https://github.com/python/cpython/commit/70bf713617e15fad390ed953e48b3c65d9bc90ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:19:07 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:19:07 +0000 Subject: [issue36713] uplicate method definition in Lib/ctypes/test/test_unicode.py Message-ID: <1556119147.21.0.373187833971.issue36713@roundup.psfhosted.org> New submission from Xavier de Gaye : As reported in issue 16079, the following method is a duplicate: Lib/ctypes/test/test_unicode.py:110 StringTestCase.test_ascii_replace ---------- components: Library (Lib) messages: 340782 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: uplicate method definition in Lib/ctypes/test/test_unicode.py type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:22:24 2019 From: report at bugs.python.org (Davide Rizzo) Date: Wed, 24 Apr 2019 15:22:24 +0000 Subject: [issue26528] NameError for built in function open when re-raising stored exception from yielded function In-Reply-To: <1457611797.69.0.202848672993.issue26528@psf.upfronthosting.co.za> Message-ID: <1556119344.27.0.138147884068.issue26528@roundup.psfhosted.org> Davide Rizzo added the comment: I've just stumbled on the same thing happening on some code that attempts to use logging on __del__. Comparing dir(__builtins__) normally and on shutdown, these are missing: ['copyright', 'credits', 'exit', 'help', 'license', 'open', 'quit'] The traceback of the real error looks like this: [...] File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1383, in info File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1519, in _log File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1529, in handle File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1591, in callHandlers File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 905, in handle File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1131, in emit File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1121, in _open NameError: name 'open' is not defined ---------- nosy: +davide.rizzo versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:25:45 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:25:45 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1556119545.91.0.0660074967218.issue19113@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- versions: +Python 2.7, Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:28:18 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 15:28:18 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556119698.27.0.881700163941.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:26:27 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:26:27 +0000 Subject: [issue19119] duplicate test name in Lib/test/test_heapq.py In-Reply-To: <1380401602.68.0.29924709136.issue19119@psf.upfronthosting.co.za> Message-ID: <1556119587.48.0.545846034791.issue19119@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:24:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 15:24:06 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556119446.09.0.27553524841.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8e91c246e468515b877690e090c73f496552541d by Victor Stinner in branch 'master': bpo-36710: Add runtime variable to Py_FinalizeEx() (GH-12937) https://github.com/python/cpython/commit/8e91c246e468515b877690e090c73f496552541d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:27:03 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:27:03 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1556119623.51.0.629784055945.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: List of issues entered for all the current duplicate method definitions in 2.7: #19113 #36711 #36712 #36713 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:30:39 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:30:39 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1556119839.92.0.518707833069.issue16079@roundup.psfhosted.org> Xavier de Gaye added the comment: Not sure the unittest module is the right place to implement these checks. The following issues deal with duplicates that are not unittest methods: #19127 #19128 #36711 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:49:12 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 24 Apr 2019 15:49:12 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1556120952.21.0.798772819708.issue16079@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- pull_requests: +12864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:44:23 2019 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 24 Apr 2019 15:44:23 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1556120663.11.0.824050850582.issue30840@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset 4d0233ec656bc7e7814e5f6f484e79a50a0daf91 by Nick Coghlan (Miss Islington (bot)) in branch '3.7': bpo-30840: Document relative imports (GH-12831) (GH-12938) https://github.com/python/cpython/commit/4d0233ec656bc7e7814e5f6f484e79a50a0daf91 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 11:45:18 2019 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 24 Apr 2019 15:45:18 +0000 Subject: [issue30840] Contrary to documentation, relative imports cannot pass through the top level In-Reply-To: <1499109292.04.0.970471813466.issue30840@psf.upfronthosting.co.za> Message-ID: <1556120718.23.0.457856947076.issue30840@roundup.psfhosted.org> Change by Nick Coghlan : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: behavior -> enhancement versions: +Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:23:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 16:23:57 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556123037.29.0.0604932101944.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 43125224d6da5febb34101ebfd36536d791d68cd by Victor Stinner in branch 'master': bpo-36710: Add runtime variable to Py_InitializeEx() (GH-12939) https://github.com/python/cpython/commit/43125224d6da5febb34101ebfd36536d791d68cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:28:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 16:28:20 +0000 Subject: [issue36616] Optimize thread state handling in function call code In-Reply-To: <1555086326.32.0.447085915153.issue36616@roundup.psfhosted.org> Message-ID: <1556123300.85.0.342422392885.issue36616@roundup.psfhosted.org> STINNER Victor added the comment: See also my PR 12934 which includes a similar change but for correctness, not for optimization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:22:38 2019 From: report at bugs.python.org (Brian Skinn) Date: Wed, 24 Apr 2019 16:22:38 +0000 Subject: [issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line Message-ID: <1556122958.82.0.669799236777.issue36714@roundup.psfhosted.org> New submission from Brian Skinn : doctest requires code examples have PS1 as ">>> " and PS2 as "... " -- that is, each is three printed characters, followed by a space: ``` $ cat ell_err.py import doctest class Foo: """Test docstring. >>>print("This is a test sentence.") ...a test... """ doctest.run_docstring_examples( Foo(), {}, optionflags=doctest.ELLIPSIS, ) $ python3.8 --version Python 3.8.0a3 $ python3.8 ell_err.py Traceback (most recent call last): ... ValueError: line 3 of the docstring for NoName lacks blank after >>>: ' >>>print("This is a test sentence.")' $ cat ell_print.py import doctest class Foo: """Test docstring. >>> print("This is a test sentence.") ...a test... """ doctest.run_docstring_examples( Foo(), {}, optionflags=doctest.ELLIPSIS, ) $ python3.8 ell_print.py Traceback (most recent call last): ... ValueError: line 4 of the docstring for NoName lacks blank after ...: ' ...a test...' ``` AFAICT, this behavior is consistent across 3.4.10, 3.5.7, 3.6.8, 3.7.3, and 3.8.0a3. **However**, in this `ell_print.py` above, that "PS2" line isn't actually meant to be a continuation of the 'source' portion of the example; it's meant to be the *output* (the 'want') of the example, with a leading ellipsis to be matched per `doctest.ELLIPSIS` rules. The regex currently used to look for the 'source' of an example is (https://github.com/python/cpython/blob/4f5a3493b534a95fbb01d593b1ffe320db6b395e/Lib/doctest.py#L583-L586): ``` (?P (?:^(?P [ ]*) >>> .*) # PS1 line (?:\n [ ]* \.\.\. .*)*) # PS2 lines \n? ``` Since this pattern is compiled with re.VERBOSE (https://github.com/python/cpython/blob/4f5a3493b534a95fbb01d593b1ffe320db6b395e/Lib/doctest.py#L592), the space-as-fourth-character in PS1/PS2 is not explicitly matched. I propose changing the regex to: ``` (?P (?:^(?P [ ]*) >>>[ ] .*) # PS1 line (?:\n [ ]* \.\.\.[ ] .*)*) # PS2 lines \n? ``` This will then *explicitly* match the trailing space of PS1; it *shouldn't* break any existing doctests, because the parsing code lower down has already been requiring that space to be present in PS1, as shown for `ell_err.py` above. This will also require an *explicit trailing space* to be present in order for a line starting with three periods to be interpreted as a PS2 line of 'source'; otherwise, it will be treated as part of the 'want'. I made this change in my local user install of 3.8's doctest.py, and it works as I expect on `ell_print.py`, passing the test: ``` $ python3.8 ell_print.py $ $ cat ell_wrongprint.py import doctest class Foo: """Test docstring. >>> print("This is a test sentence.") ...a foo test... """ doctest.run_docstring_examples( Foo(), {}, optionflags=doctest.ELLIPSIS, ) $ python3.8 ell_wrongprint.py ********************************************************************** File "ell_wrongprint.py", line ?, in NoName Failed example: print("This is a test sentence.") Expected: ...a foo test... Got: This is a test sentence. ``` For completeness, the following piece of regex in the 'want' section (https://github.com/python/cpython/blob/4f5a3493b534a95fbb01d593b1ffe320db6b395e/Lib/doctest.py#L589): ``` (?![ ]*>>>) # Not a line starting with PS1 ``` should probably also be changed to: ``` (?![ ]*>>>[ ]) # Not a line starting with PS1 ``` I would be happy to put together a PR for this; I would plan to take a ~TDD style approach, implementing a few tests first and then making the regex change. ---------- components: Library (Lib) messages: 340788 nosy: bskinn priority: normal severity: normal status: open title: Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:47:01 2019 From: report at bugs.python.org (Lisa Roach) Date: Wed, 24 Apr 2019 16:47:01 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1556124421.23.0.132725442423.issue36541@roundup.psfhosted.org> Lisa Roach added the comment: I agree we should get lib2to3 up to date. Looks like for *args and **kwargs there is issue33348 (this has a PR) and issue32496 (no PR) and related closed issue24791 and issue24176. Adding `:=` seems straighforward to me, as for the big change maybe @benjamin.peterson would be interested in commenting? ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:57:07 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 24 Apr 2019 16:57:07 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556125027.14.0.758946899755.issue35224@roundup.psfhosted.org> Guido van Rossum added the comment: I will add stub sections to the 3.8 whatsnew. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:59:39 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 24 Apr 2019 16:59:39 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556125179.56.0.753145202449.issue21536@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.7, Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 12:59:31 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 24 Apr 2019 16:59:31 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556125171.68.0.294257305321.issue21536@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:10:31 2019 From: report at bugs.python.org (Brian Skinn) Date: Wed, 24 Apr 2019 17:10:31 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556125831.25.0.951394630369.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: The application of repr() (or a repr()-equivalent) appears to occur as some part of the exec(compile(...)) call within doctest (https://github.com/python/cpython/blob/4f5a3493b534a95fbb01d593b1ffe320db6b395e/Lib/doctest.py#L1328-L1329). On 3.6.6, in REPL: ``` >>> from contextlib import redirect_stdout >>> from io import StringIO >>> sio = StringIO() >>> with redirect_stdout(sio): ... exec(compile('""" \' " """', 'dummyfile', 'single')) ... >>> output = sio.getvalue() >>> output '\' \\\' " \'\n' ``` Also 3.6.6, at Win cmd: ``` >type exec_compile.py from contextlib import redirect_stdout from io import StringIO exec(compile('""" \' " """', 'dummyfile', 'single')) sio = StringIO() with redirect_stdout(sio): exec(compile('""" \' " """', 'dummyfile', 'single')) output = sio.getvalue() assert output == '\' \\\' " \'\n' >python exec_compile.py ' \' " ' > ``` It *looks* like exec() executes the compile()'d source as if it were typed into a REPL -- IOW, any unassigned non-None return value X gets pushed to stdout as repr(X). This is then what the doctest self._fakeout captures for comparison to the 'want' of the example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:13:50 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 24 Apr 2019 17:13:50 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556126030.14.0.00293241560649.issue35224@roundup.psfhosted.org> Change by Guido van Rossum : ---------- pull_requests: +12865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:16:09 2019 From: report at bugs.python.org (Brett Cannon) Date: Wed, 24 Apr 2019 17:16:09 +0000 Subject: [issue36708] can not execute the python + version, to launch python under windows. In-Reply-To: <1556092235.7.0.350859031075.issue36708@roundup.psfhosted.org> Message-ID: <1556126169.24.0.459158580397.issue36708@roundup.psfhosted.org> Brett Cannon added the comment: This is by design in the Windows installer. You can check a box to put python3.6 on PATH if you want. If you want the Python Launcher on UNIX, see https://crates.io/crates/python-launcher. ---------- nosy: +brett.cannon resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:20:01 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 24 Apr 2019 17:20:01 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556126401.83.0.661445879762.issue36540@roundup.psfhosted.org> Change by Guido van Rossum : ---------- pull_requests: +12866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:15:06 2019 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 24 Apr 2019 17:15:06 +0000 Subject: [issue35224] PEP 572: Assignment Expressions In-Reply-To: <1542070337.94.0.788709270274.issue35224@psf.upfronthosting.co.za> Message-ID: <1556126106.35.0.314822488884.issue35224@roundup.psfhosted.org> Guido van Rossum added the comment: > Maybe we could update the What's New quickly now, and then get the longer more complex docs done later? People have been asking if this feature is in 3.8 because they don't see it mentioned. Here it is (PR 12941) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:20:23 2019 From: report at bugs.python.org (Eric Snow) Date: Wed, 24 Apr 2019 17:20:23 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556126423.22.0.125310817096.issue36710@roundup.psfhosted.org> Change by Eric Snow : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:49:55 2019 From: report at bugs.python.org (Lorenz Mende) Date: Wed, 24 Apr 2019 17:49:55 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1556128195.92.0.290177258416.issue36670@roundup.psfhosted.org> Lorenz Mende added the comment: Sorry, was off some days. I tried to decode the output with mbcs, solves the issue partly - the counter name is still wrong. Was able to pick the localization specific counter name from registry and use it for the typeperf. But the tests fail after several seconds with Broken Pipe Error of the command_stdout pipe. @Ammar - why is the handle closed in start()? If I uncomment it, the load tracker workks fine. Added the fixed file, may someone evaluate the solution on another windows localization? ---------- Added file: https://bugs.python.org/file48285/win_utils.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 13:44:24 2019 From: report at bugs.python.org (Thomas Kluyver) Date: Wed, 24 Apr 2019 17:44:24 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556127864.75.0.226503385613.issue36695@roundup.psfhosted.org> Thomas Kluyver added the comment: The 'single' option to compile() means it's run like at a REPL, calling displayhook if it's an expression returning a value. But warnings shouldn't go through the displayhook, as far as I know: >>> from contextlib import redirect_stdout, redirect_stderr >>> from io import StringIO >>> sio = StringIO() >>> with redirect_stderr(sio): ... exec(compile('import warnings; warnings.warn(""" \' " """)', 'dummyfile', 'single')) ... >>> print(sio.getvalue()) __main__:1: UserWarning: ' " ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 14:16:19 2019 From: report at bugs.python.org (Lisa Roach) Date: Wed, 24 Apr 2019 18:16:19 +0000 Subject: [issue36654] Add example to tokenize.tokenize In-Reply-To: <1555559036.7.0.0522143852215.issue36654@roundup.psfhosted.org> Message-ID: <1556129779.89.0.615826108394.issue36654@roundup.psfhosted.org> Lisa Roach added the comment: This could be added to the examples section of the tokenize doc, would you want to make the PR Windson? ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 14:11:06 2019 From: report at bugs.python.org (Brian Skinn) Date: Wed, 24 Apr 2019 18:11:06 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556129466.12.0.567442136485.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: Well, the warning content *itself* may not get passed through the displayhook at raise-time, in the process of being run through stderr and displayed by the REPL. But, when you capture the warning content with redirect_stderr(sio) and then ">>> sio.getvalue()", the contents of the capture from stderr, as produced by .getvalue(), *will* get passed through the displayhook, and thus be escaped. In theory, I could have obtained a consistent 'want' by using print() as you've done. However, for my particular example (see OP), I wanted to elide the first part of the warning message, which is messy, irrelevant to my code example, and can change from Python version to Python version. However, as doctest is currently implemented, a 'want' can't start with an ellipsis because it collides with the regex that detects PS2 prompts (https://github.com/python/cpython/blob/4f5a3493b534a95fbb01d593b1ffe320db6b395e/Lib/doctest.py#L583-L586). See #36714 (https://bugs.python.org/issue36714) for more information and a proposed enhancement/fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 14:22:34 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 24 Apr 2019 18:22:34 +0000 Subject: [issue36708] can not execute the python + version, to launch python under windows. In-Reply-To: <1556092235.7.0.350859031075.issue36708@roundup.psfhosted.org> Message-ID: <1556130154.89.0.911176358919.issue36708@roundup.psfhosted.org> Steve Dower added the comment: More precisely, the default Python install for Windows does not include versioned executables. If you install Python 3.7 from the Microsoft Store then you will get them, though it's not identical to the full development kit you'll get from python.org. There may be other distributions that include versioned executables as well. Ours will only put "python.exe" on PATH ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:18:25 2019 From: report at bugs.python.org (Roundup Robot) Date: Wed, 24 Apr 2019 19:18:25 +0000 Subject: [issue36688] _dummy_thread lacks an RLock implementaiton In-Reply-To: <1555827608.59.0.767546227499.issue36688@roundup.psfhosted.org> Message-ID: <1556133505.81.0.676721166817.issue36688@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +12867 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:24:48 2019 From: report at bugs.python.org (Thomas Kluyver) Date: Wed, 24 Apr 2019 19:24:48 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556133888.62.0.312032494068.issue36695@roundup.psfhosted.org> Thomas Kluyver added the comment: D'oh, yes. I missed that the failing example was displaying the captured string through displayhook. It makes sense now. Thanks for patiently explaining. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:37:22 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 24 Apr 2019 19:37:22 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1556134642.12.0.311613351799.issue36541@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: For the changes of PEP570, please wait until I merge the implementation to do the grammar changes in lib2to3 for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:37:44 2019 From: report at bugs.python.org (Brian Skinn) Date: Wed, 24 Apr 2019 19:37:44 +0000 Subject: [issue36695] Change (regression?) in v3.8.0a3 doctest output after capturing the stderr output from a raised warning In-Reply-To: <1555908027.52.0.640391164815.issue36695@roundup.psfhosted.org> Message-ID: <1556134664.16.0.781193734535.issue36695@roundup.psfhosted.org> Brian Skinn added the comment: LOL. No special thanks necessary, that last post only turned into something coherent (and possibly correct, it seems...) after a LOT of diving into the source, fiddling with the code, and (((re-)re-)re-)writing! Believe me, it reads as a lot more knowledgeable and confident than I actually felt while writing it. :-D Thanks to all of you for coming along with me on this dive into the CPython internals! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:46:16 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 24 Apr 2019 19:46:16 +0000 Subject: [issue36668] semaphore_tracker is not reused by child processes In-Reply-To: <1555681441.41.0.870057455059.issue36668@roundup.psfhosted.org> Message-ID: <1556135176.27.0.450044073763.issue36668@roundup.psfhosted.org> Antoine Pitrou added the comment: New changeset 004b93ea8947bcbe85b6fa16fe0999bfa712d5c1 by Antoine Pitrou (Thomas Moreau) in branch 'master': bpo-36668: FIX reuse semaphore tracker for child processes (#5172) https://github.com/python/cpython/commit/004b93ea8947bcbe85b6fa16fe0999bfa712d5c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:46:31 2019 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 24 Apr 2019 19:46:31 +0000 Subject: [issue36668] semaphore_tracker is not reused by child processes In-Reply-To: <1555681441.41.0.870057455059.issue36668@roundup.psfhosted.org> Message-ID: <1556135191.2.0.131251064671.issue36668@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:49:57 2019 From: report at bugs.python.org (Aditya Sane) Date: Wed, 24 Apr 2019 19:49:57 +0000 Subject: [issue36715] Dictionary initialization Message-ID: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> New submission from Aditya Sane : When initializing a dictionary with dict.fromkeys, if an object is used as initial value, then the value is taken by reference instead of by value. This results in incorrect behavior since Python doesn't have "by reference" or pointers by default. Attached file shows an example and one work-around. ---------- files: DictionaryBug.py messages: 340805 nosy: Aditya Sane priority: normal severity: normal status: open title: Dictionary initialization type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file48286/DictionaryBug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 15:57:20 2019 From: report at bugs.python.org (Eryk Sun) Date: Wed, 24 Apr 2019 19:57:20 +0000 Subject: [issue36670] test suite broken due to cpu usage feature on win 10/ german In-Reply-To: <1555689157.38.0.435665423105.issue36670@roundup.psfhosted.org> Message-ID: <1556135840.26.0.133377976901.issue36670@roundup.psfhosted.org> Eryk Sun added the comment: It's "oem", not "mbcs". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 16:13:34 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Wed, 24 Apr 2019 20:13:34 +0000 Subject: [issue36715] Dictionary initialization In-Reply-To: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> Message-ID: <1556136814.37.0.335903300218.issue36715@roundup.psfhosted.org> Josh Rosenberg added the comment: This is the same basic problem seen with sequence multiplication, mutable default arguments to a function, etc. It's not going to change though; the documentation says it "Create a new dictionary with keys from iterable and values set to value." "set to value" doesn't allow for implicit copy operations (shallow or deep), and trying to support it would slow fromkeys and violate the normal expectations for functions that reuse an input argument. Essentially, the problem you have is one of expectations; the behavior is correct, but perhaps the documentation could be clearer. In any event, the general solution to your problem is a dict comprehension (or for dict subclasses, passing a generator expression to the subclass constructor), replacing the incorrect: dict.fromkeys(iterable, []) with the similarly concise/straightforward: {k: [] for k in iterable} or (for general use, where dict can be changed to a dict subclass): dict((k, []) for k in iterable) I've marked this as a documentation bug if someone wants to take a stab at making the behavior more clear. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 16:23:13 2019 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Wed, 24 Apr 2019 20:23:13 +0000 Subject: [issue22269] Resolve distutils option conflicts with priorities In-Reply-To: <1408919544.9.0.398406846461.issue22269@psf.upfronthosting.co.za> Message-ID: <1556137393.27.0.809235779593.issue22269@roundup.psfhosted.org> Change by L?szl? Kiss Koll?r : ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 18:07:39 2019 From: report at bugs.python.org (Eric Cosatto) Date: Wed, 24 Apr 2019 22:07:39 +0000 Subject: [issue36716] Embedded Python fails to import module files with version_platform extensions Message-ID: <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org> New submission from Eric Cosatto : I have an application with embedded python. When trying to import numpy, or any other module that was installed by pip, it fails with error 'ModuleNotFoundError("No module named ...")'. Yet, on the command line python, all works fine. The problem is not in the PATH, as only specific files (those with ..pyd extensions, e.g. .cp37-win_amd64.pyd) cannot be found. Example1: numpy import numpy >> ImportError("No module named 'numpy.core._multiarray_umath') The line which fails is: from . import multiarray The file it is trying to load: C:\Program Files\Python37\Lib\site-packages\numpy\core_multiarray_umath.cp37-win_amd64.pyd Example 2: cv2 import cv2 >> ModuleNotFoundError("No module named 'cv2.cv2'") The line which fails is: from .cv2 import * The file it is trying to load: C:\Program Files\Python37\Lib\site-packages\cv2\cv2.cp37-win_amd64.pyd ---------- components: Extension Modules, Windows messages: 340808 nosy: ecosatto, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Embedded Python fails to import module files with version_platform extensions type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 18:19:26 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 24 Apr 2019 22:19:26 +0000 Subject: [issue36716] Embedded Python fails to import module files with version_platform extensions In-Reply-To: <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org> Message-ID: <1556144366.09.0.45053477212.issue36716@roundup.psfhosted.org> Steve Dower added the comment: Are you sure you don't have the 32-bit version of Python and the 64-bit version of those packages? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 18:23:14 2019 From: report at bugs.python.org (Eric Cosatto) Date: Wed, 24 Apr 2019 22:23:14 +0000 Subject: [issue36716] Embedded Python fails to import module files with version_platform extensions In-Reply-To: <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org> Message-ID: <1556144594.04.0.917989716039.issue36716@roundup.psfhosted.org> Eric Cosatto added the comment: Yes, and note that the command line python works fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 18:39:11 2019 From: report at bugs.python.org (Steve Dower) Date: Wed, 24 Apr 2019 22:39:11 +0000 Subject: [issue36716] Embedded Python fails to import module files with version_platform extensions In-Reply-To: <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org> Message-ID: <1556145551.98.0.0740420532499.issue36716@roundup.psfhosted.org> Steve Dower added the comment: Where are you running the embedded Python from, and how have you configured it to include the packages? Is your install in Program Files from the full installer? Or have you extracted the embeddable distro there? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 18:56:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 22:56:34 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556146594.08.0.770974861819.issue36465@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f4e4703e746067d6630410408d414b11003334d6 by Victor Stinner in branch 'master': bpo-36465: Make release and debug ABI compatible (GH-12615) https://github.com/python/cpython/commit/f4e4703e746067d6630410408d414b11003334d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 18:58:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 22:58:10 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556146690.88.0.525581562552.issue36465@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 19:28:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 23:28:25 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556148505.61.0.813898875497.issue36465@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 19:46:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 24 Apr 2019 23:46:34 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1556149594.2.0.00520406855183.issue36465@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 235e7b2b0d937ba8b4a9172aa72206187e3e1f54 by Victor Stinner in branch 'master': bpo-36465: Fix test_regrtest on Windows (GH-12945) https://github.com/python/cpython/commit/235e7b2b0d937ba8b4a9172aa72206187e3e1f54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:03:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 00:03:02 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556150582.47.0.902955630048.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-34814. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:22:54 2019 From: report at bugs.python.org (Joel Croteau) Date: Thu, 25 Apr 2019 00:22:54 +0000 Subject: [issue36717] Allow retrieval of return value from the target of a threading.Thread Message-ID: <1556151774.22.0.129640685398.issue36717@roundup.psfhosted.org> New submission from Joel Croteau : It would be nice if, after a threading.Thread has completed its run, it were possible to retrieve the return value of the target function. You can do this currently by setting a variable from your target or by subclassing Thread, but this should really be built in. My suggested changes: * Add an attribute to Thread, retval, initially set to None, that contains the return value of the target after a successful completion. * Thread.run() should set self.retval to the return value of the target upon completion, and also return this value. * Thread.join() should return self.retval after a successful completion. If you're not using Thread.join(), you can directly access Thread.retval to get the return result after a successful run. Thread.run() and Thread.join() both return None in all cases now, so I think a change in their return value would have minimal if any effect on existing code. ---------- components: Library (Lib) messages: 340815 nosy: Joel Croteau2 priority: normal severity: normal status: open title: Allow retrieval of return value from the target of a threading.Thread type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:30:11 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 00:30:11 +0000 Subject: [issue36711] duplicate method definition in Lib/email/feedparser.py In-Reply-To: <1556118864.95.0.640018454718.issue36711@roundup.psfhosted.org> Message-ID: <1556152211.05.0.162054474778.issue36711@roundup.psfhosted.org> Martin Panter added the comment: This is caused by Serhiy?s first change to 2.7 in Issue 21448. Compare Mercurial rev. 1b1f92e39462 (3.4 branch) with ba90bd01c5f1 (2.7). In 2.7, he applied the Python 3 version of the code, which used ?str.splitlines? rather than a regular expression ?NLCRE_crack.split?. This seems reasonable, but the old Python 2 code remains under a spurious ?def pushlines? block. I think that first block of ?pushlines? can safely be removed, just leaving the second version, a single line of code like in Python 3. ---------- components: +email -Library (Lib) nosy: +barry, martin.panter, r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:33:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 00:33:15 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556152395.41.0.315216308718.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: Antoine: > Hmm, apparently the -l flag was added in #832799, for a rather complicated case where the interpreter is linked with a library dlopened by an embedding application (I suppose for some kind of plugin system). The OP there also mentions RTLD_GLOBAL as a workaround (or perhaps the right way of achieving the desired effect). > (also, the OP didn't mention why he used a shared library build, instead of linking Python statically with the dlopened library) bpo-34814 is linked to this use case: https://bugzilla.redhat.com/show_bug.cgi?id=1585201 is an example of Python embedded in C using dlopen("libpython2.7.so.1.0", RTLD_LOCAL | RTLD_NOW). Problem: some C extensions of the standard library cannot be loaded in this case, like _struct. On Fedora and RHEL, some C extensions like _struct are built by the "*shared*" section of Modules/Setup. In this case, these C extensions are not explicitly linked to libpython. IHMO it's a bad usage of dlopen(): libpython must always be loaded with RTLD_GLOBAL. bpo-832799 has been fixed by the following commit which modify distutils to link C extensions to libpython: commit 10acfd00b28a2aad7b73d35afdbc64b0baebea20 Author: Martin v. L?wis Date: Mon Apr 10 12:39:36 2006 +0000 Patch #1429775: Link Python modules to libpython on linux if --enable-shared. Fixes #832799. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:34:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 00:34:57 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556152497.75.0.599952782791.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-34814 is linked to this use case: https://bugzilla.redhat.com/show_bug.cgi?id=1585201 is an example of Python embedded in C using dlopen("libpython2.7.so.1.0", RTLD_LOCAL | RTLD_NOW). Problem: some C extensions of the standard library cannot be loaded in this case, like _struct. bpo-1429775 is another example of RTLD_LOCAL usage, see: https://mail.python.org/pipermail/python-dev/2006-February/060533.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:35:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 00:35:08 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556152508.27.0.30983980928.issue21536@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12870 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:42:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 00:42:10 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556152930.38.0.564528767422.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 12946: "On Unix, C extensions are no longer linked to libpython". Using PR 12946, the use case described in the initial message (msg218806) now works as expected. I can load a C extension built by a shared library Python with a statically linked Python: $ LD_LIBRARY_PATH=/opt/py38shared/lib /opt/py38notshared/bin/python3.8 Python 3.8.0a3+ (heads/master:be0099719c, Apr 25 2019, 02:10:57) >>> import sys; sys.path.insert(0, '/opt/py38shared/lib/python3.8/lib-dynload') >>> import _ssl >>> _ssl /opt/py38notshared/bin/python3.8 is statically linked, whereas /opt/py38shared/lib/python3.8/lib-dynload/_ssl.cpython-38-x86_64-linux-gnu.so comes from a shared library Python. Install shared libray Python into /opt/py38shared: git clean -fdx; ./configure CFLAGS="-O0" --enable-shared --prefix /opt/py38shared && make && make install Install statically linked Python into /opt/py38notshared: git clean -fdx; ./configure CFLAGS="-O0" --prefix /opt/py38notshared && make && make install -- As Antoine said, the opposite already works. Just in case, I also tested and I confirm that it still works: $ LD_LIBRARY_PATH=/opt/py38shared/lib /opt/py38shared/bin/python3.8 Python 3.8.0a3+ (heads/master:be0099719c, Apr 25 2019, 02:09:02) >>> import sys; sys.path.insert(0, '/opt/py38notshared/lib/python3.8/lib-dynload') >>> import _ssl >>> _ssl _ssl comes from statically linked Python (/opt/py38notshared) and is loaded in shared library Python (/opt/py38shared). ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 20:55:41 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 00:55:41 +0000 Subject: [issue22742] IDLE shows traceback when printing non-BMP character In-Reply-To: <1414426704.85.0.168243800807.issue22742@psf.upfronthosting.co.za> Message-ID: <1556153741.93.0.115387342737.issue22742@roundup.psfhosted.org> Martin Panter added the comment: I haven?t looked at the code, but I suspect Idle implements a custom ?sys.displayhook?: >>> help(sys.displayhook) Help on function displayhook in module idlelib.rpc: displayhook(value) Override standard display hook to use non-locale encoding >>> sys.displayhook('\N{ROCKET}') '\U0001f680' >>> sys.__displayhook__('\N{ROCKET}') Traceback (most recent call last): File "", line 1, in sys.__displayhook__('\N{ROCKET}') File "/usr/lib/python3.5/idlelib/PyShell.py", line 1344, in write return self.shell.write(s, self.tags) UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 1-1: Non-BMP character not supported in Tk ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 21:06:41 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 25 Apr 2019 01:06:41 +0000 Subject: [issue36717] Allow retrieval of return value from the target of a threading.Thread In-Reply-To: <1556151774.22.0.129640685398.issue36717@roundup.psfhosted.org> Message-ID: <1556154401.97.0.000632654802616.issue36717@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 21:07:47 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 01:07:47 +0000 Subject: [issue23298] Add ArgumentParser.add_mutually_dependence_group In-Reply-To: <1421905312.49.0.407798450784.issue23298@psf.upfronthosting.co.za> Message-ID: <1556154467.28.0.0486322879707.issue23298@roundup.psfhosted.org> Change by Martin Panter : ---------- superseder: -> Add "necessarily inclusive" groups to argparse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 21:10:33 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 25 Apr 2019 01:10:33 +0000 Subject: [issue36715] Dictionary initialization In-Reply-To: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> Message-ID: <1556154633.7.0.373489093869.issue36715@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 21:26:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 01:26:30 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556155590.48.0.931927606381.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: With an additonal change on SOABI (I will open a separated issue for that), PR 12946 allows to load lxml built in release mode in a Python built in debug mode! That's *very* useful for debugging: see my gdb example below. --- I just modified the ABI of debug build so release and debug build now have the same ABI: bpo-36465. I wrote a patch to use the same sys.implementation.cache_tag (SOABI) in release and debug mode: diff --git a/configure b/configure index b02d17c053..38eb7f1bd6 100755 --- a/configure +++ b/configure @@ -6325,7 +6325,6 @@ $as_echo "#define Py_DEBUG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; Py_DEBUG='true' - ABIFLAGS="${ABIFLAGS}d" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; Py_DEBUG='false' fi diff --git a/configure.ac b/configure.ac index 65d3f8e691..1b2cd3076c 100644 --- a/configure.ac +++ b/configure.ac @@ -1223,7 +1223,6 @@ then [Define if you want to build an interpreter with many run-time checks.]) AC_MSG_RESULT(yes); Py_DEBUG='true' - ABIFLAGS="${ABIFLAGS}d" else AC_MSG_RESULT(no); Py_DEBUG='false' fi], [AC_MSG_RESULT(no)]) (That's a temporary patch, I will design a better solution later.) Using this patch + PR 12946, it becomes possible to load a C extension compiled in release mode in a debug Python! --- Example building lxml in release mode and then load it in debug mode. Install Python in *release* mode into /opt/py38release (shared libpython): git clean -fdx; ./configure --enable-shared --prefix /opt/py38release && make && make install Install Python in *debug* mode into /opt/py38debug (shared libpython): git clean -fdx; ./configure CFLAGS="-O0" --enable-shared --prefix /opt/py38debug --with-pydebug && make && make install Build lxml in release mode: LD_LIBRARY_PATH=/opt/py38release/lib/ /opt/py38release/bin/python3.8 -m pip install lxml By default, the debug Python doesn't have lxml: $ LD_LIBRARY_PATH=/opt/py38debug/lib/ /opt/py38debug/bin/python3.8 -c 'import lxml' Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'lxml' Give access to C extensions compiled in release mode to the debug Python: $ LD_LIBRARY_PATH=/opt/py38debug/lib/ PYTHONPATH=/opt/py38release/lib/python3.8/site-packages /opt/py38debug/bin/python3.8 Python 3.8.0a3+ (heads/omit_libpython-dirty:8a03782387, Apr 25 2019, 02:52:01) >>> import lxml >>> import lxml.etree >>> lxml.etree >>> import sys >>> sys.gettotalrefcount() 108304 It works! Explanation: * This is a debug build: sys.gettotalrefcount() is present (and works) * lxml has been compiled in release mode * etree.cpython-38-x86_64-linux-gnu.so is not linked to libpython and so doesn't rely on the *release* /opt/py38release/lib/libpython3.8.so * this lxml can be loaded in a Python compiled in debug mode! --- Now let's have a look at the gdb experience of release vs debug Python build. I put a breakpoint on lxml.etree.iterparse('example.xml'): the C function is called __pyx_tp_new_4lxml_5etree_iterparse. Using the release build, gdb fails to read many C local variables: $ LD_LIBRARY_PATH=/opt/py38release/lib/ gdb -args /opt/py38release/bin/python3.8 parse.py (gdb) source /home/vstinner/prog/python/master/python-gdb.py (gdb) b __pyx_tp_new_4lxml_5etree_iterparse Function "__pyx_tp_new_4lxml_5etree_iterparse" not defined. Make breakpoint pending on future shared library load? (y or [n]) y (gdb) run Breakpoint 1, __pyx_tp_new_4lxml_5etree_iterparse (t=0x7fffea724900 <__pyx_type_4lxml_5etree_iterparse>, a=('example.xml',), k=0x0) at src/lxml/etree.c:218930 218930 src/lxml/etree.c: No such file or directory. (gdb) py-bt Traceback (most recent call first): File "parse.py", line 4, in func context = etree.iterparse('example.xml') File "parse.py", line 12, in func("arg") (gdb) frame 4 #4 _PyEval_EvalFrameDefault (f=, throwflag=) at Python/ceval.c:3268 3268 res = call_function(&sp, oparg, NULL); (gdb) p f $1 = (gdb) p co $2 = (gdb) p sp $3 = (gdb) p oparg $4 = The basic function "py-bt" works as expected, but inspecting Python internals doesn't work: most local C variables are "optimized out" :-( New attempt using a debug build: $ LD_LIBRARY_PATH=/opt/py38debug/lib/ PYTHONPATH=/opt/py38release/lib/python3.8/site-packages gdb -args /opt/py38debug/bin/python3.8 parse.py ... same commands to load python-gdb.py and put a breakpoint ... Breakpoint 1, __pyx_tp_new_4lxml_5etree_iterparse (t=0x7fffea606900 <__pyx_type_4lxml_5etree_iterparse>, a=('example.xml',), k=0x0) at src/lxml/etree.c:218930 218930 src/lxml/etree.c: No such file or directory. (gdb) py-bt Traceback (most recent call first): File "parse.py", line 4, in func context = etree.iterparse('example.xml') File "parse.py", line 12, in func("arg") (gdb) frame 4 #4 0x00007ffff7d6e4f8 in _PyEval_EvalFrameDefault (f=Frame 0x458790, for file parse.py, line 4, in func (arg='arg'), throwflag=0) at Python/ceval.c:3268 3268 res = call_function(&sp, oparg, NULL); (gdb) p f $1 = Frame 0x458790, for file parse.py, line 4, in func (arg='arg') (gdb) p co $2 = (PyCodeObject *) 0x7fffea682388 (gdb) p co->co_consts $4 = (None, 'example.xml', 'None', ' => ') (gdb) p sp $5 = (PyObject **) 0x458938 (gdb) p sp[0] $6 = (gdb) p sp[-1] $7 = 'example.xml' (gdb) p oparg $8 = 1 The debugging experience is *much* better: it's possible to inspect Python internals! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 21:47:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Thu, 25 Apr 2019 01:47:38 +0000 Subject: [issue36715] Dictionary initialization In-Reply-To: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> Message-ID: <1556156858.56.0.397614451214.issue36715@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: -inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 24 23:46:41 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 03:46:41 +0000 Subject: [issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly In-Reply-To: <1428931053.68.0.491418357539.issue23930@psf.upfronthosting.co.za> Message-ID: <1556164001.49.0.750605462427.issue23930@roundup.psfhosted.org> Change by Martin Panter : ---------- resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 00:21:30 2019 From: report at bugs.python.org (Windson Yang) Date: Thu, 25 Apr 2019 04:21:30 +0000 Subject: [issue36654] Add example to tokenize.tokenize In-Reply-To: <1555559036.7.0.0522143852215.issue36654@roundup.psfhosted.org> Message-ID: <1556166090.76.0.0140118837277.issue36654@roundup.psfhosted.org> Windson Yang added the comment: Yes, I can make a PR for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 01:20:07 2019 From: report at bugs.python.org (Windson Yang) Date: Thu, 25 Apr 2019 05:20:07 +0000 Subject: [issue36654] Add example to tokenize.tokenize In-Reply-To: <1555559036.7.0.0522143852215.issue36654@roundup.psfhosted.org> Message-ID: <1556169607.16.0.41669137806.issue36654@roundup.psfhosted.org> Change by Windson Yang : ---------- keywords: +patch pull_requests: +12871 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 01:27:37 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 05:27:37 +0000 Subject: [issue1564508] RFC 2965 BaseCookie does not support "$Port" Message-ID: <1556170057.78.0.581779640388.issue1564508@roundup.psfhosted.org> Martin Panter added the comment: The original report comes from . Anders was trying to parse a HTTP request Cookie field, something like: BaseCookie('sessionid=a2be2e7debe71af8d88d350c4d14d768;$Path=/;$Domain=192.168.0.2;$Port="8000"') The problem is that Cookie.py assumes names beginning with a dollar sign ($) are reserved attributes of a previous cookie-pair, rather than arbitrary cookie names. It is obvious that this was intended to support RFC 2965, although it is not documented. The module has a hard-coded list of reserved attribute names, and Port is not one of them. IMO it would be better to treat (unknown) reserved attributes such as $Port as ordinary cookie names, and start a new ?morsel?. Ignoring them would also be a better option than rejecting the whole cookie field. The dollar sign is valid for a cookie name (token) according to RFC 2109, RFC 6265, and the Netscape specification. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 03:31:05 2019 From: report at bugs.python.org (Michael Felt) Date: Thu, 25 Apr 2019 07:31:05 +0000 Subject: [issue36624] cleanup the stdlib and tests with regard to sys.platform usage In-Reply-To: <1556034812.27.0.620139702453.issue36624@roundup.psfhosted.org> Message-ID: <96d01230-26d8-e5cc-3b2d-e64ce8d2ba93@felt.demon.nl> Michael Felt added the comment: On 23/04/2019 17:53, Steve Dower wrote: > Steve Dower added the comment: > >> Being 'runtime' rather than 'buildtime' seemed more precise - tests that >> are not meant to be build-time dependent use run-time status while >> leaving sys.platform for concerns that are directly related to builds > This is a good point - perhaps we need both? > > Many of the current test skips are related to build-time switches, but indeed, some relate to the runtime environment. > > One aspect I'm keeping in mind here is that with the Windows Subsystem for Linux, many lines are becoming blurred with respect to which build of Python people are using (I'm already getting bug reports from people who thought they were getting the Windows build but actually the Linux one, or vice versa). And mismatching builds causes some weird problems. Being able to clearly identify "Windows build + WSL environment" or "Linux build + WSL environment" will likely matter more over time. > > It would be nice to have all the checks centralized, perhaps a set of decorators in a test.requires module? > > @test.requires.linux_platform > @test.requires.darwin_platform > @test.requires.macos_runtime(10, 9) > def test_my_test(self): ... > > (It would require some clever decorator design, but we can make those work like "ORs" rather than "ANDs".) > > Does it provide any benefit? I think it's clever, Too clever for me to build. There is a lot about the Python language (syntax) I do not understand well enough. > but that doesn't mean it's worthwhile :) Using skipIf and skipUnless with test.support.CONSTANTS is just as readable and just as obvious (once we're using them consistently). To that end, I modified another 60 lines, or so, of mainly sys.platform == 'win32' to use MS_WINDOWS, not MS_WINDOWS, skipIf(MS_WINDOWS,...) or SkipUnless(MS_WINDOWS,...) - or comparable for the other platforms. I also replaced the use of (support.)is_android and (support.is_java) with ANDROID and JYTHON. Curious about comments from code owners. And suggestions re: the sys.platform lines (roughly 50) that are left. FYI: when I started there were 321 references to sys.platform with roughly 315 involved in a string comparison of some kind. Now it is closer to 50. > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 03:36:20 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 07:36:20 +0000 Subject: [issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set In-Reply-To: <1306033124.86.0.836605602237.issue12144@psf.upfronthosting.co.za> Message-ID: <1556177780.1.0.726999341008.issue12144@roundup.psfhosted.org> Martin Panter added the comment: Karthikeyan, it looks like your test will pass even when the bug is not fixed. A test calling code that writes error message does not necessarily mean the test itself will fail, I don?t think. I suggest you look at raising an exception when the UserWarning is triggered, and/or check that the expected cookie is returned with the right ?expires? value. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 04:07:38 2019 From: report at bugs.python.org (Maor Kleinberger) Date: Thu, 25 Apr 2019 08:07:38 +0000 Subject: [issue36305] Inconsistent behavior of pathlib.WindowsPath with drive paths In-Reply-To: <1552664225.98.0.0986812073641.issue36305@roundup.psfhosted.org> Message-ID: <1556179658.41.0.0358793159825.issue36305@roundup.psfhosted.org> Maor Kleinberger added the comment: Alright. And what is left to do with the current issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 05:05:07 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 25 Apr 2019 09:05:07 +0000 Subject: [issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set In-Reply-To: <1306033124.86.0.836605602237.issue12144@psf.upfronthosting.co.za> Message-ID: <1556183107.43.0.0843442127337.issue12144@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > Karthikeyan, it looks like your test will pass even when the bug is not fixed. A test calling code that writes error message does not necessarily mean the test itself will fail, I don?t think. You are right. Sorry, I got mislead by the Exception message and didn't notice the test was passing. The below patch to master ensures the test passes by asserting expires in the cookie. If @demian.brecht haven't had a chance to make a PR then I can try converting the to a PR adding them as co-author. diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index db82382357..07105a7c20 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -1590,6 +1590,7 @@ class CookieJar: def make_cookies(self, response, request): """Return sequence of Cookie objects extracted from response object.""" # get cookie-attributes for RFC 2965 and Netscape protocols + self._policy._now = self._now = int(time.time()) headers = response.info() rfc2965_hdrs = headers.get_all("Set-Cookie2", []) ns_hdrs = headers.get_all("Set-Cookie", []) @@ -1672,8 +1673,6 @@ class CookieJar: _debug("extract_cookies: %s", response.info()) self._cookies_lock.acquire() try: - self._policy._now = self._now = int(time.time()) - for cookie in self.make_cookies(response, request): if self._policy.set_ok(cookie, request): _debug(" setting cookie: %s", cookie) diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 22bf41cf1d..ad3364c950 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -585,6 +585,14 @@ class CookieTests(unittest.TestCase): # if expires is in future, keep cookie... c = CookieJar() future = time2netscape(time.time()+3600) + + headers = ["Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/; expires={0}".format(future)] + req = urllib.request.Request("http://www.coyote.com/") + res = FakeResponse(headers, "http://www.coyote.com/") + cookies = c.make_cookies(res, req) + self.assertEqual(len(cookies), 1) + self.assertEqual(time2netscape(cookies[0].expires), future) + interact_netscape(c, "http://www.acme.com/", 'spam="bar"; expires=%s' % future) self.assertEqual(len(c), 1) Failure without patch : ./python.exe -m unittest -v test.test_http_cookiejar.CookieTests.test_expires test_expires (test.test_http_cookiejar.CookieTests) ... /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py:1619: UserWarning: http.cookiejar bug! Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py", line 1616, in make_cookies ns_cookies = self._cookies_from_attrs_set( File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py", line 1574, in _cookies_from_attrs_set cookie = self._cookie_from_cookie_tuple(tup, request) File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/http/cookiejar.py", line 1546, in _cookie_from_cookie_tuple elif expires <= self._now: AttributeError: 'CookieJar' object has no attribute '_now' _warn_unhandled_exception() FAIL ====================================================================== FAIL: test_expires (test.test_http_cookiejar.CookieTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_http_cookiejar.py", line 593, in test_expires self.assertEqual(len(cookies), 1) AssertionError: 0 != 1 ---------------------------------------------------------------------- Ran 1 test in 0.017s FAILED (failures=1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 05:59:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 09:59:54 +0000 Subject: [issue7774] sys.executable: wrong location if zeroth command argument is modified. In-Reply-To: <1264375402.09.0.657503917056.issue7774@psf.upfronthosting.co.za> Message-ID: <1556186394.57.0.213523132254.issue7774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0ef8c157e9195df0115c54ba875a5efb92ac22fb by Victor Stinner in branch 'master': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) https://github.com/python/cpython/commit/0ef8c157e9195df0115c54ba875a5efb92ac22fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 05:59:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 09:59:54 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1556186394.69.0.754999199569.issue28552@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0ef8c157e9195df0115c54ba875a5efb92ac22fb by Victor Stinner in branch 'master': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) https://github.com/python/cpython/commit/0ef8c157e9195df0115c54ba875a5efb92ac22fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 05:59:55 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 25 Apr 2019 09:59:55 +0000 Subject: [issue7774] sys.executable: wrong location if zeroth command argument is modified. In-Reply-To: <1264375402.09.0.657503917056.issue7774@psf.upfronthosting.co.za> Message-ID: <1556186395.66.0.718260573165.issue7774@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 05:59:55 2019 From: report at bugs.python.org (miss-islington) Date: Thu, 25 Apr 2019 09:59:55 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1556186395.58.0.215626865177.issue28552@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 06:04:25 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 10:04:25 +0000 Subject: [issue33017] Special set-cookie setting will bypass Cookielib In-Reply-To: <1520392643.04.0.467229070634.issue33017@psf.upfronthosting.co.za> Message-ID: <1556186665.96.0.515319649136.issue33017@roundup.psfhosted.org> Martin Panter added the comment: I think LCatro is saying that Python should accept the cookies and discard only the offending attributes. This makes sense to me and tends to agree with the specifications, but the three cases seem all seem unimportant to me. PoC 1, Max-age: >>> from urllib2 import Request >>> from test.test_cookielib import FakeResponse >>> cookies = CookieJar(DefaultCookiePolicy()) >>> request = Request('http://127.0.0.1/requests_test.php') >>> cookies.extract_cookies(FakeResponse(()), request) # Issue 12144 >>> cookies.make_cookies(FakeResponse(('Set-Cookie: test=123; max-age=a',)), request) # No cookies returned [] RFC 6265 says Max-age should be ignored if not does not start with a digit or minus sign: . Netscape did not specify Max-age at all. So I agree that the cookie should be retained. PoC 2, Domain: You have to omit the equals sign to satisfy ?v is None? and discard the cookie record, otherwise ?v? is just an empty string '': >>> cookies.make_cookies(FakeResponse(('Set-Cookie: test=123; domain=;',)), request) # v == '' [Cookie(version=0, name='test', value='123', port=None, port_specified=False, domain='.', domain_specified=True, domain_initial_dot=False, path='/', path_specified=False, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={}, rfc2109=False)] >>> cookies.make_cookies(FakeResponse(('Set-Cookie: test=123; domain;',)), request) # v is None [] RFC 6265 says both these cases should be treated the same, and recommends ignoring Domain in these cases. PoC 3, Version: >>> cookies.make_cookies(FakeResponse(('Set-Cookie: test=123; version=a;',)), request) # No cookies returned [] The Version attribute is only specified by RFC 2109. Since the IETF has obsoleted it, I suggest to deprecate RFC 2109 support in the Python module. That way, if a real problem is demonstrated, we can remove the parts that are causing the problem. ---------- nosy: +martin.panter priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 06:08:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 10:08:42 +0000 Subject: [issue7774] sys.executable: wrong location if zeroth command argument is modified. In-Reply-To: <1264375402.09.0.657503917056.issue7774@psf.upfronthosting.co.za> Message-ID: <1556186922.33.0.121456753116.issue7774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 06:09:58 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 10:09:58 +0000 Subject: [issue35824] http.cookies._CookiePattern modifying regular expressions In-Reply-To: <1548385865.75.0.22198302427.issue35824@roundup.psfhosted.org> Message-ID: <1556186998.43.0.297946491243.issue35824@roundup.psfhosted.org> Martin Panter added the comment: Test_http_cookies line 19 has the following test case: {'data': 'keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"', 'dict': {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'}, 'repr': '''''', 'output': 'Set-Cookie: keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"'} This is similar to an example in the documentation: >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";') >>> print(C) Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;" If you break parsing of this string in the ?load? method, you break documented behaviour. The ?http.cookie? module is documented to follow RFC 2109. I believe the strings are valid by RFC 2109, in which the value is allowed to use the HTTP ?quoted-string? format. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 06:08:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 10:08:42 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1556186922.25.0.686197384606.issue28552@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 07:16:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 11:16:05 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1556190965.58.0.492150227455.issue28552@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3076a3e0d1c54a2a6cc54c84521cd0f640d7cffb by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12948) https://github.com/python/cpython/commit/3076a3e0d1c54a2a6cc54c84521cd0f640d7cffb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 07:16:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 11:16:05 +0000 Subject: [issue7774] sys.executable: wrong location if zeroth command argument is modified. In-Reply-To: <1264375402.09.0.657503917056.issue7774@psf.upfronthosting.co.za> Message-ID: <1556190965.45.0.525823454575.issue7774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3076a3e0d1c54a2a6cc54c84521cd0f640d7cffb by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12948) https://github.com/python/cpython/commit/3076a3e0d1c54a2a6cc54c84521cd0f640d7cffb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 07:16:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 11:16:06 +0000 Subject: [issue7774] sys.executable: wrong location if zeroth command argument is modified. In-Reply-To: <1264375402.09.0.657503917056.issue7774@psf.upfronthosting.co.za> Message-ID: <1556190966.94.0.997552213317.issue7774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f4edd39017a211d4544570a1e2ac2110ef8e51b4 by Victor Stinner in branch '2.7': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12949) https://github.com/python/cpython/commit/f4edd39017a211d4544570a1e2ac2110ef8e51b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 07:16:07 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 11:16:07 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1556190967.06.0.0174580230197.issue28552@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f4edd39017a211d4544570a1e2ac2110ef8e51b4 by Victor Stinner in branch '2.7': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12949) https://github.com/python/cpython/commit/f4edd39017a211d4544570a1e2ac2110ef8e51b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 07:16:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 11:16:46 +0000 Subject: [issue28552] Distutils fail if sys.executable is None In-Reply-To: <1477692785.38.0.0178074609676.issue28552@psf.upfronthosting.co.za> Message-ID: <1556191006.49.0.837687008948.issue28552@roundup.psfhosted.org> STINNER Victor added the comment: I fixed the bug in Python 2.7, 3.7 and master branch (future 3.8). Thanks Alexander P for the bug report ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 07:30:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 11:30:03 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556191803.2.0.492303305254.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: If an application is linked to libpython to embed Python, the application build requires flags to link to libpython. Currently, there are: $ python3-config --libs -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm $ pkg-config --libs python-3.7 -lpython3.7m My PR doens't change Misc/python.pc. Discussion on python-dev: * https://mail.python.org/pipermail/python-dev/2019-April/157196.html * https://mail.python.org/pipermail/python-dev/2019-April/157201.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 08:30:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 12:30:21 +0000 Subject: [issue35537] use os.posix_spawn in subprocess In-Reply-To: <1545238079.48.0.788709270274.issue35537@psf.upfronthosting.co.za> Message-ID: <1556195421.76.0.628869182972.issue35537@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d7befad328ad1a6d1f812be2bf154c1cd1e01fbc by Victor Stinner in branch 'master': bpo-35537: Document posix_spawn() change in subprocess (GH-11668) https://github.com/python/cpython/commit/d7befad328ad1a6d1f812be2bf154c1cd1e01fbc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 09:16:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 13:16:58 +0000 Subject: [issue36659] distutils UnixCCompiler: Remove standard library path from rpath In-Reply-To: <1555599736.54.0.585610547316.issue36659@roundup.psfhosted.org> Message-ID: <1556198218.62.0.142078837852.issue36659@roundup.psfhosted.org> STINNER Victor added the comment: I discussed the "rpath question" with different people. At the end, I think that the Fedora patch is "temporary fix" which we kept for way too long :-) We should remove this patch and ensure that upstream C extensions respect our rpath policy (Debian, OpenSuse, Fedora are against the usage of rpath). I discussed with Miro Hron?ok who is part of FESco (Fedora Engineering Steering Committee) and he created an issue to propose to make the build of a package *fail* if it uses rpath: https://pagure.io/packaging-committee/issue/886 That change would be affect the whole Fedora project, not just python packages. IMHO it's a better approach than trying to exclude rpath for LIBDIR which is equal to /usr/lib64. For these reasons, I close the issue and we will change Fedora instead. Thanks everybody who was involved in this discussion, I learnt a lot! :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 09:32:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 13:32:03 +0000 Subject: [issue36718] Python 2.7 compilation fails on AMD64 Ubuntu Shared 2.7 buildbot with: relocation R_X86_64_PC32 against symbol ... can not be used ... Message-ID: <1556199123.89.0.154216583131.issue36718@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/139/builds/251 Example: building 'time' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -g -O0 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Include -I/srv/buildbot/buildarea/2.7.bolen-ubuntu/build -c /srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Modules/timemodule.c -o build/temp.linux-x86_64-2.7-pydebug/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Modules/timemodule.o gcc -pthread -shared build/temp.linux-x86_64-2.7-pydebug/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Modules/timemodule.o -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L. -lm -lpython2.7 -o build/lib.linux-x86_64-2.7-pydebug/time.so /usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tmpnam': /srv/buildbot/Python-2.7.16/./Modules/posixmodule.c:7648: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp' /usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tempnam': /srv/buildbot/Python-2.7.16/./Modules/posixmodule.c:7595: warning: the use of `tempnam' is dangerous, better use `mkstemp' /usr/bin/ld: /usr/local/lib/libpython2.7.a(ceval.o): relocation R_X86_64_PC32 against symbol `PyFunction_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status It seems to be a regression caused by my change, commit f4edd39017a211d4544570a1e2ac2110ef8e51b4, PR 12875 for bpo-28552. ---------- components: Build messages: 340840 nosy: vstinner priority: normal severity: normal status: open title: Python 2.7 compilation fails on AMD64 Ubuntu Shared 2.7 buildbot with: relocation R_X86_64_PC32 against symbol ... can not be used ... versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:01:12 2019 From: report at bugs.python.org (immerrr again) Date: Thu, 25 Apr 2019 14:01:12 +0000 Subject: [issue25545] email parsing docs: clarify that only ASCII strings are supported In-Reply-To: <1446561810.16.0.921085816129.issue25545@psf.upfronthosting.co.za> Message-ID: <1556200872.39.0.16827059931.issue25545@roundup.psfhosted.org> immerrr again added the comment: Hi everyone, It's the first time I'm using this bugtracker, so apologies in advance if I manage to break something from the first go. Not sure if it's the right place to report this, but I have the following repro that involves email.message_from_bytes: In [128]: import email ...: msg_bytes = ( ...: b'MIME-Version: 1.0\r\n' ...: b'Content-Type: text/plain;\r\n' ...: b' charset=utf-8\r\n' ...: b'Content-Transfer-Encoding: 8bit\r\n' ...: b'Content-Disposition: attachment;\r\n' ...: b' filename="camper_store.csv"\r\n\r\n' ...: ) + 'Beyo?lu-?st'.encode('utf8') ...: email.message_from_bytes(msg_bytes).get_payload(decode=True) Out[128]: b'Beyo\xc4\x9flu-\xc4\xb0st' I have read this and some previous bug reports where it was clearly explained that message_from_string has its limitations and message_from_bytes should be used for better results. And if I'm not mistaken my repro should have it all set up correctly: CTE=8bit, body encoded in utf8 which is explicitly indicated as the content charset, yet the result is still encoded with 'raw-unicode-escape'. Is there something wrong with the input or is it a bug? Thanks! ---------- nosy: +immerrr again _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:49:40 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 25 Apr 2019 14:49:40 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556203780.06.0.249081010418.issue36710@roundup.psfhosted.org> Jeroen Demeyer added the comment: I don't really understand the rationale for these changes. What's wrong with the global variable _PyRuntime? What's the long-term goal for _PyRuntime? If you can't get rid of all occurrences of _PyRuntime, how does it help to get rid of *some* occurences? ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:49:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 14:49:40 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found Message-ID: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> New submission from STINNER Victor : regrtest (python3 -m test) has a --findleaks option to log warning if the garbage collector finds uncollectable objects. Problem: regrtest only logs a warning, but exit with a success in that case. Attached PR makes regrtest fail in that case and adds an unit test for --findleaks. ---------- components: Tests messages: 340843 nosy: vstinner priority: normal severity: normal status: open title: regrtest --findleaks should fail if an uncollectable object is found versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:52:18 2019 From: report at bugs.python.org (Michal Kononenko) Date: Thu, 25 Apr 2019 14:52:18 +0000 Subject: [issue36720] Correct Should to Must in Definition of object.__len__ Message-ID: <1556203938.29.0.467406560077.issue36720@roundup.psfhosted.org> New submission from Michal Kononenko : The link below defines __len__ https://docs.python.org/3/reference/datamodel.html?highlight=__len__#object.__len__ However, I was reading in the StackOverflow thread below that CPython does some validation to check that the return value of __len__ should be >= 0. Does this mean that len must return a value >= 0, in the RFC 2119 sense of the word? https://stackoverflow.com/questions/42521449/how-does-python-ensure-the-return-value-of-len-is-an-integer-when-len-is-cal ---------- assignee: docs at python components: Documentation messages: 340844 nosy: Michal Kononenko, docs at python priority: normal severity: normal status: open title: Correct Should to Must in Definition of object.__len__ type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:54:02 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:54:02 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1556204042.58.0.756762876806.issue19113@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:55:13 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:55:13 +0000 Subject: [issue36678] duplicate method definitions in Lib/test/test_dataclasses.py In-Reply-To: <1555775728.19.0.814114535778.issue36678@roundup.psfhosted.org> Message-ID: <1556204113.12.0.387853340655.issue36678@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:55:58 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:55:58 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556204158.45.0.44722772306.issue36679@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:56:28 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:56:28 +0000 Subject: [issue19119] duplicate test name in Lib/test/test_heapq.py In-Reply-To: <1380401602.68.0.29924709136.issue19119@psf.upfronthosting.co.za> Message-ID: <1556204188.62.0.788214225063.issue19119@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:56:59 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:56:59 +0000 Subject: [issue36680] duplicate method definition in Lib/test/test_importlib/test_util.py In-Reply-To: <1555776149.55.0.853112327072.issue36680@roundup.psfhosted.org> Message-ID: <1556204219.23.0.0128876512487.issue36680@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:57:52 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:57:52 +0000 Subject: [issue36683] duplicate method definition in Lib/test/test_utf8_mode.py In-Reply-To: <1555776614.31.0.832242060156.issue36683@roundup.psfhosted.org> Message-ID: <1556204272.74.0.35775961936.issue36683@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 10:57:28 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 14:57:28 +0000 Subject: [issue36681] duplicate method definition in Lib/test/test_logging.py In-Reply-To: <1555776283.44.0.382290590702.issue36681@roundup.psfhosted.org> Message-ID: <1556204248.22.0.484690502582.issue36681@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 11:04:14 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 25 Apr 2019 15:04:14 +0000 Subject: [issue16079] list duplicate test names with patchcheck In-Reply-To: <1348827338.06.0.659343787847.issue16079@psf.upfronthosting.co.za> Message-ID: <1556204654.0.0.772219498956.issue16079@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- pull_requests: +12876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 11:03:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 15:03:25 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556204605.72.0.0385912072707.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: > I don't really understand the rationale for these changes. What's wrong with the global variable _PyRuntime? > What's the long-term goal for _PyRuntime? If you can't get rid of all occurrences of _PyRuntime, how does it help to get rid of *some* occurences? The long term goal is to support multiple interpreter instances per process: Eric Snow's PEP 554 "Multiple Interpreters in the Stdlib" https://www.python.org/dev/peps/pep-0554/ Right now, there is a single instance of _PyRuntimeState: _PyRuntime. I would be interested to have one _PyRuntimeState per interpreter. Maybe _PyRuntimeState should be reworked in the meanwhile. Right now, it's a strange beast: it contains things which are set before Python initialization and things which are set after. It contains C types and Python objects. Maybe some parts should be moved into PyInterpreterState or even PyThreadState. I don't know at this point. It takes time to look at each individual structure field... Anyway, more generally, IMHO it's a bad practice to rely on a global variable. Python runtime should be "stateless". The current implementation of CPython leaks dozens of *Python* objects at exit. For example, I started to work on this issue while working on https://bugzilla.redhat.com/show_bug.cgi?id=1696322 : Python doesn't clear 2 warnings variables at exit. When I looked into this issue, I also noticed that _PyRuntime.gc.garbage remains *alive* after Py_Finalize(). That's plain wrong: *all* Python objects must be cleared by Py_Finalize(). Two interpreters must *not* share any Python object. Well, the PEP should better explain the rationale than me :-) -- When I wrote PR 12934, I noticed that even getting the current thread state rely on _PyRuntime: #define _PyThreadState_GET() \ ((PyThreadState*)_Py_atomic_load_relaxed(&_PyRuntime.gilstate.tstate_current)) That's wrong in the case of ceval.c: it should be possible to run _PyEval_EvalFrameDefault() twice at the same time in two threads using two "isolated" interpreters. Well, PR 12934 doesn't fix all issues. It's just one small step towards "stateless" runtime and the even more long term of having one GIL per *interpeter*, rather than a single GIL per *process*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 11:07:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 15:07:51 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556204871.51.0.124232337191.issue36719@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12877 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 11:28:36 2019 From: report at bugs.python.org (Eric Cosatto) Date: Thu, 25 Apr 2019 15:28:36 +0000 Subject: [issue36716] Embedded Python fails to import module files with version_platform extensions In-Reply-To: <1556143659.79.0.1234879845.issue36716@roundup.psfhosted.org> Message-ID: <1556206116.26.0.761997235629.issue36716@roundup.psfhosted.org> Eric Cosatto added the comment: Hi, I have a full install of Python from the installer in: C:\Program Files\Python37 Then, I added libraries using pip. Everything works fine from the command line Python. Then, I build my C++ application with VisualStudio and link to the Python DLLs. I start Python inside my app using the usual code: Py_SetPath(...); Py_SetProgramName(...); Py_InitializeEx(0); PyRun_SimpleString("import sys"); PyRun_SimpleString("print(sys.path)"); PyRun_SimpleString("print(sys.prefix)"); PyRun_SimpleString("print(sys.executable)"); >> ['C:\\Program Files\\Python37\\DLLs', 'C:\\Program Files\\Python37\\Lib', 'C:\\Program Files\\Python37', 'C:\\Program Files\\Python37\\Lib\\site-packages'] >> C:\Program Files\Python37 >> C:\Program Files\Python37\python.exe So, everything works fine at this point. If I run the following: PyRun_SimpleString("import numpy"); >> ImportError("No module named 'numpy.core._multiarray_umath'") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 11:56:45 2019 From: report at bugs.python.org (Remy Noel) Date: Thu, 25 Apr 2019 15:56:45 +0000 Subject: [issue36469] Stuck during interpreter exit, attempting to take the GIL In-Reply-To: <1553856319.46.0.350569249761.issue36469@roundup.psfhosted.org> Message-ID: <1556207805.94.0.898602707152.issue36469@roundup.psfhosted.org> Remy Noel added the comment: closing the ticket for now. ---------- resolution: -> later stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 12:38:46 2019 From: report at bugs.python.org (Tim Hatch) Date: Thu, 25 Apr 2019 16:38:46 +0000 Subject: [issue36541] Make lib2to3 grammar more closely match Python In-Reply-To: <1554514880.92.0.277848417721.issue36541@roundup.psfhosted.org> Message-ID: <1556210326.95.0.157397187275.issue36541@roundup.psfhosted.org> Tim Hatch added the comment: My strong preference would be getting the lib2to3 grammar to be the python grammar + additions, to make future changes easier to merge. The strongest argument against doing that is the backwards-incompatibility of patterns -- some won't compile, while others will compile but do something unexpected). It's good to hear (or at least infer) that parsing modern code is also a goal of lib2to3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 12:39:21 2019 From: report at bugs.python.org (Tim Hatch) Date: Thu, 25 Apr 2019 16:39:21 +0000 Subject: [issue33348] lib2to3 doesn't parse f(*[] or []) In-Reply-To: <1524573727.4.0.682650639539.issue33348@psf.upfronthosting.co.za> Message-ID: <1556210361.65.0.959286996413.issue33348@roundup.psfhosted.org> Tim Hatch added the comment: Also see discussion about divergence on issue36541 ---------- nosy: +thatch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 12:50:03 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 25 Apr 2019 16:50:03 +0000 Subject: [issue33150] Signature error for methods of class configparser.Interpolation In-Reply-To: <1522118388.18.0.467229070634.issue33150@psf.upfronthosting.co.za> Message-ID: <1556211003.84.0.336742426553.issue33150@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 12:53:33 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 25 Apr 2019 16:53:33 +0000 Subject: [issue36424] Pickle fails on frozen dataclass that has slots In-Reply-To: <1553527088.82.0.636469633332.issue36424@roundup.psfhosted.org> Message-ID: <1556211213.32.0.551836600038.issue36424@roundup.psfhosted.org> Change by Josh Rosenberg : ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 13:03:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 17:03:44 +0000 Subject: [issue36718] Python 2.7 compilation fails on AMD64 Ubuntu Shared 2.7 buildbot with: relocation R_X86_64_PC32 against symbol ... can not be used ... In-Reply-To: <1556199123.89.0.154216583131.issue36718@roundup.psfhosted.org> Message-ID: <1556211824.14.0.536146734812.issue36718@roundup.psfhosted.org> STINNER Victor added the comment: @David Bolen: Would you mind to have a look at this issue on your buildbot? I'm not sure that the regression is caused by my commit, since the command lines are the same in the previous build 250: building 'time' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -g -O0 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Include -I/srv/buildbot/buildarea/2.7.bolen-ubuntu/build -c /srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Modules/timemodule.c -o build/temp.linux-x86_64-2.7-pydebug/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Modules/timemodule.o gcc -pthread -shared build/temp.linux-x86_64-2.7-pydebug/srv/buildbot/buildarea/2.7.bolen-ubuntu/build/Modules/timemodule.o -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L. -lm -lpython2.7 -o build/lib.linux-x86_64-2.7-pydebug/time.so ---------- nosy: +db3l, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 13:53:14 2019 From: report at bugs.python.org (Brett Cannon) Date: Thu, 25 Apr 2019 17:53:14 +0000 Subject: [issue36720] Correct Should to Must in Definition of object.__len__ In-Reply-To: <1556203938.29.0.467406560077.issue36720@roundup.psfhosted.org> Message-ID: <1556214794.29.0.248846716456.issue36720@roundup.psfhosted.org> Brett Cannon added the comment: There is probably validation code in len(), but the method itself can do whatever it wants if you call it directly. So the documentation is accurate in saying the method _should_ return >= 0 but that there's nothing strictly enforcing that in Python for that specific method when defined and called directly. ---------- nosy: +brett.cannon resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 14:06:52 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 25 Apr 2019 18:06:52 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1556215612.89.0.203637505226.issue28533@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 14:13:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 18:13:34 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556216014.16.0.357178538003.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b by Victor Stinner in branch 'master': bpo-21536: C extensions are no longer linked to libpython (GH-12946) https://github.com/python/cpython/commit/8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 14:26:41 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 18:26:41 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556216801.24.0.407535953051.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: > If an application is linked to libpython to embed Python, the application build requires flags to link to libpython. (...) I created bpo-36721 "Add pkg-config python-3.8-embed" to discuss this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 14:25:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 18:25:48 +0000 Subject: [issue36721] Add pkg-config python-3.8-embed Message-ID: <1556216748.62.0.992604554579.issue36721@roundup.psfhosted.org> New submission from STINNER Victor : The bpo-21536 modified how C extensions are built: they are no longer linked to libpython. The problem is that when an application embeds Python: the application wants to be linked to libpython. commit 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b (HEAD -> master, upstream/master) Author: Victor Stinner Date: Thu Apr 25 20:13:10 2019 +0200 bpo-21536: C extensions are no longer linked to libpython (GH-12946) On Unix, C extensions are no longer linked to libpython. It is now possible to load a C extension built using a shared library Python with a statically linked Python. When Python is embedded, libpython must not be loaded with RTLD_LOCAL, but RTLD_GLOBAL instead. Previously, using RTLD_LOCAL, it was already not possible to load C extensions which were not linked to libpython, like C extensions of the standard library built by the "*shared*" section of Modules/Setup. distutils, python-config and python-config.py have been modified. I chose to modify distutils, python-config (shell) and python-config.py (Python), but *not* Misc/python.pc (pkg-config). Previously, we had: $ pkg-config python-3.7 --libs -lpython3.7m $ python3.7-config --libs -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm $ python3.7-config.py --libs -lpython3.7m -lcrypt -lpthread -ldl -lutil -lm Now, we get: $ pkg-config python-3.8 --libs -lpython3.8 $ python3.8-config --libs -lcrypt -lpthread -ldl -lutil -lm -lm $ python-config.py --libs -lcrypt -lpthread -ldl -lutil -lm -lm python-config and python-config.py can now be used to build C extensions, but not to build an application embedding Python. pkg-config should not be used to build a C extenstion since it links to libpython, but we don't want to do that (see bpo-21536). I'm not sure that different tools should return different results. I propose: * Add a new command "pkg-config python-3.8-embed" * Add a new "--embed" option to python3.8-config and python3.8-config.py commands * Remove "-lpython at VERSION@@ABIFLAGS@" from "Libs: -L${libdir} -lpython at VERSION@@ABIFLAGS@" of Misc/python.pc.in On Windows, we already provide different binaries for embedded Python with "-embed" suffix: * Download Windows x86-64 embeddable zip file: python-3.7.3-embed-amd64.zip * Download Windows x86-64 executable installer: python-3.7.3-amd64.exe https://www.python.org/downloads/windows/ ---------- components: Build messages: 340853 nosy: doko, vstinner priority: normal severity: normal status: open title: Add pkg-config python-3.8-embed versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 14:37:10 2019 From: report at bugs.python.org (Steve Dower) Date: Thu, 25 Apr 2019 18:37:10 +0000 Subject: [issue35920] Windows 10 ARM32 platform support In-Reply-To: <1549480377.04.0.927646454693.issue35920@roundup.psfhosted.org> Message-ID: <1556217430.87.0.442815649199.issue35920@roundup.psfhosted.org> Steve Dower added the comment: New changeset 62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c by Steve Dower (Paul Monson) in branch 'master': bpo-35920: Windows 10 ARM32 platform support (GH-11774) https://github.com/python/cpython/commit/62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 15:00:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 19:00:47 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI Message-ID: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> New submission from STINNER Victor : bpo-36465 modified the ABI of debug build so release and debug build now have the same ABI. bpo-21536 modified how C extensions are built: they are no longer linked to libpython. In a debug build, it becomes possible to load a C extension built in release mode: https://bugs.python.org/issue21536#msg340821 But I had to modify SOABI for that. I propose to modify how Python looks for C extensions: look also for dynamic libraries without the "d" SOABI flag and for C extensions built using the stable ABI. Release build: $ ./python -c 'import _imp; print(_imp.extension_suffixes())' ['.cpython-38-x86_64-linux-gnu.so', '.abi3.so', '.so'] Debug build, *WITHOUT* my change: $ ./python -c 'import _imp; print(_imp.extension_suffixes())' ['.cpython-38d-x86_64-linux-gnu.so', '.so'] Debug build, *WITH* my change: $ ./python -c 'import _imp; print(_imp.extension_suffixes())' ['.cpython-38d-x86_64-linux-gnu.so', '.cpython-38-x86_64-linux-gnu.so', '.abi3.so', '.so'] ---------- components: Build messages: 340856 nosy: vstinner priority: normal severity: normal status: open title: In debug build, load also C extensions compiled in release mode or compiled using the stable ABI versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 15:04:03 2019 From: report at bugs.python.org (Jonny Fuller) Date: Thu, 25 Apr 2019 19:04:03 +0000 Subject: [issue36723] Unittest Discovery for namespace subpackages dot notation fails Message-ID: <1556219043.29.0.793780129066.issue36723@roundup.psfhosted.org> New submission from Jonny Fuller : Hi friends, I noticed strange behavior involving unittest discovery with namespace packages. Using dot notation to discover test packages within a namespace package will fail, but will succeed when using path notation. It feels awkward that dot path would fail but normal path would succeed. Is this the desired behavior? I created a demo repo and fully documented this odd behavior here https://github.com/JonnyWaffles/djangonamespacetestfail. ---------- messages: 340857 nosy: mrwaffles priority: normal severity: normal status: open title: Unittest Discovery for namespace subpackages dot notation fails type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 15:12:36 2019 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 25 Apr 2019 19:12:36 +0000 Subject: [issue36723] Unittest Discovery for namespace subpackages dot notation fails In-Reply-To: <1556219043.29.0.793780129066.issue36723@roundup.psfhosted.org> Message-ID: <1556219556.41.0.610451238742.issue36723@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 15:31:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 19:31:57 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556220717.02.0.615716032427.issue36722@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12878 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 15:55:23 2019 From: report at bugs.python.org (Michele Angrisano) Date: Thu, 25 Apr 2019 19:55:23 +0000 Subject: [issue36461] timeit: Additional changes for autorange In-Reply-To: <1553766568.14.0.657766350537.issue36461@roundup.psfhosted.org> Message-ID: <1556222123.14.0.018511118307.issue36461@roundup.psfhosted.org> Change by Michele Angrisano : ---------- keywords: +patch pull_requests: +12879 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 16:10:34 2019 From: report at bugs.python.org (David Bolen) Date: Thu, 25 Apr 2019 20:10:34 +0000 Subject: [issue36718] Python 2.7 compilation fails on AMD64 Ubuntu Shared 2.7 buildbot with: relocation R_X86_64_PC32 against symbol ... can not be used ... In-Reply-To: <1556199123.89.0.154216583131.issue36718@roundup.psfhosted.org> Message-ID: <1556223034.03.0.917764057223.issue36718@roundup.psfhosted.org> David Bolen added the comment: Yes, it appears most likely to be the worker environment. I did upgrade the kernel in between builds 250 (good) and 251 (bad), but reverting that still fails, even with the same commit as in build 250. My current suspicion is that a test I did recently with a static 2.7.16 build is influencing the buildbot build process (which might explain why the error seems to involve an -fPIC mismatch in a library). Not sure how yet though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 16:13:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 20:13:49 +0000 Subject: [issue36724] Clear _PyRuntime at exit Message-ID: <1556223229.48.0.664845556761.issue36724@roundup.psfhosted.org> New submission from STINNER Victor : _PyRuntime.warnings is not cleared at Python exit: 3 objects are kept alive even after Py_Finalize(). See bpo-36356 which cleared some other variables. PR 12453 "bpo-36356: Destroy the GIL at exit" is still open. ---------- components: Interpreter Core messages: 340859 nosy: eric.snow, vstinner priority: normal severity: normal status: open title: Clear _PyRuntime at exit versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 16:14:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 20:14:17 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556223257.71.0.650014079664.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-36724: Clear _PyRuntime at exit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 16:28:27 2019 From: report at bugs.python.org (Kay Hayen) Date: Thu, 25 Apr 2019 20:28:27 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 Message-ID: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> New submission from Kay Hayen : Much like #9366 the same file can be used. This reference leaks according to Nuitka comparative testing: simpleFunction59: FAILED 129511 129512 leaked 1 def simpleFunction59(): a = 3 b = 5 try: a = a * 2 return a finally: return a / b I would be guessing, that you are leaking the return value when returning again. ---------- messages: 340861 nosy: kayhayen priority: normal severity: normal status: open title: Reference leak regression with Python3.8a3 type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 16:44:48 2019 From: report at bugs.python.org (Alessandro Cucci) Date: Thu, 25 Apr 2019 20:44:48 +0000 Subject: [issue36461] timeit: Additional changes for autorange In-Reply-To: <1553766568.14.0.657766350537.issue36461@roundup.psfhosted.org> Message-ID: <1556225088.46.0.725328059308.issue36461@roundup.psfhosted.org> Change by Alessandro Cucci : ---------- pull_requests: +12880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 17:01:32 2019 From: report at bugs.python.org (Ralph Loader) Date: Thu, 25 Apr 2019 21:01:32 +0000 Subject: [issue36726] Empty select() on windows gives error. Message-ID: <1556226092.9.0.288691315085.issue36726@roundup.psfhosted.org> New submission from Ralph Loader : The following one liner gives an error on windows but not on linux: ``` import selectors ; selectors.DefaultSelector().select(timeout=1) ``` It appears that the windows select() function with no FDs set gives an error but on Linux it is equivalent to a sleep. The error on windows: ``` Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python37\lib\selectors.py", line 323, in select r, w, _ = self._select(self._readers, self._writers, [], timeout) File "C:\Program Files\Python37\lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout) OSError: [WinError 10022] An invalid argument was supplied ``` ---------- components: Windows messages: 340862 nosy: Ralph Loader, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Empty select() on windows gives error. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 17:17:57 2019 From: report at bugs.python.org (David Bolen) Date: Thu, 25 Apr 2019 21:17:57 +0000 Subject: [issue36718] Python 2.7 compilation fails on AMD64 Ubuntu Shared 2.7 buildbot with: relocation R_X86_64_PC32 against symbol ... can not be used ... In-Reply-To: <1556199123.89.0.154216583131.issue36718@roundup.psfhosted.org> Message-ID: <1556227077.5.0.0305158758669.issue36718@roundup.psfhosted.org> David Bolen added the comment: Ok, I've resolved this, and the linker errors did actually point at the root issue. They show trying to link extensions against /usr/local/lib/libpython2.7.a which was my test static build of 2.7.16. Arguably this seems an issue in the buildbot build process in that it doesn't sandbox extension building to force linking to the python library being built rather than a random system library, but I can't see spending any time on that. I've purged the 2.7.16 files from the /usr/local tree and things seem to be back to normal I've started a new run for the failing build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 17:37:17 2019 From: report at bugs.python.org (Martin Panter) Date: Thu, 25 Apr 2019 21:37:17 +0000 Subject: [issue36726] Empty select() on windows gives error. In-Reply-To: <1556226092.9.0.288691315085.issue36726@roundup.psfhosted.org> Message-ID: <1556228237.71.0.743946139474.issue36726@roundup.psfhosted.org> Martin Panter added the comment: I think this is a duplicate of Issue 29256. Issue 25680 also discusses platform differences with no file descriptors. ---------- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows select() errors out when given no fds to select on, which breaks SelectSelector _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 18:18:27 2019 From: report at bugs.python.org (Berker Peksag) Date: Thu, 25 Apr 2019 22:18:27 +0000 Subject: [issue18099] wsgiref sets Content-Length: 0 on 304 Not Modified In-Reply-To: <1369910008.93.0.397797975418.issue18099@psf.upfronthosting.co.za> Message-ID: <1556230707.57.0.6411320226.issue18099@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 18:21:59 2019 From: report at bugs.python.org (Berker Peksag) Date: Thu, 25 Apr 2019 22:21:59 +0000 Subject: [issue17349] wsgiref.simple_server.demo_app is not PEP-3333 compatible In-Reply-To: <1362400053.87.0.0342035983925.issue17349@psf.upfronthosting.co.za> Message-ID: <1556230919.21.0.774180854989.issue17349@roundup.psfhosted.org> Berker Peksag added the comment: Closing this as 'not a bug' since examples in both branches are correct. Thank you for the report! ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 18:47:08 2019 From: report at bugs.python.org (Oliver Too, Eh?) Date: Thu, 25 Apr 2019 22:47:08 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags Message-ID: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> New submission from Oliver Too, Eh? : Documentation contents are ordered, and readers familiar with the section numbers/ordering from the Python 2 or Python 3.5 documentation will have an easier time transitioning to Python 3.6 or later if the sections remain numbered. ---------- assignee: docs at python components: Documentation messages: 340866 nosy: Oliver Too, Eh?, docs at python priority: normal severity: normal status: open title: python 3.6+ docs use ul tags instead of ol tags versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:04:24 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:04:24 +0000 Subject: [issue36718] Python 2.7 compilation fails on AMD64 Ubuntu Shared 2.7 buildbot with: relocation R_X86_64_PC32 against symbol ... can not be used ... In-Reply-To: <1556199123.89.0.154216583131.issue36718@roundup.psfhosted.org> Message-ID: <1556233464.18.0.592781695102.issue36718@roundup.psfhosted.org> STINNER Victor added the comment: https://buildbot.python.org/all/#/builders/139/builds/252 is back to green. I close the issue. Thanks David! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:22:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:22:09 +0000 Subject: [issue36728] Remove PyEval_ReInitThreads() from the public C API Message-ID: <1556234529.34.0.747871379917.issue36728@roundup.psfhosted.org> New submission from STINNER Victor : PyEval_ReInitThreads() is used internally by PyOS_AfterFork_Child(). I don't see the point of calling it directly. If you care of threads after fork, just call PyOS_AfterFork_Child(), no? I propose to remove PyEval_ReInitThreads() from the public C API. Problem: it's documented as a public function in High-level API of the Python Initialization API: https://docs.python.org/dev/c-api/init.html#c.PyEval_ReInitThreads On the Internet, I found a single project calling directly this function, but it's only in a test used to the test Python threading API: https://github.com/DataDog/go-python3/blob/master/thread_test.go func TestThreadInitialization(t *testing.T) { Py_Initialize() PyEval_InitThreads() assert.True(t, PyEval_ThreadsInitialized()) PyEval_ReInitThreads() } I don't think that the PyEval_ReInitThreads() call here makes any sense. ---------- components: Interpreter Core messages: 340868 nosy: vstinner priority: normal severity: normal status: open title: Remove PyEval_ReInitThreads() from the public C API versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:38:27 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:38:27 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556235507.41.0.449308221435.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:40:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:40:02 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556235602.87.0.33045417306.issue36722@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5422e3cfb7ffc50b147b4662d6f596cd61533754 by Victor Stinner in branch 'master': bpo-36722: Debug build loads libraries built in release mode (GH-12952) https://github.com/python/cpython/commit/5422e3cfb7ffc50b147b4662d6f596cd61533754 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:43:04 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:43:04 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556235784.06.0.582645946651.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: Since this change is causing subtle issues like bpo-36721 "Add pkg-config python-3.8-embed", I don't think that it would be a good idea to backport this change to Python 2.7 or 3.7. I close the issue. See also bpo-36722 "In debug build, load also C extensions compiled in release mode or compiled using the stable ABI". ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:45:25 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:45:25 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556235925.3.0.863097499892.issue36722@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:52:09 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:52:09 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556236329.47.0.979326477776.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:54:18 2019 From: report at bugs.python.org (Alessandro Cucci) Date: Thu, 25 Apr 2019 23:54:18 +0000 Subject: [issue36424] Pickle fails on frozen dataclass that has slots In-Reply-To: <1553527088.82.0.636469633332.issue36424@roundup.psfhosted.org> Message-ID: <1556236458.3.0.0930888722243.issue36424@roundup.psfhosted.org> Change by Alessandro Cucci : ---------- nosy: +acucci _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 19:53:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Thu, 25 Apr 2019 23:53:21 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556236401.31.0.636601782063.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 10c8e6af910e3a26e59f913a3c1e4830ca71b1af by Victor Stinner in branch 'master': bpo-36710: Add runtime variable in pystate.c (GH-12956) https://github.com/python/cpython/commit/10c8e6af910e3a26e59f913a3c1e4830ca71b1af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 20:25:36 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Fri, 26 Apr 2019 00:25:36 +0000 Subject: [issue36729] Delete unused text variable on tests Message-ID: <1556238336.33.0.148344310049.issue36729@roundup.psfhosted.org> New submission from Emmanuel Arias : On ```test_custom_non_data_descriptor``` and ```test_custom_data_descriptor``` from Lib/test/test_pydoc.py there was a text variable not used. ---------- components: Tests messages: 340872 nosy: eamanu priority: normal severity: normal status: open title: Delete unused text variable on tests type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 20:26:21 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Fri, 26 Apr 2019 00:26:21 +0000 Subject: [issue36729] Delete unused text variable on tests In-Reply-To: <1556238336.33.0.148344310049.issue36729@roundup.psfhosted.org> Message-ID: <1556238381.11.0.724903211698.issue36729@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- keywords: +patch pull_requests: +12885 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 20:32:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 00:32:05 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556238725.63.0.45887414463.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9db0324712f6982d89620b420f507a6aa5da152f by Victor Stinner in branch 'master': bpo-36710: Add runtime parameter in gcmodule.c (GH-12958) https://github.com/python/cpython/commit/9db0324712f6982d89620b420f507a6aa5da152f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 20:32:55 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 00:32:55 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556238775.58.0.287857913683.issue36725@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 20:33:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 00:33:05 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556238785.02.0.8738952798.issue36725@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12886 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 20:41:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 00:41:13 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556239273.76.0.695616694745.issue36722@roundup.psfhosted.org> STINNER Victor added the comment: Oh, there is an issue: --with-trace-refs has a different ABI and so should not do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 21:11:32 2019 From: report at bugs.python.org (Sebastian Bassi) Date: Fri, 26 Apr 2019 01:11:32 +0000 Subject: [issue36730] Change outdated references to macOS Message-ID: <1556241092.16.0.423050564241.issue36730@roundup.psfhosted.org> New submission from Sebastian Bassi : There are multiple occurences in the web page of "Mac OS X", like "Download the latest version for Mac OS X". This OS is called macOS since some years. It may be confusing for a new user. ---------- assignee: docs at python components: Documentation messages: 340875 nosy: Sebastian Bassi, docs at python priority: normal severity: normal status: open title: Change outdated references to macOS type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 22:09:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 02:09:14 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556244554.04.0.556122669858.issue36725@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4d29983185bc12ca685a1eb3873bacb8a7b67416 by Victor Stinner in branch 'master': bpo-36725: regrtest: add TestResult type (GH-12960) https://github.com/python/cpython/commit/4d29983185bc12ca685a1eb3873bacb8a7b67416 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 22:10:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 02:10:58 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556244658.54.0.762569816476.issue36725@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12887 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 22:52:28 2019 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 26 Apr 2019 02:52:28 +0000 Subject: [issue7951] Should str.format allow negative indexes when used for __getitem__ access? In-Reply-To: <1266450859.13.0.906832569526.issue7951@psf.upfronthosting.co.za> Message-ID: <1556247148.09.0.402153449733.issue7951@roundup.psfhosted.org> ?ric Araujo added the comment: A side question: where is it defined that in `{thing[0]}`, 0 will be parsed as an integer? The PEP shows `{thing[name]}` and mentions that this is not Python but a smaller mini-language, with `name` always a string, no quotes needed or permitted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:01:37 2019 From: report at bugs.python.org (Windson Yang) Date: Fri, 26 Apr 2019 03:01:37 +0000 Subject: [issue36731] Add example to priority queue Message-ID: <1556247697.17.0.567840188783.issue36731@roundup.psfhosted.org> New submission from Windson Yang : We don't have the base example for priority queue in https://docs.python.org/3.8/library/heapq.html#priority-queue-implementation-notes, We can add something like: > q = Q.PriorityQueue() > q.put(10) > q.put(1) > q.put(5) > while not q.empty(): print q.get() We may also need to add Notes about the PriorityQueue will block when we use max size > q = Q.PriorityQueue(1) > q.put(10) > q.put(1) # will block until the Queue is available again. ---------- assignee: docs at python components: Documentation messages: 340878 nosy: Windson Yang, docs at python priority: normal severity: normal status: open title: Add example to priority queue type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:22:32 2019 From: report at bugs.python.org (Saba Kauser) Date: Fri, 26 Apr 2019 03:22:32 +0000 Subject: [issue36640] python ibm_db setup.py post install script does not seem to work from Anaconda In-Reply-To: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> Message-ID: <1556248952.18.0.608103179517.issue36640@roundup.psfhosted.org> Change by Saba Kauser : ---------- components: +Distutils -Build nosy: +dstufft, eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:25:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 03:25:10 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556249110.87.0.0807411994276.issue36710@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:26:34 2019 From: report at bugs.python.org (Saba Kauser) Date: Fri, 26 Apr 2019 03:26:34 +0000 Subject: [issue36640] distutils.sysconfig.get_python_lib behaves incorrectly when pip cache is enabled In-Reply-To: <1555406571.1.0.830957588596.issue36640@roundup.psfhosted.org> Message-ID: <1556249194.98.0.0167080363766.issue36640@roundup.psfhosted.org> Saba Kauser added the comment: Experts, please help. get_python_lib() is behaving strangely and I have detailed the problem in my last update. ---------- title: python ibm_db setup.py post install script does not seem to work from Anaconda -> distutils.sysconfig.get_python_lib behaves incorrectly when pip cache is enabled _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:32:28 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 03:32:28 +0000 Subject: [issue36724] Clear _PyRuntime at exit In-Reply-To: <1556223229.48.0.664845556761.issue36724@roundup.psfhosted.org> Message-ID: <1556249548.41.0.165421325074.issue36724@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12889 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:49:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 03:49:29 +0000 Subject: [issue36724] Clear _PyRuntime at exit In-Reply-To: <1556223229.48.0.664845556761.issue36724@roundup.psfhosted.org> Message-ID: <1556250569.52.0.339293398801.issue36724@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 87d23a041d9efb743c5680ac23305ddddf300e51 by Victor Stinner in branch 'master': bpo-36724: Add _PyWarnings_Fini() (#12963) https://github.com/python/cpython/commit/87d23a041d9efb743c5680ac23305ddddf300e51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 25 23:48:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 03:48:54 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556250534.25.0.586277519745.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 99e69d44f499625786a2e6461a954adcd0037d69 by Victor Stinner in branch 'master': bpo-36710: Fix compiler warning on PyThreadState_Delete() (GH-12962) https://github.com/python/cpython/commit/99e69d44f499625786a2e6461a954adcd0037d69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 02:23:38 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 26 Apr 2019 06:23:38 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: Karthikeyan Singaravelan added the comment: issue34717 seems to be related where numbering was turned off. The issue has a note on reopening it for discussion if numbering is needed at https://bugs.python.org/issue34717#msg325589 . Would propose closing this. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 02:40:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 06:40:44 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556260844.9.0.130482101668.issue36725@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3cde440f20a9db75fb2c4e65e8e4d04a53216a2d by Victor Stinner in branch 'master': bpo-36725: Refactor regrtest multiprocessing code (GH-12961) https://github.com/python/cpython/commit/3cde440f20a9db75fb2c4e65e8e4d04a53216a2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 02:56:03 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 26 Apr 2019 06:56:03 +0000 Subject: [issue7951] Should str.format allow negative indexes when used for __getitem__ access? In-Reply-To: <1266450859.13.0.906832569526.issue7951@psf.upfronthosting.co.za> Message-ID: <1556261763.98.0.992167652143.issue7951@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not sure where (or if) it's defined in the Python docs, but in PEP 3101 it's in https://www.python.org/dev/peps/pep-3101/#simple-and-compound-field-names: "It should be noted that the use of 'getitem' within a format string is much more limited than its conventional usage. In the above example, the string 'name' really is the literal string 'name', not a variable named 'name'. The rules for parsing an item key are very simple. If it starts with a digit, then it is treated as a number, otherwise it is used as a string.". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 02:56:19 2019 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 26 Apr 2019 06:56:19 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556261779.89.0.429217502673.issue36669@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 7abb6c05afd02c17c7a941b64db5756b161b3cf7 by Mark Dickinson in branch 'master': bpo-36669: add matmul support to weakref.proxy (GH-12932) https://github.com/python/cpython/commit/7abb6c05afd02c17c7a941b64db5756b161b3cf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:29:04 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:29:04 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556263744.44.0.0724083571049.issue36719@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 75120d2205af086140e5e4e2dc620eb19cdf9078 by Victor Stinner in branch 'master': bpo-36719: regrtest always detect uncollectable objects (GH-12951) https://github.com/python/cpython/commit/75120d2205af086140e5e4e2dc620eb19cdf9078 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:33:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:33:33 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556264013.99.0.288318963122.issue36725@roundup.psfhosted.org> STINNER Victor added the comment: Sorry, the two commits are related to bpo-36719 not to this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:33:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:33:15 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556263995.79.0.97360068343.issue36719@roundup.psfhosted.org> STINNER Victor added the comment: Oops, I used the wrong bpo number in my PR 12960 and PR 12961: New changeset 4d29983185bc12ca685a1eb3873bacb8a7b67416 by Victor Stinner in branch 'master': bpo-36725: regrtest: add TestResult type (GH-12960) https://github.com/python/cpython/commit/4d29983185bc12ca685a1eb3873bacb8a7b67416 New changeset 3cde440f20a9db75fb2c4e65e8e4d04a53216a2d by Victor Stinner in branch 'master': bpo-36725: Refactor regrtest multiprocessing code (GH-12961) https://github.com/python/cpython/commit/3cde440f20a9db75fb2c4e65e8e4d04a53216a2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:33:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:33:42 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556264022.24.0.194000003119.issue36719@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:35:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:35:47 +0000 Subject: [issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError In-Reply-To: <1303163944.05.0.666091618845.issue11871@psf.upfronthosting.co.za> Message-ID: <1556264147.14.0.786760986453.issue11871@roundup.psfhosted.org> STINNER Victor added the comment: The test still fails randomly: https://buildbot.python.org/all/#/builders/3/builds/2469 ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:40:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:40:30 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556264430.66.0.0842370091683.issue36725@roundup.psfhosted.org> STINNER Victor added the comment: I wrote an unit test to be able to re-use regrtest memory leak hunter: import unittest def simpleFunction59(): a = 1 try: return a finally: return a class Tests(unittest.TestCase): def test_bug(self): for _ in range(10): simpleFunction59() I confirm that there is a leak: $ ./python -m test -R 3:3 test_bug ... test_bug leaked [10, 10, 10] references, sum=30 ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:44:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:44:21 +0000 Subject: [issue36732] test_asyncio: test_huge_content_recvinto() fails randomly Message-ID: <1556264661.54.0.31283754406.issue36732@roundup.psfhosted.org> New submission from STINNER Victor : Failure on AMD64 Windows7 SP1 3.x: https://buildbot.python.org/all/#/builders/40/builds/2053 ... test_start_unix_server_1 (test.test_asyncio.test_server.SelectorStartServerTests) ... skipped 'no Unix sockets' test_create_connection_sock (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... ok test_huge_content (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... ERROR test_sock_accept (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\support\__init__.py:1627: ResourceWarning: unclosed gc.collect() ResourceWarning: Enable tracemalloc to get the object allocation traceback ok test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... ok test_sock_client_ops (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... ok test_unix_sock_client_ops (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ... skipped 'No UNIX Sockets' test_create_connection_sock (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok test_huge_content (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ... ====================================================================== ERROR: test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.ProactorEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\windows_events.py", line 474, in finish_recv return ov.getresult() OSError: [WinError 64] The specified network name is no longer available During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_asyncio\test_sock_lowlevel.py", line 225, in test_huge_content_recvinto self.loop.run_until_complete( File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\base_events.py", line 590, in run_until_complete return future.result() File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_asyncio\test_sock_lowlevel.py", line 211, in _basetest_huge_content_recvinto nbytes = await self.loop.sock_recv_into(sock, buf) File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\proactor_events.py", line 551, in sock_recv_into return await self._proactor.recv_into(sock, buf) File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\windows_events.py", line 760, in _poll value = callback(transferred, key, ov) File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\asyncio\windows_events.py", line 478, in finish_recv raise ConnectionResetError(*exc.args) ConnectionResetError: [WinError 64] The specified network name is no longer available ---------- components: Tests, asyncio messages: 340892 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_huge_content_recvinto() fails randomly versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:43:22 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 26 Apr 2019 07:43:22 +0000 Subject: [issue36731] Add example to priority queue In-Reply-To: <1556247697.17.0.567840188783.issue36731@roundup.psfhosted.org> Message-ID: <1556264602.54.0.143686271458.issue36731@roundup.psfhosted.org> Raymond Hettinger added the comment: This doesn't make any sense. None of those operations are defined for the heapq module, nor is there a maxsize. The heapq usage notes are about the general concept of ways to implement priority queues. I suspect your suggestion is conflated with queue.PriorityQueue() which does have put(), get(), and maxsize. As for the queue docs, I don't think more examples are needed. IMO it would just clutter that part of the docs. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:41:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:41:32 +0000 Subject: [issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x In-Reply-To: <1527679178.26.0.682650639539.issue33694@psf.upfronthosting.co.za> Message-ID: <1556264492.62.0.340787791618.issue33694@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 03:56:43 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 07:56:43 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556265403.01.0.701883982627.issue36719@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 837acc1957d86ca950433f5064fd06d09b57d23b by Victor Stinner in branch 'master': bpo-36719: Fix regrtest re-run (GH-12964) https://github.com/python/cpython/commit/837acc1957d86ca950433f5064fd06d09b57d23b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 04:46:22 2019 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 26 Apr 2019 08:46:22 +0000 Subject: [issue36669] weakref proxy doesn't support the matrix multiplication operator In-Reply-To: <1555694987.19.0.326404753049.issue36669@roundup.psfhosted.org> Message-ID: <1556268382.27.0.472653022595.issue36669@roundup.psfhosted.org> Mark Dickinson added the comment: Now fixed for 3.8. Although this was an oversight, I'm erring on the side of regarding this as a new feature for 3.8 (and I think the omission is unlikely to bite anyone for Python 3.7 or 3.6), so I wouldn't recommend backporting this. Thanks for the report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 04:53:02 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 08:53:02 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556268782.46.0.705111611741.issue36719@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12892 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 05:00:04 2019 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 26 Apr 2019 09:00:04 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1556269204.39.0.784282272383.issue13611@roundup.psfhosted.org> Stefan Behnel added the comment: Turns out, it was not that easy. :-/ ElementTree lacks prefixes in its tree model, so they would have to be either registered globally (via register_namespace()) or come from the parser. I tried the latter since that is the most generic way when the input is serialised already. See issue 36673 and issue 36676 for extensions to the parser target interface that this implementation relies on. Note that this is a new implementation, only marginally based off the original ElementC14N implementation. I only implemented C14N 2.0 (which lxml also does not have, but I'll add it there). I got most of the official test cases working, including prefix rewriting and prefix resolution in tag and attribute content. https://www.w3.org/TR/xml-c14n2-testcases/ What's not supported? The original namespace prefixes may not be preserved when namespaces are declared with multiple prefixes. In that case, one of them is picked. That's difficult to implement in ET because the parser resolves and discards prefixes. I think that's acceptable, as long as the prefix selection is deterministic. Also, qname rewriting in XPath expressions that appear in XML text is not currently supported. I guess that's a bit of an esoteric feature which can still be added later if it's needed. While testing, I noticed that ET and cET behave differently when it comes to resolving default attributes from an internal DTD subset. The parser in cET does it, ET does not. That should probably get aligned. For now, the tests hack around that difference. Comments and reviews welcome. ---------- assignee: serhiy.storchaka -> scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 05:00:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 09:00:59 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1556269259.44.0.0459380388298.issue13611@roundup.psfhosted.org> STINNER Victor added the comment: > Comments and reviews welcome. Review of what? There is no PR attached to this issue. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 05:03:23 2019 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 26 Apr 2019 09:03:23 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1556269403.73.0.533087562537.issue13611@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +12893 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 05:12:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 09:12:29 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556269949.23.0.322435084166.issue36719@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 00db7c73af4f60df61e9df87cde7401c3ed9df69 by Victor Stinner in branch 'master': bpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965) https://github.com/python/cpython/commit/00db7c73af4f60df61e9df87cde7401c3ed9df69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 05:17:15 2019 From: report at bugs.python.org (Michael Osipov) Date: Fri, 26 Apr 2019 09:17:15 +0000 Subject: [issue14568] HP-UX local libraries not included In-Reply-To: <1334265845.44.0.154291439069.issue14568@psf.upfronthosting.co.za> Message-ID: <1556270235.06.0.434218418439.issue14568@roundup.psfhosted.org> Michael Osipov <1983-01-06 at gmx.net> added the comment: Please close because there is actually no /usr/local on HP-UX, System V does use /opt, not /usr/local. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 05:34:03 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 09:34:03 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556271243.68.0.353934385247.issue36719@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:14:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:14:21 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556273661.04.0.577245902931.issue36356@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:16:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:16:34 +0000 Subject: [issue34060] regrtest: log "CPU usage" on Windows In-Reply-To: <1530892869.55.0.56676864532.issue34060@psf.upfronthosting.co.za> Message-ID: <1556273794.58.0.447119772956.issue34060@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1069d38fa18f3a4f97c2e358bcb3b82cab1c051b by Victor Stinner in branch '3.7': [3.7] bpo-36719: sync regrtest with master branch (GH-12967) https://github.com/python/cpython/commit/1069d38fa18f3a4f97c2e358bcb3b82cab1c051b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:17:42 2019 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 26 Apr 2019 10:17:42 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen Message-ID: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> New submission from Miro Hron?ok : When I attempt to build CPython from a subfolder (as we do in Fedora) make regen-all dies with: python3.8 -m Parser.pgen ../../Grammar/Grammar \ ../../Grammar/Tokens \ ../../Include/graminit.h.new \ ../../Python/graminit.c.new /usr/bin/python3.8: No module named Parser.pgen To reproduce, run: $ rm -rf build && mkdir -p build/mybuild && (cd build/mybuild && ../../configure && make regen-all) This is probably a regression, as it works in the 3.7 branch. Setting PYTHON_FOR_REGEN="python3" (python3.7 on my system) doesn't make a difference: python3 -m Parser.pgen ../../Grammar/Grammar \ ../../Grammar/Tokens \ ../../Include/graminit.h.new \ ../../Python/graminit.c.new /usr/bin/python3: No module named Parser.pgen build/mybuild/Parser exists but it is empty directory. Setting PYTHON_FOR_REGEN="PYTHOINPATH= python3" workarounds the issue. On branch 3.7 (3076a3e0d1), build/mybuild/Parser is also empty, but the make-regen populates it. I'll bisect. ---------- components: Build messages: 340902 nosy: hroncok, vstinner priority: normal severity: normal status: open title: make regen-all doesn't work in subfolder: No module named Parser.pgen versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:16:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:16:34 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556273794.68.0.275678019758.issue36725@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1069d38fa18f3a4f97c2e358bcb3b82cab1c051b by Victor Stinner in branch '3.7': [3.7] bpo-36719: sync regrtest with master branch (GH-12967) https://github.com/python/cpython/commit/1069d38fa18f3a4f97c2e358bcb3b82cab1c051b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:16:34 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:16:34 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556273794.53.0.267463613848.issue36719@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1069d38fa18f3a4f97c2e358bcb3b82cab1c051b by Victor Stinner in branch '3.7': [3.7] bpo-36719: sync regrtest with master branch (GH-12967) https://github.com/python/cpython/commit/1069d38fa18f3a4f97c2e358bcb3b82cab1c051b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:21:13 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:21:13 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556274073.78.0.311101380896.issue36733@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:27:26 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:27:26 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556274446.92.0.622479782194.issue36733@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12896 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:28:45 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 10:28:45 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556274525.34.0.331199734581.issue36733@roundup.psfhosted.org> STINNER Victor added the comment: regen-keyword is recent: bpo-36143. regen-grammar has been modified to use Parser.pgen in bpo-35808. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:31:01 2019 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 26 Apr 2019 10:31:01 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556274661.91.0.96298957642.issue36733@roundup.psfhosted.org> Miro Hron?ok added the comment: 1f24a719e7be5e49b876a5dc7daf21d01ee69faa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 06:49:06 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 26 Apr 2019 10:49:06 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: <1556275746.88.0.301574513382.issue36727@roundup.psfhosted.org> Eric V. Smith added the comment: Agreed on closing this and discussing it at issue 34717. (I can't get bpo to accept this because of the comma in "Oliver Too, Eh?", so I'm removing them temporarily. Will try to add back, but might fail.) ---------- nosy: +eric.smith -Oliver Too, Eh? resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:00:45 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 26 Apr 2019 11:00:45 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: <1556276445.79.0.2232522475.issue36727@roundup.psfhosted.org> Eric V. Smith added the comment: I notified "Oliver Too, Eh?" by email directly about being dropped from this issue due to the comma in the username. xtreak: you seemed to be able to add a message while keeping "Oliver Too, Eh?" on the nosy list: any hints? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:05:54 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 11:05:54 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556276754.76.0.305418653793.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4cb525a1f0cba152d1da61e531f2ad5db633120a by Victor Stinner in branch 'master': bpo-36356: pymain_exit_error() only call pymain_free() for exit (GH-12968) https://github.com/python/cpython/commit/4cb525a1f0cba152d1da61e531f2ad5db633120a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:10:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 11:10:06 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556277006.91.0.00431759373435.issue36733@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:06:49 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 26 Apr 2019 11:06:49 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: <1556276809.12.0.295416284351.issue36727@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > xtreak: you seemed to be able to add a message while keeping "Oliver Too, Eh?" on the nosy list: any hints? I was also not able to add a comment through bpo so I replied by email which seemed to work. I guess registration should have validated the username to not allow it. ---------- superseder: -> docs: disable numbered sections for stdlib in html _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:10:58 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 11:10:58 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556277058.28.0.326453459595.issue36733@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for your bug report Miro Hron?ok. The fix will be part of the next Python 3.8 alpha release: "3.8.0 alpha 4: Monday, 2019-04-29" https://www.python.org/dev/peps/pep-0569/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:09:49 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 11:09:49 +0000 Subject: [issue36733] make regen-all doesn't work in subfolder: No module named Parser.pgen In-Reply-To: <1556273862.71.0.703011468281.issue36733@roundup.psfhosted.org> Message-ID: <1556276989.76.0.366295353326.issue36733@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 06d04e77ca36133e82bf6c363c09ba82e07a9c75 by Victor Stinner in branch 'master': bpo-36733: Fix PYTHONPATH for make regen-add (GH-12969) https://github.com/python/cpython/commit/06d04e77ca36133e82bf6c363c09ba82e07a9c75 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:20:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 11:20:15 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556277615.74.0.885710954029.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-36724 "Clear _PyRuntime at exit". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:16:47 2019 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 26 Apr 2019 11:16:47 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: <1556277407.79.0.469199283227.issue36727@roundup.psfhosted.org> Eric V. Smith added the comment: I created https://github.com/python/bugs.python.org/issues/35 about the comma in the username. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:29:08 2019 From: report at bugs.python.org (Michael Osipov) Date: Fri, 26 Apr 2019 11:29:08 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 Message-ID: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> New submission from Michael Osipov <1983-01-06 at gmx.net>: > /opt/aCC/bin/aCC -Ae -O -I./Include/internal -I. -I./Include -I/opt/ports/include -I/opt/ports/include -DPy_BUILD_CORE_BUILTIN -c ./Modules/faulthandler.c -o Modules/faulthandler.o > "./Modules/faulthandler.c", line 1373: error #2029: expected an expression > stack_t current_stack = {}; The fix is trivial: > stack_t current_stack = {0}; Can also provide a PR for that. ---------- components: Build messages: 340913 nosy: gregory.p.smith, michael-o priority: normal severity: normal status: open title: Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 07:39:09 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 26 Apr 2019 11:39:09 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556278749.37.0.908563552042.issue36734@roundup.psfhosted.org> Change by SilentGhost : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 08:23:34 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 26 Apr 2019 12:23:34 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556281414.54.0.122583458473.issue21536@roundup.psfhosted.org> Xavier de Gaye added the comment: Please revert the change in Makefile.pre.in made by changeset 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b as it breaks builds made out of the source tree (OST). The error message is: make: *** No rule to make target '/path_to_build_dir/Misc/python-config.sh', needed by 'python-config'. Stop. When the source tree has been already built at least once and 'make clean' is run in the source tree (as required for building OST), the OST build does not fail but incorrectly uses the stale python-config.sh from the source tree as 'make clean' does not remove Misc/python-config.sh. ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 08:32:55 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 26 Apr 2019 12:32:55 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556281975.45.0.997147912947.issue36710@roundup.psfhosted.org> Jeroen Demeyer added the comment: > The long term goal is to support multiple interpreter instances per process: > Eric Snow's PEP 554 "Multiple Interpreters in the Stdlib" > https://www.python.org/dev/peps/pep-0554/ Sorry, but I don't see the relation between this issue and PEP 554. It seems to me that the PEP is about making subinterpreters available from pure Python (instead of only at the C level). It doesn't say anything about the *implementation* of subinterpreters, which is what this issue is about. So I'm still missing the bigger picture where this issue fits in. > The current implementation of CPython leaks dozens of *Python* objects at exit. That may be an issue to be fixed, but again I don't see the relation with this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 09:48:13 2019 From: report at bugs.python.org (Zachary Ware) Date: Fri, 26 Apr 2019 13:48:13 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: <1556286493.09.0.877401559254.issue36727@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +Oliver Too, Eh? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 09:55:22 2019 From: report at bugs.python.org (Zachary Ware) Date: Fri, 26 Apr 2019 13:55:22 +0000 Subject: [issue36727] python 3.6+ docs use ul tags instead of ol tags In-Reply-To: <1556232428.79.0.0883162506271.issue36727@roundup.psfhosted.org> Message-ID: <1556286922.41.0.0181754459705.issue36727@roundup.psfhosted.org> Zachary Ware added the comment: I was able to re-add Oliver Too, Eh? via numeric user ID (31174), but I've also removed the comma from the login name to avoid further issues. Oliver, you should be able to log in using the login name "Oliver Too Eh?"; if you have any issues please email me directly (zach at python dot org). ---------- assignee: docs at python -> nosy: +zach.ware -docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 10:01:47 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 26 Apr 2019 14:01:47 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556287307.77.9.17456791568e-05.issue36725@roundup.psfhosted.org> Joannah Nanjekye added the comment: Let me work on this. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 10:02:00 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 26 Apr 2019 14:02:00 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556287320.32.0.0511290844504.issue36725@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- assignee: -> nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 10:10:22 2019 From: report at bugs.python.org (Brian Skinn) Date: Fri, 26 Apr 2019 14:10:22 +0000 Subject: [issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line In-Reply-To: <1556122958.82.0.669799236777.issue36714@roundup.psfhosted.org> Message-ID: <1556287822.36.0.216077863401.issue36714@roundup.psfhosted.org> Brian Skinn added the comment: Ahh, this *will* break some doctests: any with blank PS2 lines in the 'source' portion without the explicit trailing space: 1] >>> def foo(): 2] ... print("bar") 3] ... 4] ... print("baz") 5] >>> foo() 6] bar 7] baz If line 3 contains exactly "..." instead of starting with "... ", it will not be recognized as a PS2 line and the example will be parsed as: 'source' >>> def foo(): ... print("bar") 'want' ... ... print("baz") IMO this isn't a *terribly* unreasonable tradeoff, though -- it would enable the specific ellipsis use-case as in the OP, at the cost of breaking some doctests, which shouldn't(?) be in any critical paths? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 10:19:02 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 26 Apr 2019 14:19:02 +0000 Subject: [issue25810] Python 3 documentation for eval is incorrect In-Reply-To: <1449346403.16.0.483198527619.issue25810@psf.upfronthosting.co.za> Message-ID: <1556288342.91.0.914468074442.issue25810@roundup.psfhosted.org> Cheryl Sabella added the comment: See also PEP570 and issue 36540. ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 10:47:19 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 26 Apr 2019 14:47:19 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556290039.44.0.022289798031.issue36725@roundup.psfhosted.org> Joannah Nanjekye added the comment: @ victor, I have tried your example but I can not reproduce the leak as you did above. May be am missing something? I used some other tool and got this summary when I was investigating this: types | # objects | total size ================================= | =========== | ============ _______________________________________ From report at bugs.python.org Fri Apr 26 11:12:43 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 26 Apr 2019 15:12:43 +0000 Subject: [issue36725] Reference leak regression with Python3.8a3 In-Reply-To: <1556224107.78.0.397981137362.issue36725@roundup.psfhosted.org> Message-ID: <1556291563.68.0.663608668015.issue36725@roundup.psfhosted.org> Joannah Nanjekye added the comment: I am able to reproduce it finally. Run tests sequentially 0:00:00 load avg: 0.21 [1/1] test_bug beginning 6 repetitions 123456 ...... test_bug leaked [10, 10, 10] references, sum=30 test_bug failed == Tests result: FAILURE == 1 test failed: test_bug Total duration: 220 ms Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:15:14 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:15:14 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556291714.7.0.307745271411.issue36734@roundup.psfhosted.org> STINNER Victor added the comment: Michael Osipov: Can you please try if attached PR 12970 fix the compilation on HP-UX? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:14:46 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:14:46 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556291686.74.0.235934984806.issue36734@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12897 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:17:30 2019 From: report at bugs.python.org (Alan Jenkins) Date: Fri, 26 Apr 2019 15:17:30 +0000 Subject: [issue36704] logging.FileHandler currently hardcodes errors='strict' In-Reply-To: <1556019517.33.0.109747791974.issue36704@roundup.psfhosted.org> Message-ID: <1556291850.2.0.520401244405.issue36704@roundup.psfhosted.org> Alan Jenkins added the comment: Oops. I assumed logging.raiseExceptions == True (the default) actually raises exceptions, but it doesn't. It prints the exception to stderr and continues. E.g. traditional UNIX daemons run with stderr connected to /dev/null. Consider during development / debugging, or if you overlooked setting raiseExceptions altogether, or maybe you made the same mistake I did (because the reference-style documentation doesn't explain this behaviour). My above proposal was to escape encoding errors only when raiseExceptions == False. So when raiseExceptions == True, we might still lose log messages, and the UnicodeEncodeError might be printed to /dev/null i.e. also silently discarded. This suggests my proposal was trying to be too clever. I guess the simplest approach is for emit() to handle encode errors by using 'backslashreplace' to log the message AND calling handleError(). Instead of the original code sketch, change StreamHandler.emit() to try: # issue 35046: merged two stream.writes into one. msg = self.format(record) + self.terminator stream = self.stream try: stream.write(msg) self.flush() except UnicodeEncodeError: # Try to log something, even pure mojibake might provide a clue encoding = getattr(stream, 'encoding', None) if encoding: bytes = msg.encode(encoding, errors='backslashreplace') msg = bytes.decode(encoding) stream.write(msg) self.flush() # Call handleError() as normal raise except RecursionError: # See issue 36272 raise except Exception: self.handleError(record) (And I'd like a similar change for SyslogHandler at least). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:20:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:20:21 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556292021.86.0.943698908407.issue21536@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:21:55 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:21:55 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556292115.81.0.701521029509.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: > Please revert the change in Makefile.pre.in made by changeset 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b as it breaks builds made out of the source tree (OST). The error message is: > > make: *** No rule to make target '/path_to_build_dir/Misc/python-config.sh', needed by 'python-config'. Stop. > (...) Oh. I tried to "fix" the Makefile but it seems like I misunderstood how Misc/python-config.sh is handled. This file is generated from Misc/python-config.sh.in. I wrote 12971 to revert the change but also add a comment to explain the "magic" behind this file. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:38:20 2019 From: report at bugs.python.org (Berker Peksag) Date: Fri, 26 Apr 2019 15:38:20 +0000 Subject: [issue31525] require sqlite3_prepare_v2 In-Reply-To: <1505872064.75.0.0943053140419.issue31525@psf.upfronthosting.co.za> Message-ID: <1556293100.82.0.568184434596.issue31525@roundup.psfhosted.org> Berker Peksag added the comment: New changeset ad0daf5b374dc43540d4ffcf32ca30e5c5147b90 by Berker Peksag (Charles Pigott) in branch 'master': bpo-31525: Increase minimum sqlite version number check (GH-12923) https://github.com/python/cpython/commit/ad0daf5b374dc43540d4ffcf32ca30e5c5147b90 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:38:44 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 26 Apr 2019 15:38:44 +0000 Subject: [issue31525] require sqlite3_prepare_v2 In-Reply-To: <1505872064.75.0.0943053140419.issue31525@psf.upfronthosting.co.za> Message-ID: <1556293124.61.0.791886604839.issue31525@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:55:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:55:19 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556294119.66.0.0679647468519.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 01f073f5e43329547471c846c37e23157255e30a by Victor Stinner in branch 'master': bpo-21536: Revert Makefile change on python-config (GH-12971) https://github.com/python/cpython/commit/01f073f5e43329547471c846c37e23157255e30a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:56:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:56:32 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556294192.67.0.328939013585.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: I tested manually and I confirm that my latest change fix the compilation out of the source tree. I close again the issue. Sorry for the regression, it's now fixed. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 11:56:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 15:56:47 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556294207.79.0.769311589788.issue36722@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 404606974051c5ec093312aa57cf1bcbc52e1d85 by Victor Stinner in branch 'master': bpo-36722: Add What's New entry for debug ABI (GH-12957) https://github.com/python/cpython/commit/404606974051c5ec093312aa57cf1bcbc52e1d85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:13:47 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 16:13:47 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556295227.38.0.407071537913.issue36722@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:15:34 2019 From: report at bugs.python.org (miss-islington) Date: Fri, 26 Apr 2019 16:15:34 +0000 Subject: [issue31525] require sqlite3_prepare_v2 In-Reply-To: <1505872064.75.0.0943053140419.issue31525@psf.upfronthosting.co.za> Message-ID: <1556295334.53.0.328768772606.issue31525@roundup.psfhosted.org> miss-islington added the comment: New changeset 967f14ec2aff908b7f9e84e93aa60f2a34e2ca96 by Miss Islington (bot) in branch '3.7': bpo-31525: Increase minimum sqlite version number check (GH-12923) https://github.com/python/cpython/commit/967f14ec2aff908b7f9e84e93aa60f2a34e2ca96 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:21:23 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 16:21:23 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556295683.99.0.0524482589441.issue36710@roundup.psfhosted.org> STINNER Victor added the comment: Jeroen Demeyer: > Sorry, but I don't see the relation between this issue and PEP 554. The long term plan for PEP 554 is to support having one GIL per interpreter for best performances. The GIL lives in _PyRuntime. It's not just about the GIL. Currently, the gc module stores its state into _PyRuntime. It's wrong to share a single gc state between two interpreters: each interpreter should have its own "namespace" completely isolated from the other namespaces. For example, _PyRuntime.gc.garbage is a Python list: each interpreter should have its own list. My PR 12934 is only a first step to prepare ceval.c for that. Said differently, if I understood correctly, each interpreter must have its own _PyRuntime instance. Maybe tomorrow, we will keep a single _PyRuntime instance, *but* my work is needed to identify the relationship between the current implementation of Python and _PyRuntime. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:22:30 2019 From: report at bugs.python.org (R. David Murray) Date: Fri, 26 Apr 2019 16:22:30 +0000 Subject: [issue25545] email parsing docs: clarify that only ASCII strings are supported In-Reply-To: <1446561810.16.0.921085816129.issue25545@psf.upfronthosting.co.za> Message-ID: <1556295750.22.0.0231104181975.issue25545@roundup.psfhosted.org> R. David Murray added the comment: This is one of the infelicities of the translation of the old API to python3: 'get_payload(decode=True)' actually means 'give me the bytes version of this payload", which in this case is the utf-8, which is what you got. get_payload() means "give me the payload as a string without doing CTE decoding". In a sort of accident-of-translation this turns out to mean "give me the unicode" in this particular case. If the payload had been base64 encoded, you'd have gotten a unicode string containing the base64 characters. Which I grant you is all very confusing. For a more consistent API, use the new one: >>> import email.policy >>> m = email.message_from_bytes(msg_bytes, policy=email.policy.default) >>> bytes(m) b'MIME-Version: 1.0\nContent-Type: text/plain;\n charset=utf-8\nContent-Transfer-Encoding: 8bit\nContent-Disposition: attachment;\n filename="camper_store.csv"\n\nBeyo\xc4\x9flu-\xc4\xb0st' >>> m.get_content() 'Beyo?lu-?st' Here we don't even pretend that you have any use for the encoded version, either CTE encoding or binary encoding: get_content gives you the "fully decoded" payload (decoded from CTE *and* decoded to unicode). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:32:25 2019 From: report at bugs.python.org (Oliver Too, Eh?) Date: Fri, 26 Apr 2019 16:32:25 +0000 Subject: [issue34717] docs: disable numbered sections for stdlib in html In-Reply-To: <1537218837.12.0.956365154283.issue34717@psf.upfronthosting.co.za> Message-ID: <1556296345.9.0.204738788959.issue34717@roundup.psfhosted.org> Oliver Too, Eh? added the comment: As someone who is only now making the transition from Python 2 to Python 3, losing the numbering in the documentation on the Python Standard Library slows down my navigation when looking through the high-level contents. Given that the position of sections hasn't drifted much between versions, being able to treat the sections like chapters of a book affords faster access when I can quickly identify my position in the page without having to look at the scrollbar, provided my operating system even displays one when I am not actively scrolling. Knowing that there are roughly 40 top-level sections in the library means I can find something I know to be in the middle much more quickly from its number (plus or minus version drift) and those of its local surroundings than by its overall position in the page. Moreover, losing this feature can only be mitigated by search or "find in page" provided I remember modules and their contents by name, correctly spelled. I appreciate the overall cleaner appearance as sections become heavily nested that is addressed by this enhancement. I do however respectfully disagree with the choice of doing this at the expense of top level ordering. ---------- nosy: +Oliver Too Eh? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:42:43 2019 From: report at bugs.python.org (Jamesie Pic) Date: Fri, 26 Apr 2019 16:42:43 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1556296963.93.0.703270852201.issue34155@roundup.psfhosted.org> Jamesie Pic added the comment: Given the situation, could raising a SecurityWarning and a DeprecationWarning fix this issue ? ---------- nosy: +Jamesie Pic _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:47:53 2019 From: report at bugs.python.org (immerrr again) Date: Fri, 26 Apr 2019 16:47:53 +0000 Subject: [issue25545] email parsing docs: clarify that only ASCII strings are supported In-Reply-To: <1446561810.16.0.921085816129.issue25545@psf.upfronthosting.co.za> Message-ID: <1556297273.83.0.228766412509.issue25545@roundup.psfhosted.org> immerrr again added the comment: Oh, wow, confusing indeed, but in historical context it makes slightly more sense. Thank you for the explanation! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 12:56:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 16:56:39 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556297799.88.0.625439289209.issue36722@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6d13e5b35ba7165db3f38fccdd6e1e5283f96a74 by Victor Stinner in branch 'master': bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973) https://github.com/python/cpython/commit/6d13e5b35ba7165db3f38fccdd6e1e5283f96a74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:19:46 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 26 Apr 2019 17:19:46 +0000 Subject: [issue36715] Dictionary initialization In-Reply-To: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> Message-ID: <1556299186.2.0.143787183686.issue36715@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +12901 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:22:45 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:22:45 +0000 Subject: [issue14014] codecs.StreamWriter.reset contract not fulfilled In-Reply-To: <1329242513.77.0.581823861095.issue14014@psf.upfronthosting.co.za> Message-ID: <1556299365.45.0.603920326179.issue14014@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:24:05 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:24:05 +0000 Subject: [issue1708316] doctest work with Windows PyReadline Message-ID: <1556299445.74.0.464436141738.issue1708316@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:28:54 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:28:54 +0000 Subject: [issue12600] Add example of using load_tests to parameterise Test Cases In-Reply-To: <1311226769.48.0.369455670372.issue12600@psf.upfronthosting.co.za> Message-ID: <1556299734.59.0.373343790647.issue12600@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:24:29 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:24:29 +0000 Subject: [issue8502] support plurals in pygettext In-Reply-To: <1271985007.3.0.675755685137.issue8502@psf.upfronthosting.co.za> Message-ID: <1556299469.52.0.535564790557.issue8502@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:21:56 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:21:56 +0000 Subject: [issue14953] Reimplement subset of multiprocessing.sharedctypes using memoryview In-Reply-To: <1338303583.56.0.322806581737.issue14953@psf.upfronthosting.co.za> Message-ID: <1556299316.0.0.788327749973.issue14953@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:23:26 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:23:26 +0000 Subject: [issue20587] sqlite3 converter not being called In-Reply-To: <1392069177.84.0.794324739968.issue20587@psf.upfronthosting.co.za> Message-ID: <1556299406.29.0.955336486707.issue20587@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:49:04 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:49:04 +0000 Subject: [issue18119] urllib.FancyURLopener does not treat URL fragments correctly In-Reply-To: <1370168530.11.0.609209040554.issue18119@psf.upfronthosting.co.za> Message-ID: <1556300944.59.0.401883521535.issue18119@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:26:25 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:26:25 +0000 Subject: [issue14945] Setup & Usage documentation for selected stdlib modules In-Reply-To: <1338256259.22.0.129056676976.issue14945@psf.upfronthosting.co.za> Message-ID: <1556299585.62.0.964124646132.issue14945@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:50:52 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:50:52 +0000 Subject: [issue12957] mmap.resize changes memory address of mmap'd region In-Reply-To: <1315686259.57.0.0304440203891.issue12957@psf.upfronthosting.co.za> Message-ID: <1556301052.45.0.88342021647.issue12957@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:31:31 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:31:31 +0000 Subject: [issue19895] Cryptic error when subclassing multiprocessing classes In-Reply-To: <1386239746.14.0.69431016666.issue19895@psf.upfronthosting.co.za> Message-ID: <1556299891.97.0.701618136449.issue19895@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:44:59 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:44:59 +0000 Subject: [issue11176] give more meaningful argument names in argparse documentation In-Reply-To: <1297352937.46.0.470038569364.issue11176@psf.upfronthosting.co.za> Message-ID: <1556300699.66.0.114325904247.issue11176@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:26:53 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:26:53 +0000 Subject: [issue7833] bdist_wininst installers fail to load extensions built with Issue4120 patch In-Reply-To: <1265062373.01.0.461114831555.issue7833@psf.upfronthosting.co.za> Message-ID: <1556299613.5.0.580753415023.issue7833@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:04:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Fri, 26 Apr 2019 18:04:59 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556301899.16.0.112278721586.issue36722@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:13:17 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:13:17 +0000 Subject: [issue19558] Provide Tcl/Tk linkage information for extension module builds In-Reply-To: <1384244718.62.0.601132485199.issue19558@psf.upfronthosting.co.za> Message-ID: <1556302397.68.0.95853297355.issue19558@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:15:29 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:15:29 +0000 Subject: [issue16425] minidom replaceChild(new_child, old_child) removes new_child even if in another document In-Reply-To: <1352279150.2.0.240477416324.issue16425@psf.upfronthosting.co.za> Message-ID: <1556302529.26.0.145459530035.issue16425@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:47:07 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:47:07 +0000 Subject: [issue16726] expat ParseFile expects bytes, not string In-Reply-To: <1355914609.66.0.723053050254.issue16726@psf.upfronthosting.co.za> Message-ID: <1556300827.44.0.372019830472.issue16726@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:05:42 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:05:42 +0000 Subject: [issue18060] Updating _fields_ of a derived struct type yields a bad cif In-Reply-To: <1369508846.31.0.680698237225.issue18060@psf.upfronthosting.co.za> Message-ID: <1556301942.36.0.598755468581.issue18060@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:48:31 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:48:31 +0000 Subject: [issue1669539] Add os.path.isrelative() and improve ntpath.isabs() Message-ID: <1556300911.67.0.0954521658671.issue1669539@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:51:12 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:51:12 +0000 Subject: [issue18319] gettext() cannot find translations with plural forms In-Reply-To: <1372373603.42.0.596981858746.issue18319@psf.upfronthosting.co.za> Message-ID: <1556301072.4.0.190572494093.issue18319@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:37:05 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:37:05 +0000 Subject: [issue9937] _winreg.EnumValue causes MemoryError In-Reply-To: <1285319837.21.0.430903654303.issue9937@psf.upfronthosting.co.za> Message-ID: <1556303825.32.0.480972765874.issue9937@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:50:30 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:50:30 +0000 Subject: [issue18493] make profile-opt fails with pre-existing python2.7 in path In-Reply-To: <1374169657.94.0.400718605789.issue18493@psf.upfronthosting.co.za> Message-ID: <1556301030.32.0.35077999599.issue18493@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:29:15 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:29:15 +0000 Subject: [issue1610654] cgi.py multipart/form-data Message-ID: <1556299755.92.0.51274965127.issue1610654@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:30:02 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:30:02 +0000 Subject: [issue19725] Richer stat object In-Reply-To: <1385156508.32.0.63377992281.issue19725@psf.upfronthosting.co.za> Message-ID: <1556299802.6.0.835930325259.issue19725@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:36:18 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:36:18 +0000 Subject: [issue8350] Document lack of support for keyword arguments in C functions In-Reply-To: <1270764159.26.0.287104770145.issue8350@psf.upfronthosting.co.za> Message-ID: <1556300178.17.0.857984309702.issue8350@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:04:22 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:04:22 +0000 Subject: [issue19482] _pickle build warnings on Fedora 19 In-Reply-To: <1383460283.32.0.964490197084.issue19482@psf.upfronthosting.co.za> Message-ID: <1556301862.54.0.114111845131.issue19482@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:07:20 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:07:20 +0000 Subject: [issue16066] Truncated POST data in CGI script on Windows 7 In-Reply-To: <1348782648.4.0.8522398728.issue16066@psf.upfronthosting.co.za> Message-ID: <1556302040.51.0.622542738079.issue16066@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:02:52 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:02:52 +0000 Subject: [issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc) In-Reply-To: <1311111401.9.0.18298571301.issue12588@psf.upfronthosting.co.za> Message-ID: <1556305372.34.0.417243522649.issue12588@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:34:47 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:34:47 +0000 Subject: [issue7182] For non-debug builds, the cygwinccompiler.py should define NDEBUG In-Reply-To: <1256147342.16.0.0286188762329.issue7182@psf.upfronthosting.co.za> Message-ID: <1556303687.31.0.913655485469.issue7182@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:51:51 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:51:51 +0000 Subject: [issue18131] Tkinter Variables require a proper master In-Reply-To: <1370308379.98.0.744218229266.issue18131@psf.upfronthosting.co.za> Message-ID: <1556301111.41.0.562758971675.issue18131@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:49:52 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:49:52 +0000 Subject: [issue18165] Add 'unexpected_type' to TypeError In-Reply-To: <1370638526.17.0.473449662068.issue18165@psf.upfronthosting.co.za> Message-ID: <1556300992.61.0.60692710322.issue18165@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:17:00 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:17:00 +0000 Subject: [issue19460] Add test for MIMENonMultipart In-Reply-To: <1383235171.21.0.576245026541.issue19460@psf.upfronthosting.co.za> Message-ID: <1556302620.76.0.440602004619.issue19460@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:50:26 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:50:26 +0000 Subject: [issue14750] Tkinter application doesn't run from source build on Windows In-Reply-To: <1336477408.86.0.0365400477373.issue14750@psf.upfronthosting.co.za> Message-ID: <1556304626.81.0.518716988613.issue14750@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:14:29 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:14:29 +0000 Subject: [issue15371] test_cmd_line_script should include namespace package tests In-Reply-To: <1342448877.31.0.875625357245.issue15371@psf.upfronthosting.co.za> Message-ID: <1556302469.64.0.542395343138.issue15371@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:05:05 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:05:05 +0000 Subject: [issue15600] expose the finder details used by the FileFinder path hook In-Reply-To: <1344483800.66.0.152640034936.issue15600@psf.upfronthosting.co.za> Message-ID: <1556305505.45.0.951921260918.issue15600@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:48:09 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:48:09 +0000 Subject: [issue17667] Windows: build with "build_pgo.bat -2" fails to optimize python.dll In-Reply-To: <1365444634.63.0.621793850181.issue17667@psf.upfronthosting.co.za> Message-ID: <1556300889.71.0.821873253081.issue17667@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:11:23 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:11:23 +0000 Subject: [issue19468] Relax the type restriction on reloaded modules In-Reply-To: <1383275813.81.0.924128062775.issue19468@psf.upfronthosting.co.za> Message-ID: <1556302283.38.0.059574635723.issue19468@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 13:52:10 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 17:52:10 +0000 Subject: [issue8138] wsgiref.simple_server.SimpleServer claims to be multithreaded In-Reply-To: <1268590136.32.0.519225445448.issue8138@psf.upfronthosting.co.za> Message-ID: <1556301130.72.0.0758860077491.issue8138@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:03:55 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:03:55 +0000 Subject: [issue19960] MacOSX: Building 2.7 without the xcode command line tools installed In-Reply-To: <1386850025.77.0.292014271005.issue19960@psf.upfronthosting.co.za> Message-ID: <1556301835.75.0.862484777899.issue19960@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:33:24 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:33:24 +0000 Subject: [issue17652] Add skip_on_windows decorator to test.support In-Reply-To: <1365353236.0.0.311562843433.issue17652@psf.upfronthosting.co.za> Message-ID: <1556303604.62.0.3477677608.issue17652@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:51:07 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:51:07 +0000 Subject: [issue15856] inspect.getsource(SomeClass) doesn't show @decorators In-Reply-To: <1346685224.9.0.738134714561.issue15856@psf.upfronthosting.co.za> Message-ID: <1556304667.97.0.335266086962.issue15856@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:06:16 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:06:16 +0000 Subject: [issue19745] TEST_DATA_DIR for out-of-tree builds In-Reply-To: <1385260850.2.0.647023626646.issue19745@psf.upfronthosting.co.za> Message-ID: <1556301976.35.0.250117773944.issue19745@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:32:48 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:32:48 +0000 Subject: [issue15552] gettext: if looking for .mo in default locations, also look in locale-bundle location In-Reply-To: <1344021068.11.0.875930388835.issue15552@psf.upfronthosting.co.za> Message-ID: <1556307168.44.0.144997582199.issue15552@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:08:35 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:08:35 +0000 Subject: [issue17848] can't compile with clang and build a shared lib due to libffi In-Reply-To: <1366961546.37.0.678140272964.issue17848@psf.upfronthosting.co.za> Message-ID: <1556302115.69.0.946805010955.issue17848@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:19:34 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:19:34 +0000 Subject: [issue11646] 2to3: msvcrt.(get|put)ch -> (get|put)wch In-Reply-To: <1300839645.82.0.653929076098.issue11646@psf.upfronthosting.co.za> Message-ID: <1556302774.6.0.674881212954.issue11646@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:11:14 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:11:14 +0000 Subject: [issue16376] wrong type for wintypes.BYTE In-Reply-To: <1351702975.6.0.783969996516.issue16376@psf.upfronthosting.co.za> Message-ID: <1556305874.81.0.24635631668.issue16376@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:08:08 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:08:08 +0000 Subject: [issue8526] msilib doesn't support multiple CAB instances in same installer In-Reply-To: <1272154034.54.0.42494510324.issue8526@psf.upfronthosting.co.za> Message-ID: <1556305688.93.0.488177673525.issue8526@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:14:12 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:14:12 +0000 Subject: [issue15388] SAX parse (ExpatParser) leaks file handle when given filename input In-Reply-To: <1342621050.08.0.170764357594.issue15388@psf.upfronthosting.co.za> Message-ID: <1556306052.71.0.298295197491.issue15388@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:06:11 2019 From: report at bugs.python.org (Antony Lee) Date: Fri, 26 Apr 2019 18:06:11 +0000 Subject: [issue19895] Cryptic error when subclassing multiprocessing classes In-Reply-To: <1386239746.14.0.69431016666.issue19895@psf.upfronthosting.co.za> Message-ID: <1556301971.42.0.0505912924326.issue19895@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:17:46 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 26 Apr 2019 18:17:46 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1556003759.23.0.529658703858.issue36546@roundup.psfhosted.org> Message-ID: <20190426181736.GA3720@ando.pearwood.info> Steven D'Aprano added the comment: Hi Raymond, Thanks for working on this, I'm really keen to see this happen and I appreciate your efforts so far. Your arguments have also convinced me that the default calculation type you chose (PERCENTILE.EXC or R type=6) is suitable. But I have a couple of concerns about the API: 1. You call the parameter to choose a calculation definition "method"; I'm mildly concerned that might lead to some confusion or ambiguity with methods on a class. Do you think I'm worrying about nothing? R calls the same parameter "type", which I don't like either since that also has another meaning in Python. Numpy calls an equivalent parameter "interpolation", which I think is not only excessively long to type, but also misleading since at least two of the calculation methods used by numpy don't perform any interpolation at all. Octave and Maple call their parameter "method", so if we stick with "method" we're in good company. 2. I'm more concerned about the values taken by the method parameter. "Inclusive" and "Exclusive" have a related but distinct meaning when it comes to quartiles which is different from the Excel usage: Using range(1, 9) as the data: - standard "inclusive" or "exclusive" quartiles: 2.5, 4.5, 6.5 - Excel's "exclusive" quartiles (R type 6): 2.25, 4.5, 6.75 - Excel's "inclusive" quartiles (R type 7): 2.75, 4.5, 6.25 I'd prefer to keep inclusive/exclusive for such quartiles. I have a working version of quantiles() which supports cutpoints and all nine calculation methods supported by R. Following your lead, I've kept type=6 as the default. I need to tidy up the tests and inline docs, which time permitting I will do over the next 48 hours, and then it will be ready for initial review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:48:13 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:48:13 +0000 Subject: [issue2233] Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail In-Reply-To: <1204652870.95.0.330326965123.issue2233@psf.upfronthosting.co.za> Message-ID: <1556304493.25.0.982609298925.issue2233@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:39:46 2019 From: report at bugs.python.org (SilentGhost) Date: Fri, 26 Apr 2019 19:39:46 +0000 Subject: [issue19895] Cryptic error when subclassing multiprocessing classes In-Reply-To: <1386239746.14.0.69431016666.issue19895@psf.upfronthosting.co.za> Message-ID: <1556307586.27.0.533271056936.issue19895@roundup.psfhosted.org> Change by SilentGhost : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> multiprocessing.JoinableQueue requires new kwarg type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:01:03 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:01:03 +0000 Subject: [issue10175] vs version for win32 compilation of extension modules is undocumented. In-Reply-To: <1287795744.75.0.288699311556.issue10175@psf.upfronthosting.co.za> Message-ID: <1556305263.53.0.175471704144.issue10175@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:12:05 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:12:05 +0000 Subject: [issue15947] Assigning new values to instance of pointer types does not check validity In-Reply-To: <1347720107.38.0.0969129955644.issue15947@psf.upfronthosting.co.za> Message-ID: <1556305925.39.0.131318224088.issue15947@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:33:53 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:33:53 +0000 Subject: [issue20513] Python 2.7. Script interruption on logoff from 0 session under Win2003 and earlier In-Reply-To: <1391540608.89.0.389395011233.issue20513@psf.upfronthosting.co.za> Message-ID: <1556303633.4.0.633596499141.issue20513@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:32:44 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:32:44 +0000 Subject: [issue614557] LookupError etc. need API to get the key Message-ID: <1556303564.16.0.318510092991.issue614557@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:51:57 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:51:57 +0000 Subject: [issue9102] pybench: Cannot compare 2.x and 3.x benchmarks In-Reply-To: <1277739722.07.0.677340784013.issue9102@psf.upfronthosting.co.za> Message-ID: <1556304717.97.0.540108109193.issue9102@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:23:40 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:23:40 +0000 Subject: [issue11598] missing afxres.h error when building bdist_wininst in Visual Studio 2008 Express In-Reply-To: <1300472926.52.0.331223446631.issue11598@psf.upfronthosting.co.za> Message-ID: <1556303020.48.0.340470744674.issue11598@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:27:38 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:27:38 +0000 Subject: [issue17780] the test suite should use a TEMPDIR in the build directory, not the source directory In-Reply-To: <1366223766.74.0.431919060709.issue17780@psf.upfronthosting.co.za> Message-ID: <1556303258.83.0.799416302492.issue17780@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:37:31 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:37:31 +0000 Subject: [issue16242] Pickle and __getattr__ In-Reply-To: <1350324673.62.0.567343854306.issue16242@psf.upfronthosting.co.za> Message-ID: <1556307451.37.0.648728716258.issue16242@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:49:41 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:49:41 +0000 Subject: [issue17101] __main__.py Multiprocessing on Windows In-Reply-To: <1359737656.57.0.323890943093.issue17101@psf.upfronthosting.co.za> Message-ID: <1556308181.69.0.411095605276.issue17101@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:43:28 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:43:28 +0000 Subject: [issue17250] argparse: Issue 15906 patch; positional with nargs='*' and string default In-Reply-To: <1361336297.12.0.955168493515.issue17250@psf.upfronthosting.co.za> Message-ID: <1556307808.52.0.0119756635832.issue17250@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:47:14 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:47:14 +0000 Subject: [issue10048] urllib.request documentation confusing In-Reply-To: <1286535990.46.0.129844190964.issue10048@psf.upfronthosting.co.za> Message-ID: <1556308034.41.0.241216349246.issue10048@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:06:27 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:06:27 +0000 Subject: [issue5248] Adding T_SIZET to structmember.h In-Reply-To: <1234539731.32.0.475254376781.issue5248@psf.upfronthosting.co.za> Message-ID: <1556305587.73.0.605496677413.issue5248@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:38:42 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:38:42 +0000 Subject: [issue1252236] Simplying Tkinter's event loop Message-ID: <1556303922.96.0.171483757001.issue1252236@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:01:33 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:01:33 +0000 Subject: [issue17127] multiprocessing.dummy.Pool does not accept maxtasksperchild argument In-Reply-To: <1360002513.52.0.4376358205.issue17127@psf.upfronthosting.co.za> Message-ID: <1556308893.82.0.844591661016.issue17127@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:35:48 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:35:48 +0000 Subject: [issue16185] include path in subprocess.Popen() file not found error messages on Windows In-Reply-To: <1349871682.42.0.803066776149.issue16185@psf.upfronthosting.co.za> Message-ID: <1556307348.34.0.229327825054.issue16185@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:07:36 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:07:36 +0000 Subject: [issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append In-Reply-To: <1225913493.68.0.578631463812.issue4264@psf.upfronthosting.co.za> Message-ID: <1556309256.71.0.279327253402.issue4264@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:32:01 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:32:01 +0000 Subject: [issue14379] Several traceback docs improvements In-Reply-To: <1332328007.08.0.704590425302.issue14379@psf.upfronthosting.co.za> Message-ID: <1556307121.01.0.788287149902.issue14379@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:52:28 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:52:28 +0000 Subject: [issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4 In-Reply-To: <1257103206.04.0.134413608226.issue7247@psf.upfronthosting.co.za> Message-ID: <1556308348.93.0.972289026578.issue7247@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:16:15 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:16:15 +0000 Subject: [issue18477] fix_import (2to3 fixer) is not case-sensitive In-Reply-To: <1374009050.19.0.500947498255.issue18477@psf.upfronthosting.co.za> Message-ID: <1556309775.57.0.948976267404.issue18477@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:10:00 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:10:00 +0000 Subject: [issue16070] Structure and native Structure (LittleEndianStructure on Windows) supports __slots__, but BigEndianStructure doesn't In-Reply-To: <1348802344.39.0.86334855376.issue16070@psf.upfronthosting.co.za> Message-ID: <1556305800.34.0.547435549567.issue16070@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:01:47 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:01:47 +0000 Subject: [issue12217] Cross-link docs for faulthandler, traceback and pdb In-Reply-To: <1306770313.4.0.799430970978.issue12217@psf.upfronthosting.co.za> Message-ID: <1556305307.67.0.470356537396.issue12217@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:56:08 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:56:08 +0000 Subject: [issue15485] CROSS: append gcc library search paths In-Reply-To: <1343555717.99.0.825702829621.issue15485@psf.upfronthosting.co.za> Message-ID: <1556308568.31.0.56076084638.issue15485@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:58:16 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:58:16 +0000 Subject: [issue17113] argparse.RawDescriptionHelpFormatter should not delete blank lines In-Reply-To: <1359899140.94.0.20575006786.issue17113@psf.upfronthosting.co.za> Message-ID: <1556308696.87.0.80061929902.issue17113@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:01:28 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:01:28 +0000 Subject: [issue15577] Real argc and argv in embedded interpreter In-Reply-To: <1344371910.44.0.262957922939.issue15577@psf.upfronthosting.co.za> Message-ID: <1556305288.12.0.413070784811.issue15577@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:09:51 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:09:51 +0000 Subject: [issue11212] Python memory limit on AIX In-Reply-To: <1297697475.44.0.286339686291.issue11212@psf.upfronthosting.co.za> Message-ID: <1556309391.94.0.656436036509.issue11212@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:25:13 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:25:13 +0000 Subject: [issue15018] Incomplete Python LDFLAGS and CPPFLAGS used for extension modules on posix In-Reply-To: <1338987103.32.0.200789346526.issue15018@psf.upfronthosting.co.za> Message-ID: <1556310313.19.0.463127441833.issue15018@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:48:46 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:48:46 +0000 Subject: [issue14689] make PYTHONWARNINGS variable work in libpython In-Reply-To: <1335606965.58.0.412104204254.issue14689@psf.upfronthosting.co.za> Message-ID: <1556308126.33.0.148909285919.issue14689@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:50:06 2019 From: report at bugs.python.org (Michal Gregorczyk) Date: Fri, 26 Apr 2019 18:50:06 +0000 Subject: [issue36735] minimize disk size of cross-compiled python3.6 Message-ID: <1556304606.39.0.95403682645.issue36735@roundup.psfhosted.org> New submission from Michal Gregorczyk : Hi I am cross-compiling Python3.6 for Android and noticed that the final result is quite large (12mb of python3 binary + over 130mb of files under lib/python3.6). Do you have any suggestions how to reduce that size so that the result is more suitable for devices with constrained disks ? Here are two ideas that come to my mind: 1. not compiling everything to *.pyc files *.pyc files contribute 69mb, I expect that most of the files will not be imported 2. not including lib/python3.6/test Documentation says that the module contains regression tests for Python (https://docs.python.org/3/library/test.html). The directory adds 56MB, can I just remove it ? Should I keep some of the files because remaining parts of standard library refer it ? Does any of these seem unreasonable or fishy ? Are there configure options or make targets that already skip pyc and test ? Are there any other tips how to reduce size? Thanks ---------- components: Cross-Build messages: 340937 nosy: Alex.Willmer, michalgr priority: normal severity: normal status: open title: minimize disk size of cross-compiled python3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:22:13 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:22:13 +0000 Subject: [issue9529] Make re match object iterable In-Reply-To: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> Message-ID: <1556310133.73.0.8654791861.issue9529@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:52:49 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:52:49 +0000 Subject: [issue15629] Add to regrtest the ability to run Lib and Doc doctests In-Reply-To: <1344779660.84.0.741331364071.issue15629@psf.upfronthosting.co.za> Message-ID: <1556308369.61.0.794900732358.issue15629@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:13:15 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 26 Apr 2019 20:13:15 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556309595.5.0.167163611106.issue36679@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Oh, sorry, didn't notice the backport is missing! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:45:04 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:45:04 +0000 Subject: [issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink In-Reply-To: <1313881060.54.0.449889075101.issue12800@psf.upfronthosting.co.za> Message-ID: <1556307904.1.0.532287397131.issue12800@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:48:28 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:48:28 +0000 Subject: [issue17924] Deprecate stat.S_IF* integer constants In-Reply-To: <1367928320.73.0.37418131168.issue17924@psf.upfronthosting.co.za> Message-ID: <1556308108.27.0.880750919228.issue17924@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:16:26 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:16:26 +0000 Subject: [issue21956] Doc files deleted from repo are not deleted from docs.python.org. In-Reply-To: <1405084031.97.0.312909906567.issue21956@psf.upfronthosting.co.za> Message-ID: <1556306186.8.0.570025865408.issue21956@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:46:02 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:46:02 +0000 Subject: [issue10991] trace fails when test imported a temporary file In-Reply-To: <1295825472.67.0.685273364418.issue10991@psf.upfronthosting.co.za> Message-ID: <1556307962.66.0.811326245132.issue10991@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:26:08 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:26:08 +0000 Subject: [issue18977] The -t option has no effect in for uu command-line In-Reply-To: <1378657724.77.0.882529649295.issue18977@psf.upfronthosting.co.za> Message-ID: <1556310368.1.0.395357053705.issue18977@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:30:52 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:30:52 +0000 Subject: [issue2698] Extension module build fails for MinGW: missing vcvarsall.bat In-Reply-To: <1209230424.66.0.154562223128.issue2698@psf.upfronthosting.co.za> Message-ID: <1556307052.12.0.87391179647.issue2698@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 14:59:27 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 18:59:27 +0000 Subject: [issue11455] issue a warning when populating a CPython type dict with non-string keys In-Reply-To: <1299704028.56.0.168922481621.issue11455@psf.upfronthosting.co.za> Message-ID: <1556305167.19.0.365872365369.issue11455@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:10:13 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:10:13 +0000 Subject: [issue4198] os.path.normcase gets fooled on windows with mapped linux network drive In-Reply-To: <1224885833.7.0.0397055051655.issue4198@psf.upfronthosting.co.za> Message-ID: <1556309413.9.0.454296023339.issue4198@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:44:12 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:44:12 +0000 Subject: [issue16729] Document how to provide defaults for setup.py commands options In-Reply-To: <1355924641.52.0.160418711028.issue16729@psf.upfronthosting.co.za> Message-ID: <1556307852.38.0.193712004508.issue16729@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:58:40 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:58:40 +0000 Subject: [issue17362] enable-new-dtags only for GNU ELF linker In-Reply-To: <1362522162.88.0.5476696865.issue17362@psf.upfronthosting.co.za> Message-ID: <1556308720.34.0.750112191818.issue17362@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:36:01 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:36:01 +0000 Subject: [issue1382562] --install-base not honored on win32 Message-ID: <1556310961.71.0.795303130319.issue1382562@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:35:10 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:35:10 +0000 Subject: [issue14730] Implementation of the PEP 419: Protecting cleanup statements from interruptions In-Reply-To: <1336228306.65.0.183212928475.issue14730@psf.upfronthosting.co.za> Message-ID: <1556307310.82.0.220909925629.issue14730@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:34:56 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 26 Apr 2019 20:34:56 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556310896.88.0.681717096879.issue21536@roundup.psfhosted.org> Xavier de Gaye added the comment: Thanks for fixing the regression Victor. Here is another potential problem. On Android API 24 built with NDK r19, symbol resolution fails in the _socket shared library after changeset 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b when python is built with '--enable-shared': generic_x86_64:/data/local/tmp/python $ python -c "import _socket" Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PyByteArray_Type" referenced by "/data/local/tmp/python/lib/python3.8/lib-dynload/_socket.cpython-38d.so"... This does not happen when the build is configured without '--enable-shared'. An NDK issue [1] reports the same problem and dimitry in this issue explains that on Android >= 23 the shared library must be linked against the shared library where the symbol is defined. Dimitry says that the Android loader was fixed in M (i.e. API 23) and it must refer to the changes listed in the "RTLD_LOCAL (Available in API level >= 23)" section of "Android changes for NDK developers" [2]. [1] https://github.com/android-ndk/ndk/issues/201 [2] https://android.googlesource.com/platform/bionic/+/android-n-mr2-preview-1/android-changes-for-ndk-developers.md ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:08:57 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:08:57 +0000 Subject: [issue5773] Crash on shutdown after os.fdopen(2) in debug builds In-Reply-To: <1239885549.06.0.444041706295.issue5773@psf.upfronthosting.co.za> Message-ID: <1556305737.86.0.795142372679.issue5773@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:51:09 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:51:09 +0000 Subject: [issue17243] The changes made for issue 4074 should be documented In-Reply-To: <1361305487.48.0.247163585293.issue17243@psf.upfronthosting.co.za> Message-ID: <1556308269.53.0.172776543599.issue17243@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:06:49 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:06:49 +0000 Subject: [issue10837] Issue catching KeyboardInterrupt while reading stdin In-Reply-To: <1294257725.97.0.863829105509.issue10837@psf.upfronthosting.co.za> Message-ID: <1556305609.07.0.647018164445.issue10837@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:41:53 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:41:53 +0000 Subject: [issue9699] invalid call of Windows API _popen() generating The input line is too long error message In-Reply-To: <1282909340.45.0.225876683414.issue9699@psf.upfronthosting.co.za> Message-ID: <1556307713.02.0.0350838072782.issue9699@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:47:53 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:47:53 +0000 Subject: [issue17026] pdb frames accessible after the termination occurs on uncaught exception In-Reply-To: <1359047913.36.0.999891280978.issue17026@psf.upfronthosting.co.za> Message-ID: <1556308073.43.0.598843772123.issue17026@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:11:36 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:11:36 +0000 Subject: [issue1054] scriptsinstall target fails in alternate build dir In-Reply-To: <1188350602.15.0.357850795139.issue1054@psf.upfronthosting.co.za> Message-ID: <1556309496.13.0.175817328989.issue1054@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:28:42 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:28:42 +0000 Subject: [issue22195] Make it easy to replace print() calls with logging calls In-Reply-To: <1408029480.31.0.129647427763.issue22195@psf.upfronthosting.co.za> Message-ID: <1556310522.43.0.747549716043.issue22195@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:22:57 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:22:57 +0000 Subject: [issue9665] Buid issues on Cygwin - _curses, _curses_panel, and _io In-Reply-To: <1282599121.2.0.918330648156.issue9665@psf.upfronthosting.co.za> Message-ID: <1556310177.27.0.494975278126.issue9665@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:12:43 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:12:43 +0000 Subject: [issue16100] Compiling vim with Python 3.3 support fails In-Reply-To: <1349102758.43.0.280298808198.issue16100@psf.upfronthosting.co.za> Message-ID: <1556309563.52.0.0684950139353.issue16100@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:38:09 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:38:09 +0000 Subject: [issue16652] socket.getfqdn docs are not explicit enough about the algorithm. In-Reply-To: <1355089481.55.0.645096435972.issue16652@psf.upfronthosting.co.za> Message-ID: <1556307489.47.0.213726424341.issue16652@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:32:01 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:32:01 +0000 Subject: [issue5879] multiprocessing example "pool of http servers " fails on windows In-Reply-To: <1241019482.48.0.575158847578.issue5879@psf.upfronthosting.co.za> Message-ID: <1556310721.67.0.522822181649.issue5879@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:26:50 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:26:50 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1556310410.35.0.0864811310784.issue15907@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:41:12 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:41:12 +0000 Subject: [issue12480] urllib2 doesn't use proxy (fieddler2), configed the proxy with ProxyHandler In-Reply-To: <1309706172.79.0.961224445373.issue12480@psf.upfronthosting.co.za> Message-ID: <1556307672.84.0.515901132199.issue12480@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:13:25 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:13:25 +0000 Subject: [issue10551] mimetypes read from the registry should not overwrite standard mime mappings In-Reply-To: <1290885326.33.0.141249546234.issue10551@psf.upfronthosting.co.za> Message-ID: <1556309605.84.0.541174430352.issue10551@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 17:03:51 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 26 Apr 2019 21:03:51 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556312631.96.0.58634863819.issue36710@roundup.psfhosted.org> Jeroen Demeyer added the comment: > It's wrong to share a single gc state between two interpreters And what's your solution for that? I'm not asking for a complete ready-to-implement answer, but at least a basic idea. Otherwise it's impossible for me to judge whether your PR 12934 helps with that or not. Basically I would like to see something like PEP 579 but for this problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:03:20 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:03:20 +0000 Subject: [issue15106] Potential Bug in errors.c In-Reply-To: <1340120572.84.0.94173614856.issue15106@psf.upfronthosting.co.za> Message-ID: <1556309000.86.0.21356396961.issue15106@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:38:32 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:38:32 +0000 Subject: [issue809846] bdist_wininst doesn't clean up read-only files in build dir Message-ID: <1556311112.69.0.567134960997.issue809846@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:37:45 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:37:45 +0000 Subject: [issue9912] Fail when vsvarsall.bat produces stderr In-Reply-To: <1285082676.18.0.058541871992.issue9912@psf.upfronthosting.co.za> Message-ID: <1556311065.68.0.0218975425085.issue9912@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:24:22 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:24:22 +0000 Subject: [issue10071] Should not release GIL while running RegEnumValue In-Reply-To: <1286884651.82.0.158483399845.issue10071@psf.upfronthosting.co.za> Message-ID: <1556310262.73.0.674073630663.issue10071@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:40:23 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:40:23 +0000 Subject: [issue17783] run the testsuite in batched mode In-Reply-To: <1366227480.23.0.0819092121273.issue17783@psf.upfronthosting.co.za> Message-ID: <1556307623.24.0.310418528848.issue17783@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:33:56 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:33:56 +0000 Subject: [issue20117] subprocess on Windows: wrong return code with shell=True In-Reply-To: <1388787639.9.0.977617126521.issue20117@psf.upfronthosting.co.za> Message-ID: <1556307236.98.0.637084983601.issue20117@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:02:38 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:02:38 +0000 Subject: [issue9399] Provide a 'print' action for argparse In-Reply-To: <1280329840.94.0.288179215378.issue9399@psf.upfronthosting.co.za> Message-ID: <1556308958.85.0.115493526672.issue9399@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:03:47 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:03:47 +0000 Subject: [issue15305] Test harness unnecessarily disambiguating twice In-Reply-To: <1341834351.63.0.548541942582.issue15305@psf.upfronthosting.co.za> Message-ID: <1556309027.15.0.883563636374.issue15305@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:36:40 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:36:40 +0000 Subject: [issue1160328] urllib2 post error when using httpproxy Message-ID: <1556311000.19.0.835577875924.issue1160328@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:17:09 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:17:09 +0000 Subject: [issue18651] test failures on KFreeBSD In-Reply-To: <1375610825.98.0.456814475805.issue18651@psf.upfronthosting.co.za> Message-ID: <1556309829.18.0.392221818255.issue18651@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:14:07 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:14:07 +0000 Subject: [issue1776160] Buffer overflow when listing deeply nested directory Message-ID: <1556309647.76.0.455512379721.issue1776160@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:31:01 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:31:01 +0000 Subject: [issue4277] asynchat's handle_error inconsistency In-Reply-To: <1226060153.34.0.769481825348.issue4277@psf.upfronthosting.co.za> Message-ID: <1556310661.04.0.733970284676.issue4277@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:39:01 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:39:01 +0000 Subject: [issue16663] Poor documentation for METH_KEYWORDS In-Reply-To: <1355242591.45.0.999993608815.issue16663@psf.upfronthosting.co.za> Message-ID: <1556307541.11.0.966653335274.issue16663@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:36:22 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:36:22 +0000 Subject: [issue9643] urllib2 - Basic, Digest Proxy Auth Handlers failure will give 401 code instead of 407 In-Reply-To: <1282240751.95.0.79564995249.issue9643@psf.upfronthosting.co.za> Message-ID: <1556310982.03.0.79388844156.issue9643@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:32:29 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:32:29 +0000 Subject: [issue6029] FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks) [SPARC/64-bit] In-Reply-To: <1242377349.19.0.984337506616.issue6029@psf.upfronthosting.co.za> Message-ID: <1556310749.96.0.280827258414.issue6029@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:22:33 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:22:33 +0000 Subject: [issue17148] mingw: nt thread model detection In-Reply-To: <1360190170.63.0.398498965196.issue17148@psf.upfronthosting.co.za> Message-ID: <1556310153.64.0.423362444931.issue17148@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:42:34 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:42:34 +0000 Subject: [issue16807] argparse group nesting lost on inheritance In-Reply-To: <1356745167.13.0.671311915058.issue16807@psf.upfronthosting.co.za> Message-ID: <1556307754.43.0.991012124224.issue16807@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:11:56 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:11:56 +0000 Subject: [issue4722] _winreg.QueryValue fault while reading mangled registry values In-Reply-To: <1229958391.62.0.85659959701.issue4722@psf.upfronthosting.co.za> Message-ID: <1556309516.67.0.149333156135.issue4722@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:21:07 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:21:07 +0000 Subject: [issue22029] argparse - CSS white-space: like control for individual text blocks In-Reply-To: <1406004413.12.0.04362068929.issue22029@psf.upfronthosting.co.za> Message-ID: <1556310067.66.0.93181703716.issue22029@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:54:44 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:54:44 +0000 Subject: [issue13819] _warnings settings are process-wide In-Reply-To: <1326919817.29.0.252163037725.issue13819@psf.upfronthosting.co.za> Message-ID: <1556308484.51.0.821864470595.issue13819@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:54:21 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:54:21 +0000 Subject: [issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer) In-Reply-To: <1344603652.0.0.278766609424.issue15617@psf.upfronthosting.co.za> Message-ID: <1556308461.09.0.00745382747609.issue15617@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:57:04 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:57:04 +0000 Subject: [issue17274] distutils silently omits relative symlinks In-Reply-To: <1361525653.88.0.944877368203.issue17274@psf.upfronthosting.co.za> Message-ID: <1556308624.18.0.344215014127.issue17274@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:34:11 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:34:11 +0000 Subject: [issue900092] hotshot.stats.load fails with AssertionError Message-ID: <1556310851.78.0.241887373188.issue900092@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:46:29 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:46:29 +0000 Subject: [issue14149] argparse: Document how to use argument names that are not Python identifiers In-Reply-To: <1330431835.85.0.549489798388.issue14149@psf.upfronthosting.co.za> Message-ID: <1556307989.59.0.657960267976.issue14149@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:29:35 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:29:35 +0000 Subject: [issue18188] ERROR: test_no_optimize_flag on Mageia Linux Cauldron x86-64 with certain configure flags In-Reply-To: <1370946728.63.0.485742635949.issue18188@psf.upfronthosting.co.za> Message-ID: <1556310575.33.0.373496126846.issue18188@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 15:53:54 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 19:53:54 +0000 Subject: [issue15411] os.chmod() does not follow symlinks on Windows In-Reply-To: <1342859484.11.0.980886642738.issue15411@psf.upfronthosting.co.za> Message-ID: <1556308434.69.0.493811718389.issue15411@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:06:14 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:06:14 +0000 Subject: [issue17695] _sysconfigdata broken with universal builds on OSX In-Reply-To: <1365659948.17.0.458530957334.issue17695@psf.upfronthosting.co.za> Message-ID: <1556309174.07.0.306262173941.issue17695@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:41:42 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:41:42 +0000 Subject: [issue7436] Define 'object with assignable attributes' In-Reply-To: <1259961781.03.0.33355289278.issue7436@psf.upfronthosting.co.za> Message-ID: <1556311302.23.0.381911269887.issue7436@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:42:37 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:42:37 +0000 Subject: [issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases In-Reply-To: <1288967628.79.0.550964963089.issue10328@psf.upfronthosting.co.za> Message-ID: <1556311357.31.0.063395342521.issue10328@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:06:57 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:06:57 +0000 Subject: [issue18355] Merge super() guide into documentation In-Reply-To: <1372901200.41.0.725969821731.issue18355@psf.upfronthosting.co.za> Message-ID: <1556309217.53.0.490602812226.issue18355@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 18:07:11 2019 From: report at bugs.python.org (David Bolen) Date: Fri, 26 Apr 2019 22:07:11 +0000 Subject: [issue11871] test_default_timeout() of test_threading.BarrierTests failure: BrokenBarrierError In-Reply-To: <1303163944.05.0.666091618845.issue11871@psf.upfronthosting.co.za> Message-ID: <1556316431.7.0.81818722244.issue11871@roundup.psfhosted.org> David Bolen added the comment: I should mention that a high level of test parallelism on the part of my worker might have be a contributing factor in this most recent case. The worker was recently upgraded to a faster 4-core VM, but with limited I/O. In a test run the test processes invariably end up stuck on I/O heavy tests, idling the CPUs. So I've been running the tests under -j8, as I found it the most effective combination of supporting tests stuck on I/O while keeping the CPUs busy, but it does mean that in some cases there's a lot pending on the CPUs, and depending on the exact test ordering in a run presumably some more sensitive tests could be impacted. I have in fact seen an increase in random tests generating warnings (fail, then pass) than the worker had previously. I suspect the benefits of the extra parallelism on total test time (-j8 is about 20% faster than -j4) probably isn't valuable enough and will most likely be reducing it a bit. ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:01:56 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:01:56 +0000 Subject: [issue11001] Various obvious errors in cookies documentation In-Reply-To: <1295908065.55.0.221906287574.issue11001@psf.upfronthosting.co.za> Message-ID: <1556308916.73.0.556034165594.issue11001@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:12:26 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 26 Apr 2019 20:12:26 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556309546.43.0.735420160369.issue36679@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Thanks for fixing this! ---------- nosy: +levkivskyi resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:04:58 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:04:58 +0000 Subject: [issue1047397] cgitb failures Message-ID: <1556309098.56.0.481290880966.issue1047397@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:15:24 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:15:24 +0000 Subject: [issue13123] bdist_wininst uninstaller does not remove pycache directories In-Reply-To: <1318000960.21.0.140069466315.issue13123@psf.upfronthosting.co.za> Message-ID: <1556309724.57.0.442024505008.issue13123@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:37:26 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:37:26 +0000 Subject: [issue8988] import + coding = failure (3.1.2/win32) In-Reply-To: <1276426235.15.0.873898512927.issue8988@psf.upfronthosting.co.za> Message-ID: <1556311046.59.0.317984171932.issue8988@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:43:16 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:43:16 +0000 Subject: [issue4609] Allow use of > 256 FD's on solaris in 32 bit mode In-Reply-To: <1228827066.41.0.986801678261.issue4609@psf.upfronthosting.co.za> Message-ID: <1556311396.96.0.536617110758.issue4609@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:33:32 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:33:32 +0000 Subject: [issue10312] intcatcher() can deadlock In-Reply-To: <1288874942.68.0.464773855859.issue10312@psf.upfronthosting.co.za> Message-ID: <1556310812.86.0.166231400189.issue10312@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:34:34 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:34:34 +0000 Subject: [issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters In-Reply-To: <1319700425.9.0.635731429373.issue13272@psf.upfronthosting.co.za> Message-ID: <1556310874.09.0.707934974417.issue13272@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:43:43 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:43:43 +0000 Subject: [issue9274] code.InteractiveInterpreter fails to change locals when invoked in a function In-Reply-To: <1279300874.85.0.408315798568.issue9274@psf.upfronthosting.co.za> Message-ID: <1556311423.16.0.364638796663.issue9274@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:28:07 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:28:07 +0000 Subject: [issue18979] Use argparse in the uu module In-Reply-To: <1378661024.73.0.529726485343.issue18979@psf.upfronthosting.co.za> Message-ID: <1556310487.55.0.528931159026.issue18979@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:14:37 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 26 Apr 2019 20:14:37 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556309677.14.0.809071220393.issue36679@roundup.psfhosted.org> Change by Ivan Levkivskyi : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:41:08 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:41:08 +0000 Subject: [issue18675] Daemon Threads can seg fault In-Reply-To: <1375867396.76.0.697227657582.issue18675@psf.upfronthosting.co.za> Message-ID: <1556311268.35.0.560656140302.issue18675@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 17:14:26 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 26 Apr 2019 21:14:26 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1556313266.36.0.372847048885.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for propelling this forward :-) I'm really happy to have an easy to reach tool that readily summarizes the shape of data and that can be used to compare how distributions differ. > Octave and Maple call their parameter "method", so if we > stick with "method" we're in good company. The Langford paper also uses the word "method", so that is likely just the right word. > I'm more concerned about the values taken by the method parameter. > "Inclusive" and "Exclusive"h ave a related but distinct meaning > when it comes to quartiles which is different from the Excel usage Feel free to change it to whatever communicates the best. The meaning I was going for is closer to the notions of open-interval or closed interval. In terms of use cases, one is for describing population data where the minimum input really is the 0th percentile and the maximum is the 100th percentile. The other is for sample data where the underlying population will have values outside the range of the empirical samples. I'm not sure what words bests describe the distinction. The word "inclusive" and "exclusive" approximated that idea but maybe you can do better. > I have a working version of quantiles() which supports cutpoints > and all nine calculation methods supported by R. My recommendation is to not do this. Usually, it's better to start simple, focusing on core use cases (i.e. sample and population), then let users teach us what additions they really need (this is a YAGNI argument). Once a feature is offered, it can never be taken away even if it proves to be not helpful in most situations or is mostly unused. In his 20 year retrospective, Hyndman expressed dismay that his paper had the opposite effect of what was intended (hoping for a standardization on a single approach rather than a proliferation of all nine methods). My experience in API design is that offering users too many choices will complicate their lives, leading to suboptimal and incorrect choices and creating confusion. That is likely why most software packages other than R only offer one or two options. If you hold off, you can always add these options later. We might just find that what we've got suffices for most everyday uses. Also, I thought the spirit of the statistics module was to offer a few core statistical tools aimed at non-experts, deferring to external packages for more rich collections of optimized, expert tools that cover every option. For me, the best analogy is my two cameras. One is a point and shoot that is easy to use and does a reasonable job. The other is a professional SLR with hundreds of settings that I had to go to photography school to learn to use. FWIW, I held-off on adding "cut_points" because the normal use case is to get equally spaced quantiles. It would be unusual to want 0.25 and 0.50 but not 0.75. The other reason is that user provided cut-points conflict with core concept of "Divide *dist* into *n* continuous intervals with equal probability." User provided cut-points provide other ways to go wrong as well (not being sorted, 0.0 or 1.0 not being valid for some methods, values outside the range 0.0 to 1.0). The need for cut_points makes more sense for numpy or scipy where is common to pass around a linspace. Everyday Python isn't like that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:34:57 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:34:57 +0000 Subject: [issue2148] nis module not supporting group aliases In-Reply-To: <1203510631.66.0.497834646199.issue2148@psf.upfronthosting.co.za> Message-ID: <1556310897.16.0.0288510940785.issue2148@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:40:25 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:40:25 +0000 Subject: [issue8041] No documentation for Py_TPFLAGS_HAVE_STACKLESS_EXTENSION or Py_TPFLAGS_HAVE_VERSION_TAG. In-Reply-To: <1267544098.65.0.440493208051.issue8041@psf.upfronthosting.co.za> Message-ID: <1556311225.62.0.502559541985.issue8041@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:39:38 2019 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 26 Apr 2019 20:39:38 +0000 Subject: [issue10789] Lock.acquire documentation is misleading In-Reply-To: <1293644478.45.0.40426107256.issue10789@psf.upfronthosting.co.za> Message-ID: <1556311178.52.0.473885677421.issue10789@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 18:27:15 2019 From: report at bugs.python.org (Brett Cannon) Date: Fri, 26 Apr 2019 22:27:15 +0000 Subject: [issue32642] add support for path-like objects in sys.path In-Reply-To: <1516771632.94.0.467229070634.issue32642@psf.upfronthosting.co.za> Message-ID: <1556317635.22.0.533779290514.issue32642@roundup.psfhosted.org> Brett Cannon added the comment: This seems fine to me and I can't think of any negatives. Can anyone think of why this might be a bad idea? (Messing with how sys.path is used is just so fundamental I'm being paranoid. :) ---------- nosy: +eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 16:57:31 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 26 Apr 2019 20:57:31 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556312251.92.0.560298855403.issue36710@roundup.psfhosted.org> Jeroen Demeyer added the comment: So what's the relation between _PyRuntime and PyInterpreterState? If the latter is a structure per interpreter, what's the point of also making the former per interpreter? It would be better to move data from _PyRuntime to PyInterpreterState. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 17:48:28 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 26 Apr 2019 21:48:28 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556315308.42.0.656323177001.issue36710@roundup.psfhosted.org> Eric Snow added the comment: FWIW, PEP 554 is part of a larger project that I've been working on (slowly) for several years now. [1] The concrete objective is to leverage subinterpreters as the mechanism by which we can achieve multi-core parallelism in Python code. Moving the GIL (and some other parts of _PyRuntimeState, as Victor indicated) down to per-interpreter state is essential to that. However, I don't thing making _PyRuntime a per-interpreter thing is right. The runtime holds the set of interpreters, as well as any state state shared by the interpreters. Also, to be clear, the status quo is not a problem for me, so make sure I'm not used as the justification for the change (thoughtful as that is of Victor). :) [1] https://github.com/ericsnowcurrently/multi-core-python ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 17:39:39 2019 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 26 Apr 2019 21:39:39 +0000 Subject: [issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__ In-Reply-To: <1550644985.32.0.26417547244.issue36048@roundup.psfhosted.org> Message-ID: <1556314779.24.0.389944855144.issue36048@roundup.psfhosted.org> Miro Hron?ok added the comment: Relevant NumPy issue: https://github.com/numpy/numpy/issues/13412 ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 17:57:50 2019 From: report at bugs.python.org (Anand Arumugam) Date: Fri, 26 Apr 2019 21:57:50 +0000 Subject: [issue36736] Python crashes when calling win32file.LockFileEx Message-ID: <1556315870.81.0.352629640603.issue36736@roundup.psfhosted.org> New submission from Anand Arumugam : Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import win32file >>> import win32con >>> import platform >>> h = win32file.CreateFile(f'd:\\temp\\{platform.node()}.lock', (win32file.GENERIC_READ | win32file.GENERIC_WRITE), 0, None, win32con.CREATE_NEW, 0, None) >>> win32file.LockFileEx(h, win32con.LOCKFILE_EXCLUSIVE_LOCK, 5, 5, None) The moment I hit enter, python command prompt crashes. I'm unable to attach the crash dump file. If you cannot repro the crash, let me know. ---------- assignee: terry.reedy components: IDLE, Windows messages: 340947 nosy: paul.moore, steve.dower, terry.reedy, tim.golden, yapydev, zach.ware priority: normal severity: normal status: open title: Python crashes when calling win32file.LockFileEx type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 18:00:57 2019 From: report at bugs.python.org (Anand Arumugam) Date: Fri, 26 Apr 2019 22:00:57 +0000 Subject: [issue36736] Python crashes when calling win32file.LockFileEx In-Reply-To: <1556315870.81.0.352629640603.issue36736@roundup.psfhosted.org> Message-ID: <1556316057.24.0.35353108339.issue36736@roundup.psfhosted.org> Anand Arumugam added the comment: Here's the crash call stack: Debug session time: Fri Apr 26 14:39:04.000 2019 (UTC - 7:00) System Uptime: 3 days 12:26:46.641 Process Uptime: 0 days 0:02:27.000 ............................................... This dump file has an exception of interest stored in it. The stored exception information can be accessed via .ecxr. (70a8.52a0): Access violation - code c0000005 (first/second chance not available) For analysis of this file, run !analyze -v ntdll!ZwWaitForMultipleObjects+0x14: 00007ffc`c67cf114 c3 ret 0:000> kc # Call Site 00 ntdll!ZwWaitForMultipleObjects 01 KERNELBASE!WaitForMultipleObjectsEx 02 KERNELBASE!WaitForMultipleObjects 03 kernel32!WerpReportFaultInternal 04 kernel32!WerpReportFault 05 KERNELBASE!UnhandledExceptionFilter 06 ntdll!RtlpThreadExceptionFilter 07 ntdll!RtlUserThreadStart$filt$0 08 ntdll!__C_specific_handler 09 ntdll!RtlpExecuteHandlerForException 0a ntdll!RtlDispatchException 0b ntdll!KiUserExceptionDispatch *** WARNING: Unable to verify checksum for win32file.pyd 0c KERNELBASE!LockFileEx 0d win32file 0e python37!_PyMethodDef_RawFastCallKeywords 0f python37!_PyCFunction_FastCallKeywords 10 python37!call_function 11 python37!_PyEval_EvalFrameDefault 12 python37!PyEval_EvalFrameEx 13 python37!_PyEval_EvalCodeWithName 14 python37!PyEval_EvalCodeEx 15 python37!PyEval_EvalCode 16 python37!run_mod 17 python37!PyRun_InteractiveOneObjectEx 18 python37!PyRun_InteractiveLoopFlags 19 python37!PyRun_AnyFileExFlags 1a python37!pymain_run_file 1b python37!pymain_run_filename 1c python37!pymain_run_python 1d python37!pymain_main 1e python37!Py_Main 1f python!invoke_main 20 python!__scrt_common_main_seh 21 kernel32!BaseThreadInitThunk 22 ntdll!RtlUserThreadStart ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 18:28:58 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 26 Apr 2019 22:28:58 +0000 Subject: [issue36737] Warnings operate out of global runtime state. Message-ID: <1556317738.23.0.687262373674.issue36737@roundup.psfhosted.org> New submission from Eric Snow : (See Include/internal/pycore_warnings.h and Python/_warnings.c.) The warnings module's state (filters, default action, etc.) is currently stored at the level of the global runtime. That's a problem for the following reasons: * Python objects are getting stored in _PyRuntimeState * it breaks the isolation of behavior between interpreters * objects are leaking between interpreters * importing the module in a subinterpreter effectively resets the module's state While those are all a problem in a future where interpreters don't share the GIL, that last one is a problem right now for people using subinterpreters. One of the following should happen: * move warnings state down to PyInterpreterState * move warnings state into PyInterpreterState.dict * use the module-state API (PEP 3121) * just work out of the module's __dict__ I could also see use cases for *also* configuring warnings process-wide but that could be handled separately if actually desired. ---------- components: Interpreter Core messages: 340951 nosy: brett.cannon, eric.snow, steve.dower priority: normal severity: normal stage: needs patch status: open title: Warnings operate out of global runtime state. type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 18:11:43 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 26 Apr 2019 22:11:43 +0000 Subject: [issue22640] Add silent mode for py_compile In-Reply-To: <1413361400.01.0.34334853586.issue22640@psf.upfronthosting.co.za> Message-ID: <1556316703.2.0.399372838383.issue22640@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12902 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 17:46:45 2019 From: report at bugs.python.org (Eric Snow) Date: Fri, 26 Apr 2019 21:46:45 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556315205.38.0.290739874884.issue36710@roundup.psfhosted.org> Eric Snow added the comment: I don't think this change is the right way to go (yet), but something related might be. First, let's be clear on the status quo for CPython. (This has gotten long, but I want to be clear.) Status Quo ============ For simplicity sake, let's say nearly all the code operates relative to the 3 levels of runtime state: * global - _PyRuntimeState * interpreter - PyInterpreterState * thread - PyThreadState Furthermore, there are 3 groups of functions in the C-API: * context-sensitive - operate relative to the current Python thread * runtime-dependent - operate relative to some part of the runtime state, regardless of thread * runtime-independent - have nothing to do with CPython's runtime state Most of the C-API is context-sensitive. A small portion is runtime-dependent. A handful of functions are runtime-independent (effectively otherwise stateless helper functions that only happen to be part of the C-API). Each context-sensitive function relies on there being a "runtime context" it can use relative to the current OS thread. That context consists of the current (i.e. active) PyThreadState, the corresponding PyInterpreterState, and the global _PyRuntimeState. That context is derived from data in TSS (see caveats below). This group includes most of the C-API. Each runtime-dependent function operates against one or more runtime state target, regardless of the current thread context (or even if there isn't one). The target state (e.g. PyInterpreterState) is always passed explicitly. Again, this is only a small portion of the C-API. Caveats: * for context-sensitive functions, we get the global runtime state from the global C variable (_PyRuntime) rather than via the implicit thread context * for some of the runtime-dependent functions that target _PyRuntimeState, we rely on the global C variable All of this is the pattern we use currently. Using TSS to identify the implicit runtime context has certain benefits and costs: benefits: * sticking with the status quo means no backward incompatibility for existing C-extension code * easier to distinguish the context-sensitive functions from the runtime-dependent ones * (debatable) callers don't have to track, nor pass through, an extra argument costs: * extra complexity in keeping TSS correct * makes the C-API bigger (extra macros, etc.) Alternative ============= For every context-sensitive function we could add a new first parameter, "context", that provides the runtime context to use. That would be something like this: struct { PyThreadState *tstate; ... } PyRuntimeContext; The interpreter state and global runtime state would still be accessible via the same indirection we have now. Taking this alternative would eliminate the previous costs. Having a consistent "PyRuntimeContext *context" first parameter would maintain the easy distinction from runtime-dependent functions. Asking callers to pass in the context explicitly is probably better regardless. As to backward compatibility, we could maintain a shim to bridge between the old way and the new. About the C-global _PyRuntime ============================== Currently the global runtime state (_PyRuntimeState) is stored in a static global C variable, _PyRuntime. I added it at the time I consolidated many of the existing C globals into a single struct. Having a C global makes it easy to do the wrong thing, so it may be good to do something else. That would mean allocating a _PyRuntimeState on the heap early in startup and pass that around where needed. I expect that would not have any meaningful performance penalty. It would probably also simplify some of the code we currently use to manage _PyRuntime correctly. As a bonus, this would be important if we decided that multiple-runtimes-per-process were a desirable thing. That's a neat idea, though I don't see a need currently. So on its own it's not really a justification for dropping a static _PyRuntime. :) However, I think the other reasons are enough. Conclusions ==================== This issue has a specific objective that I think is premature. We have an existing pattern and we should stick with that until we decide to change to a new pattern. That said, a few things should get corrected and we should investigate alternative patterns for the context-sensitive C-API. As to getting rid of the _PyRuntime global variable in favor of putting it on the heap, I'm not opposed. However, doing so should probably be handled in a separate issue. Here are my thoughts on actionable items: 1. look for a better pattern for the context-sensitive C-API 2. clearly document which of the 3 groups each C-API function belongs to 3. add a "runtime" field to the PyInterpreterState pointing to the parent _PyRuntimeState 4. (maybe) add a _PyRuntimeState_GET() macro, a la PyThreadState_GET() 5. for context-sensitive C-API that uses the global runtime state, get it from the current PyInterpreterState 6. for runtime-dependent C-API that targets the global runtime state, ensure the _PyRuntimeState is always an explicit parameter 7. (maybe) drop _PyRuntime and create a _PyRuntimeState on the heap during startup to pass around ---------- nosy: +ncoghlan, steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 20:01:28 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 00:01:28 +0000 Subject: [issue8138] wsgiref.simple_server.SimpleServer claims to be multithreaded In-Reply-To: <1268590136.32.0.519225445448.issue8138@psf.upfronthosting.co.za> Message-ID: <1556323288.74.0.411806155783.issue8138@roundup.psfhosted.org> Berker Peksag added the comment: It's not easy to write a test for this, so I might merge PR 12977 without a test. ---------- versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 19:13:25 2019 From: report at bugs.python.org (Berker Peksag) Date: Fri, 26 Apr 2019 23:13:25 +0000 Subject: [issue22640] Add silent mode for py_compile In-Reply-To: <1413361400.01.0.34334853586.issue22640@psf.upfronthosting.co.za> Message-ID: <1556320405.6.0.0472702324875.issue22640@roundup.psfhosted.org> Change by Berker Peksag : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 18:57:57 2019 From: report at bugs.python.org (Brett Cannon) Date: Fri, 26 Apr 2019 22:57:57 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1556319477.71.0.96624903216.issue35181@roundup.psfhosted.org> Change by Brett Cannon : ---------- assignee: docs at python -> barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 20:00:19 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 00:00:19 +0000 Subject: [issue8138] wsgiref.simple_server.SimpleServer claims to be multithreaded In-Reply-To: <1268590136.32.0.519225445448.issue8138@psf.upfronthosting.co.za> Message-ID: <1556323219.18.0.158951088991.issue8138@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 20:09:38 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 00:09:38 +0000 Subject: [issue36735] minimize disk size of cross-compiled python3.6 In-Reply-To: <1556304606.39.0.95403682645.issue36735@roundup.psfhosted.org> Message-ID: <1556323778.28.0.123066166313.issue36735@roundup.psfhosted.org> Berker Peksag added the comment: Replying your second question: I think most Linux distributions strip the Lib/test/ directory, so it should be safe to just remove it. We don't refer to it from the standard library. The helpers documented at https://docs.python.org/3/library/test.html are only used by Lib/test. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 21:21:48 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 27 Apr 2019 01:21:48 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556328108.38.0.613774403067.issue36679@roundup.psfhosted.org> Ivan Levkivskyi added the comment: New changeset d111490a1f63db2dcc3714157726dc6a5c0fa1cd by Ivan Levkivskyi in branch '3.7': [3.7] bpo-36679: Rename duplicate test_class_getitem function (GH-12892) (GH-12978) https://github.com/python/cpython/commit/d111490a1f63db2dcc3714157726dc6a5c0fa1cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 22:20:56 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 27 Apr 2019 02:20:56 +0000 Subject: [issue36675] Doctest directives and comments missing from code samples In-Reply-To: <1555757030.56.0.8094269644.issue36675@roundup.psfhosted.org> Message-ID: <1556331656.0.0.417950311645.issue36675@roundup.psfhosted.org> Terry J. Reedy added the comment: I verified that the line in Doc/library/doctest.rst has the comment. " For example, this test passes:: >>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] " However, the comment is omitted from the .html built on Windows by Sphinx 1.8.1. "
>>> print(list(range(20))) 
   ***html for comment should be here***
[0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
10,  11, 12, 13, 14, 15, 16, 17, 18, 19]
" To me, this is a bug with building the .html for doctest.rst. Comments are preserved elsewhere. For instance, the code example for https://docs.python.org/3/library/functions.html#dir. The .rst file has " The resulting list is sorted alphabetically. For example: >>> import struct >>> dir() # show the names in the module namespace # doctest: +SKIP " Both use 3-space colon + indents to mean 'example block'. The only difference is '::' versus ':'. https://devguide.python.org/documenting/#source-code says :: is required. idle.rst also has a code example with comments displayed (I just submitted a PR to not suppress color highlighting.) I leave it to the doc experts to discover why the comments are not included in doctest.html. ---------- nosy: +eric.araujo, ezio.melotti, terry.reedy, willingc stage: -> needs patch title: Doctest directives and comments not visible or missing from code samples -> Doctest directives and comments missing from code samples versions: +Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 21:02:18 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 27 Apr 2019 01:02:18 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556326938.15.0.629723826922.issue36679@roundup.psfhosted.org> Change by Ivan Levkivskyi : ---------- pull_requests: +12904 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 23:11:09 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 27 Apr 2019 03:11:09 +0000 Subject: [issue36730] Change outdated references to macOS In-Reply-To: <1556241092.16.0.423050564241.issue36730@roundup.psfhosted.org> Message-ID: <1556334669.2.0.242548189847.issue36730@roundup.psfhosted.org> Terry J. Reedy added the comment: I believe that this duplicates comments on other Mac issues. The download web pages are not part of the CPython repository covered by this tracker. I will let Ned comment further. ---------- components: +macOS nosy: +ned.deily, ronaldoussoren, terry.reedy -docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 21:10:44 2019 From: report at bugs.python.org (Paul Ganssle) Date: Sat, 27 Apr 2019 01:10:44 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556327444.92.0.615246486172.issue36722@roundup.psfhosted.org> Change by Paul Ganssle : ---------- pull_requests: +12905 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 21:56:58 2019 From: report at bugs.python.org (matt farrugia) Date: Sat, 27 Apr 2019 01:56:58 +0000 Subject: [issue36738] Add 'array_hook' for json module Message-ID: <1556330218.68.0.648450414936.issue36738@roundup.psfhosted.org> New submission from matt farrugia : The json module allows a user to provide an `object_hook` function, which, if provided, is called to transform the dict that is created as a result of parsing a JSON Object. It'd be nice if there was something analogous for JSON Arrays: an `array_hook` function to transform the list that is created as a result of parsing a JSON Array. At the moment transforming JSON Arrays requires one of the following approaches (as far as I can see): (1) Providing an object_hook function that will recursively transform any lists in the values of an Object/dict, including any nested lists, AND recursively transforming the final result in the event that the top level JSON object being parsed is an array (this array is never inside a JSON Object that goes through the `object_hook` transformation). (2) Transforming the entire parsed result after parsing is finished by recursively transforming any lists in the final result, including recursively traversing nested lists AND nested dicts. Providing an array_hook would cut out the need for either approach, as the recursive case from the recursive functions I mentioned could be used as the `array_hook` function directly (without the recursion). ## An example of usage: Let's say we want JSON Arrays represented using tuples rather than lists, e.g. so that they are hashable straight out-of-the-(json)-box. Before this enhancement, this change requires one of the two methods I mentioned above. It is not so difficult to implement these recursive functions, but seems inelegant. After the change, `tuple` could be used as the `array_hook` directly: ``` >>> json.loads('{"foo": [[1, 2], "spam", [], ["eggs"]]}', array_hook=tuple) {'foo': ((1, 2), 'spam', (), ('eggs',))} ``` It seems (in my opinion) this is more elegant than converting via an `object_hook` or traversing the whole structure after parsing. ## The patch: I am submitting a patch that adds an `array_hook` kwarg to the `json` module's functions `load` and `loads`, and to the `json.decoder` module's `JSONDecoder`, `JSONArray` and `JSONObject` classes. I also hooked these together in the `json.scanner` module's `py_make_scanner` function. It seems that `json.scanner` will prefer the `c_make_scanner` function defined in `Modules/_json.c` when it is available. I am not confident enough in my C skills or C x Python knowledge to dive into this module and make the analogous changes. But I assume they will be simple for someone who can read C x Python code, and that the changes will be analogous to those required to `Lib/json/scanner.py`. I need help to accomplish this part of the patch. ## Testing: In the mean time, I added a test to `test_json.test_decode`. It's CURRENTLY FAILING because the implementation of the patch is incomplete (I believe this is only due to the missing part of the patch---the required changes to `Modules/_json.c` I identified above). When I manually reset `json.scanner.make_scanner` to `json.scanner.py_make_scanner` and play around with the new `array_hook` functionality, it seems to work. ---------- components: Extension Modules, Library (Lib) messages: 340957 nosy: matomatical priority: normal severity: normal status: open title: Add 'array_hook' for json module type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 20:48:53 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 27 Apr 2019 00:48:53 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1556326133.91.0.815561941927.issue36674@roundup.psfhosted.org> Terry J. Reedy added the comment: 3.6 only gets security fixes. This appears to be an enhancement request. SkipTest is an exception and according to the doc it should be propagated to the caller. __unittest_skip__ is an undocumented internal name, so you probably should not be using it. If this request is not rejected, we will need test code demonstrating the issue *that does not use zope*. ---------- nosy: +terry.reedy stage: -> test needed type: behavior -> enhancement versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 21:23:23 2019 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 27 Apr 2019 01:23:23 +0000 Subject: [issue36679] duplicate method definition in Lib/test/test_genericclass.py In-Reply-To: <1555775978.71.0.520201003479.issue36679@roundup.psfhosted.org> Message-ID: <1556328203.76.0.131929237913.issue36679@roundup.psfhosted.org> Ivan Levkivskyi added the comment: OK, backported the fix to 3.7. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 22:37:04 2019 From: report at bugs.python.org (Ma Lin) Date: Sat, 27 Apr 2019 02:37:04 +0000 Subject: [issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases In-Reply-To: <1288967628.79.0.550964963089.issue10328@psf.upfronthosting.co.za> Message-ID: <1556332624.47.0.0123601311163.issue10328@roundup.psfhosted.org> Ma Lin added the comment: This bug was fixed in Python 3.7, see issue32308. Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] on win32 >>> re.compile('(?m)(?P[ \t]+\r*$)|(?P(?<=[^\n])\Z)').subn(lambda m:next('<'+k+'>' for k,v in m.groupdict().items() if v is not None), 'foobar ') ('foobar', 1) Python 3.7.3rc1 (tags/v3.7.3rc1:69785b2127, Mar 12 2019, 22:37:55) [MSC v.1916 64 bit (AMD64)] on win32 >>> re.compile('(?m)(?P[ \t]+\r*$)|(?P(?<=[^\n])\Z)').subn(lambda m:next('<'+k+'>' for k,v in m.groupdict().items() if v is not None), 'foobar ') ('foobar', 2) ---------- nosy: +Ma Lin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:41:18 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 27 Apr 2019 04:41:18 +0000 Subject: [issue10328] re.sub[n] doesn't seem to handle /Z replacements correctly in all cases In-Reply-To: <1288967628.79.0.550964963089.issue10328@psf.upfronthosting.co.za> Message-ID: <1556340078.59.0.099705653772.issue10328@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:35:33 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 27 Apr 2019 04:35:33 +0000 Subject: [issue36739] "4.6. Defining Functions" should mention nonlocal In-Reply-To: <1556339049.57.0.959218106285.issue36739@roundup.psfhosted.org> Message-ID: <1556339733.96.0.469688678274.issue36739@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the suggestion. Would you like to submit a PR? ---------- keywords: +easy nosy: +rhettinger stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:49:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 04:49:56 +0000 Subject: [issue15856] inspect.getsource(SomeClass) doesn't show @decorators In-Reply-To: <1346685224.9.0.738134714561.issue15856@psf.upfronthosting.co.za> Message-ID: <1556340596.89.0.466970107385.issue15856@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This should be resolved by issue35113 . I have rewritten the getsource function for classes to use AST to deal with nested classes. The PR adds support for showing the decorator in the source. I would propose closing this as a duplicate of the other issue. ---------- nosy: +xtreak versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 02:02:26 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 06:02:26 +0000 Subject: [issue9643] urllib2 - Basic, Digest Proxy Auth Handlers failure will give 401 code instead of 407 In-Reply-To: <1282240751.95.0.79564995249.issue9643@psf.upfronthosting.co.za> Message-ID: <1556344946.74.0.987043326702.issue9643@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is still an issue and the relevant RFC part and a unittest would be as below. I would propose adding a new keyword argument with 401 as default value to ensure backwards compatibility with older versions. I can propose a PR if agreed and also improve test case since changing the hard coded status code from 401 to 407 doesn't seem to cause any failure. https://tools.ietf.org/html/rfc7235#section-3.2 3.2. 407 Proxy Authentication Required The 407 (Proxy Authentication Required) status code is similar to 401 (Unauthorized), but it indicates that the client needs to authenticate itself in order to use a proxy. The proxy MUST send a Proxy-Authenticate header field (Section 4.3) containing a challenge applicable to that proxy for the target resource. The client MAY repeat the request with a new or replaced Proxy-Authorization header field (Section 4.4). unittest diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index 591b48d6d4..ab8dd32795 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -357,9 +357,9 @@ class ProxyAuthTests(unittest.TestCase): self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD+"bad") self.digest_auth_handler.set_qop("auth") - self.assertRaises(urllib.error.HTTPError, - self.opener.open, - self.URL) + with self.assertRaises(urllib.error.HTTPError) as cm: + self.opener.open(self.URL) + self.assertEqual(cm.exception.code, 407) def test_proxy_with_no_password_raises_httperror(self): self.digest_auth_handler.set_qop("auth") $ ./python.exe -m unittest -v test.test_urllib2_localnet.ProxyAuthTests.test_proxy_with_bad_password_raises_httperror test_proxy_with_bad_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests) ... FAIL ====================================================================== FAIL: test_proxy_with_bad_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_urllib2_localnet.py", line 362, in test_proxy_with_bad_password_raises_httperror self.assertEqual(cm.exception.code, 407) AssertionError: 401 != 407 ---------------------------------------------------------------------- Ran 1 test in 0.160s FAILED (failures=1) ---------- nosy: +xtreak versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:24:09 2019 From: report at bugs.python.org (Peter Bauer) Date: Sat, 27 Apr 2019 04:24:09 +0000 Subject: [issue36739] "4.6. Defining Functions" should mention nonlocal Message-ID: <1556339049.57.0.959218106285.issue36739@roundup.psfhosted.org> New submission from Peter Bauer : In the fourth paragraph, the sentence "Thus, global variables cannot be directly assigned a value within a function (unless named in a global statement)" should somehow be extended to mention the nonlocal-statements: Thus, global variables or variables of enclosing functions cannot be directly assigned a value within a function (unless named in a global statement (for global variables) or named in a nonlocal statement (for variables of enclosing functions) ---------- assignee: docs at python components: Documentation messages: 340963 nosy: docs at python, pbhd0815 priority: normal severity: normal status: open title: "4.6. Defining Functions" should mention nonlocal type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 23:06:05 2019 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 27 Apr 2019 03:06:05 +0000 Subject: [issue35070] test_posix fails on macOS 10.14 Mojave In-Reply-To: <1540497129.89.0.788709270274.issue35070@psf.upfronthosting.co.za> Message-ID: <1556334365.12.0.0894541666068.issue35070@roundup.psfhosted.org> Jeffrey Kintscher added the comment: The test fails for me on Mohave when I build using clang 10.0.0, but passes when I build using gcc 8.3.0.: ProductName: Mac OS X ProductVersion: 10.14.3 BuildVersion: 18D109 gcc-8 (Homebrew GCC 8.3.0) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1 Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin ---------- nosy: +websurfer5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:25:53 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 07:25:53 +0000 Subject: [issue9521] xml.etree.ElementTree skips processing instructions when parsing In-Reply-To: <1281000343.34.0.102578281876.issue9521@psf.upfronthosting.co.za> Message-ID: <1556349953.05.0.206398190077.issue9521@roundup.psfhosted.org> Stefan Behnel added the comment: Comment/PI parsing in general is implemented in issue 36673. Note that there is currently no way to represent comments and PIs in the tree when they appear outside of the root element, which I think is what this ticket is about. After issue 36673 is resolved, however, they can at least be picked up from the parser target or from iterparse() and XMLPullParser(). ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:46:35 2019 From: report at bugs.python.org (daniel hahler) Date: Sat, 27 Apr 2019 04:46:35 +0000 Subject: [issue23163] pdb docs need to contain a statement on threads/multithreaded debugging In-Reply-To: <1420366883.83.0.11703664982.issue23163@psf.upfronthosting.co.za> Message-ID: <1556340395.94.0.728550864789.issue23163@roundup.psfhosted.org> Change by daniel hahler : ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 26 22:01:05 2019 From: report at bugs.python.org (matt farrugia) Date: Sat, 27 Apr 2019 02:01:05 +0000 Subject: [issue36738] Add 'array_hook' for json module In-Reply-To: <1556330218.68.0.648450414936.issue36738@roundup.psfhosted.org> Message-ID: <1556330465.63.0.795664808191.issue36738@roundup.psfhosted.org> Change by matt farrugia : ---------- keywords: +patch pull_requests: +12906 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:44:50 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 27 Apr 2019 04:44:50 +0000 Subject: [issue1776160] Buffer overflow when listing deeply nested directory Message-ID: <1556340290.45.0.154568243083.issue1776160@roundup.psfhosted.org> Serhiy Storchaka added the comment: Benjamin, what of the proposed options do you prefer? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:54:29 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 27 Apr 2019 04:54:29 +0000 Subject: [issue36738] Add 'array_hook' for json module In-Reply-To: <1556330218.68.0.648450414936.issue36738@roundup.psfhosted.org> Message-ID: <1556340869.63.0.815701085347.issue36738@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> bob.ippolito nosy: +bob.ippolito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:45:21 2019 From: report at bugs.python.org (daniel hahler) Date: Sat, 27 Apr 2019 04:45:21 +0000 Subject: [issue21281] DEBUGGING: Simultaneous stopping of all threads on breakpoint and switching between threads In-Reply-To: <1397724727.36.0.728876639251.issue21281@psf.upfronthosting.co.za> Message-ID: <1556340321.75.0.572268684849.issue21281@roundup.psfhosted.org> Change by daniel hahler : ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 00:51:18 2019 From: report at bugs.python.org (daniel hahler) Date: Sat, 27 Apr 2019 04:51:18 +0000 Subject: [issue21281] DEBUGGING: Simultaneous stopping of all threads on breakpoint and switching between threads In-Reply-To: <1397724727.36.0.728876639251.issue21281@psf.upfronthosting.co.za> Message-ID: <1556340678.04.0.74372509654.issue21281@roundup.psfhosted.org> daniel hahler added the comment: This is a good idea. I am currently leaning towards using a threading.Lock around `Pdb.interaction`, or `pdb.set_trace` with pdb++. This would at least mitigate the issue where `pdb.set_trace` is used in some code that gets executed again, and two pdb instances would use the same input, e.g. when debugging web applications. See also https://bugs.python.org/issue23163 for/about improving docs in this regard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 06:25:29 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 10:25:29 +0000 Subject: [issue36735] minimize disk size of cross-compiled python3.6 In-Reply-To: <1556304606.39.0.95403682645.issue36735@roundup.psfhosted.org> Message-ID: <1556360729.97.0.0111354962672.issue36735@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: -scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:17:22 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 07:17:22 +0000 Subject: [issue34160] ElementTree not preserving attribute order In-Reply-To: <1532047327.92.0.56676864532.issue34160@psf.upfronthosting.co.za> Message-ID: <1556349442.64.0.914451708138.issue34160@roundup.psfhosted.org> Stefan Behnel added the comment: I implemented (most of) C14N 2.0 in issue 13611. Please give it a try if you are interested in the canonical serialisation feature. I would like to include it in Py3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:54:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 27 Apr 2019 07:54:19 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556351659.01.0.116190489153.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: Xavier: would you be interested to work on a fix for Android? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 04:56:29 2019 From: report at bugs.python.org (Dieter Maurer) Date: Sat, 27 Apr 2019 08:56:29 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1556355389.73.0.922898273333.issue36674@roundup.psfhosted.org> Dieter Maurer added the comment: Terry J. Reedy wrote: > SkipTest is an exception and according to the doc it should be propagated to the caller. __unittest_skip__ is an undocumented internal name, so you probably should not be using it. > > If this request is not rejected, we will need test code demonstrating the issue *that does not use zope*. The "skip" I am speaking about is a decorator for tests or test classes telling a "runner" to skip tests (likely because conditions for their success are not met - usually, that required packages are not installed). This "skip" (decorator) uses `__unittest_skip__` to tell the the "unittest runner" (that is `unittest.TestCase.run`) that the test should be skipped. The "unittest runner" is extremely rudimentary and lacks many important features. That is why I use the much more feature rich `zope.testrunner`. I could implement the `__unittest_skip__` logic there - but as you wrote - this should remain encapsulated inside `unittest` (that's why I wrote this issue). I attach a test script - which likely is not convincing as the feature is mainly important for a sophisticated test runner, not for explicit calls of `TestCase.debug`. ---------- Added file: https://bugs.python.org/file48287/utest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:15:05 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 07:15:05 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1556349305.36.0.426071531293.issue13611@roundup.psfhosted.org> Stefan Behnel added the comment: It took me a couple of minutes longer to submit it, but it's there now. :) I'm aware that there is a lot of new code involved, covering really three new features, which makes reviewing it a non-trivial task. I personally think it's ready to go into the last alpha release on Monday to receive some initial visibility, but I would like to have at least a little feedback before that. Even just a general opinion whether you support pushing this into 3.8 or not. Postponing it to the first beta would be ok, if you need more time to form an opinion, but having it in an alpha would improve the chance of getting user feedback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 04:41:19 2019 From: report at bugs.python.org (Inada Naoki) Date: Sat, 27 Apr 2019 08:41:19 +0000 Subject: [issue36694] Excessive memory use or memory fragmentation when unpickling many small objects In-Reply-To: <1555866680.03.0.817045016777.issue36694@roundup.psfhosted.org> Message-ID: <1556354479.49.0.396966483534.issue36694@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 08:33:32 2019 From: report at bugs.python.org (Chihiro Ito) Date: Sat, 27 Apr 2019 12:33:32 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556368412.22.0.854602881308.issue36742@roundup.psfhosted.org> Change by Chihiro Ito : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:45:19 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 27 Apr 2019 07:45:19 +0000 Subject: [issue36719] regrtest --findleaks should fail if an uncollectable object is found In-Reply-To: <1556203780.64.0.387499693172.issue36719@roundup.psfhosted.org> Message-ID: <1556351119.63.0.177394266766.issue36719@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 04:04:15 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 27 Apr 2019 08:04:15 +0000 Subject: [issue36740] zipimporter misses namespace packages for implicit dirs Message-ID: <1556352255.87.0.293489853138.issue36740@roundup.psfhosted.org> New submission from Jason R. Coombs : As discovered in https://github.com/pypa/packaging-problems/issues/212, if a PEP 420 namespace package is represented by an implicit directory (that is, there's no explicit entry for the directory, only entries for the contents of the directory), that directory won't be picked up as a namespace package. The following code illustrates the issue: ``` zp $ cat make-pkgs.py import zipfile def make_pkgs(): zf = zipfile.ZipFile('simple.zip', 'w') zf.writestr('pkg/__init__.py', b'') zf.close() zf = zipfile.ZipFile('namespace.zip', 'w') zf.writestr('ns/pkg/__init__.py', b'') zf.close() __name__ == '__main__' and make_pkgs() zp $ python make-pkgs.py zp $ env PYTHONPATH=simple.zip python3.7 -c "import pkg" zp $ env PYTHONPATH=namespace.zip python3.7 -c "import ns.pkg" Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'ns' ``` As you can see, in simple.zip, the `pkg` directory is implied, but despite that condition, `pkg` is importable. However, with namespace.zip, the name `ns` is not visible even though it's present in the zipfile and would be importable if that zipfile were extracted to a file system. ``` zp $ unzip namespace.zip Archive: namespace.zip extracting: ns/pkg/__init__.py zp $ python3.7 -c "import ns.pkg" && echo done done ``` If you were to reconstruct that zip file on the file system using standard tools or explicitly include 'ns/' in the zip entries, the namespace package becomes visible: ``` zp $ rm namespace.zip zp $ zip -r namespace.zip ns adding: ns/ (stored 0%) adding: ns/pkg/ (stored 0%) adding: ns/pkg/__init__.py (stored 0%) adding: ns/pkg/__pycache__/ (stored 0%) adding: ns/pkg/__pycache__/__init__.cpython-37.pyc (deflated 23%) zp $ rm -r ns zp $ env PYTHONPATH=namespace.zip python3.7 -c "import ns.pkg" && echo done done ``` For consistency, the zip import logic should probably honor implicit directories in zip files. ---------- components: Library (Lib) messages: 340975 nosy: jaraco priority: normal severity: normal status: open title: zipimporter misses namespace packages for implicit dirs type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:53:42 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 27 Apr 2019 07:53:42 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556351622.39.0.584951242692.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue for the Android case. I am fine with having a different linking policy per platform. For example, Windows has a different policy than Linux. We can continue to link C extensions to libpython on Android. The ability to load release C extension in debug Python is a feature more for debugging. I am not sure that Android is the best platform for debugging anyway. The debug can be done on a desktop Linux for example, no? ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 07:00:09 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 11:00:09 +0000 Subject: [issue16425] minidom replaceChild(new_child, old_child) removes new_child even if in another document In-Reply-To: <1352279150.2.0.240477416324.issue16425@psf.upfronthosting.co.za> Message-ID: <1556362809.84.0.849586454119.issue16425@roundup.psfhosted.org> Stefan Behnel added the comment: Since "new_child" is inserted at least into a new place, it needs to be removed from its old place as well, so that part seems correct. The problem description does not make it clear whether or not "old_child" is handled correctly, but looking at the code (and lacking a complete example that shows an error), I cannot see anything wrong there. I'll close this ticket since it has been idle for years and it is unclear to me from the description whether it is an actual misbehaviour or a misunderstanding of correct behaviour. ---------- nosy: +scoder resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 08:27:08 2019 From: report at bugs.python.org (=?utf-8?b?5by15pmo6Z+c?=) Date: Sat, 27 Apr 2019 12:27:08 +0000 Subject: [issue36741] Variable about function and list Message-ID: <1556368028.48.0.990345863587.issue36741@roundup.psfhosted.org> New submission from ??? : Hello,I'm a Taiwanese student. First,I will say sorry because of my poor English.If I have an offense,please forgive me. Then,look at the picture about program.I declare a list "cards" to the function "Flush",and divide them by 13 in the function.The function Flash will return boolean finally. After that,I write "main" which declare a list and call "Flush" for it to show what value it is.However,when I print this list again,its value will be changed. I'm confused that isn't Flush.cards a local variable belong to Flush? Why Flush can change the list's value for the other function without return? I asked my friend and he was confused,too.So I send this issue and hope to know why it is.Thanks. ---------- components: Windows files: ???.png messages: 340982 nosy: paul.moore, steve.dower, tim.golden, zach.ware, ??? priority: normal severity: normal status: open title: Variable about function and list type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file48288/???.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 10:35:33 2019 From: report at bugs.python.org (Steve Dower) Date: Sat, 27 Apr 2019 14:35:33 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556375733.39.0.108405760679.issue36710@roundup.psfhosted.org> Steve Dower added the comment: Changing every API to take the context parameter would bring us into alignment with the JavaScript VMs. I'm working on a project that embeds a few of these, as well as Python, and our thread management is much worse than their context parameter. Though I'm of course very sympathetic to the compatibility argument (but then the shims would just load the context from TSS and pass it around, so they're not too bad). Eric's breakdown of context scopes seems spot on, and it means that we only really need the thread state to be passed around. The few places that would be satisfied by runtime state now (GIL, GC) should become interpreter state, which is most easily found from a thread state anyway. Runtime state should eventually probably become runtime configuration (those settings we need to create interpreters) and a minimum amount of state to track live interpreters. I see no reason to pass it around anywhere other than interpreter creation, and as a transitional step toward that goal it should be accessible through the active interpreter state. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 07:39:42 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 11:39:42 +0000 Subject: [issue5166] ElementTree and minidom don't prevent creation of not well-formed XML In-Reply-To: <1233918825.25.0.360851750395.issue5166@psf.upfronthosting.co.za> Message-ID: <1556365182.67.0.0753404885671.issue5166@roundup.psfhosted.org> Stefan Behnel added the comment: This is a tricky decision. lxml, for example, validates user input, but that's because it has to process it anyway and does it along the way directly on input (and very efficiently in C code). ET, on the other hand, is rather lenient about what it allows users to do and doesn't apply much processing to user input. It even allows invalid trees during processing and only expects the tree to be serialisable when requested to serialise it. I think that's a fair behaviour, because most user input will be ok and shouldn't need to suffer the performance penalty of validating all input. Null-characters are a very rare thing to find in text, for example, and I think it's reasonable to let users handle the few cases by themselves where they can occur. Note that simply replacing invalid characters by the replacement character is not a good solution, at least not in the general case, since it silently corrupts data. It's probably a better solution for users to make their code scream out loudly when it has to deal with data that it cannot serialise in the end, and to do that early on input (where its easy to debug) rather than late on serialisation where it might be difficult to understand how the data became what it is. Trying to serialise a null-character seems only a symptom of a more important problem somewhere else in the processing pipeline. In the end, users who *really* care about correct output should run some kind of schema validation over it *after* serialisation, as that would detect not only data issues but also structural and logical issues (such as a missing or empty attribute), specifically for their target data format. In some cases, it might even detect random data corruption due to old non-ECC RAM in the server machine. :) So, if someone finds a way to augment the text escaping procedure with a bit of character validation without making it slower (especially for the extremely common very short strings), then I think we can reconsider this as an enhancement. Until then, and seeing that no-one has come up with a patch in the last 10 years, I'll close this as "won't fix". ---------- dependencies: -Document Object Model API - validation nosy: +scoder resolution: -> wont fix stage: -> resolved status: open -> closed versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 09:04:22 2019 From: report at bugs.python.org (Peter Bauer) Date: Sat, 27 Apr 2019 13:04:22 +0000 Subject: [issue36739] "4.6. Defining Functions" should mention nonlocal In-Reply-To: <1556339049.57.0.959218106285.issue36739@roundup.psfhosted.org> Message-ID: <1556370262.69.0.81201386012.issue36739@roundup.psfhosted.org> Peter Bauer added the comment: ok, will try to create a pull-request for that, although i'm not a natural englishman... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 08:30:16 2019 From: report at bugs.python.org (Chihiro Ito) Date: Sat, 27 Apr 2019 12:30:16 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number Message-ID: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> New submission from Chihiro Ito : urllib.parse.urlsplit raises an exception for an url including a non-ascii hostname in NFKD form and a port number. example: >>> urlsplit('http://\u30d5\u309a:80') Traceback (most recent call last): File "", line 1, in File "/Users/ito/.maltybrew/deen/lib/python3.7/urllib/parse.py", line 437, in urlsplit _checknetloc(netloc) File "/Users/ito/.maltybrew/deen/lib/python3.7/urllib/parse.py", line 407, in _checknetloc "characters under NFKC normalization") ValueError: netloc '?:80' contains invalid characters under NFKC normalization >>> urlsplit('http://\u30d5\u309a') SplitResult(scheme='http', netloc='??', path='', query='', fragment='') >>> urlsplit(unicodedata.normalize('NFKC', 'http://\u30d5\u309a:80')) SplitResult(scheme='http', netloc='?:80', path='', query='', fragment='') I believe this behavior was introduced at Python 3.7.3. Python 3.7.2 doesn't raise any exception for these lines. ---------- components: Unicode messages: 340983 nosy: ezio.melotti, hokousya, vstinner priority: normal severity: normal status: open title: urlsplit doesn't accept a NFKD hostname with a port number versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 09:19:46 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 13:19:46 +0000 Subject: [issue36735] minimize disk size of cross-compiled python3.6 In-Reply-To: <1556304606.39.0.95403682645.issue36735@roundup.psfhosted.org> Message-ID: <1556371186.57.0.68808245004.issue36735@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 10:22:57 2019 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Sat, 27 Apr 2019 14:22:57 +0000 Subject: [issue14149] argparse: Document how to use argument names that are not Python identifiers In-Reply-To: <1330431835.85.0.549489798388.issue14149@psf.upfronthosting.co.za> Message-ID: <1556374977.61.0.0603166892857.issue14149@roundup.psfhosted.org> Change by Fred L. Drake, Jr. : ---------- versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 06:37:48 2019 From: report at bugs.python.org (Big Stone) Date: Sat, 27 Apr 2019 10:37:48 +0000 Subject: [issue35360] Update SQLite to 3.26 in Windows and macOS installer builds In-Reply-To: <1543580070.45.0.788709270274.issue35360@psf.upfronthosting.co.za> Message-ID: <1556361468.3.0.310385135109.issue35360@roundup.psfhosted.org> Big Stone added the comment: sqlite-3.28.0 now available, with extended window functio support: EXCLUDE clause, GROUPS frame types, window chaining, and support for " PRECEDING" and " FOLLOWING" boundaries in RANGE frames. ---------- nosy: +Big Stone _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 03:21:53 2019 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 27 Apr 2019 07:21:53 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556349713.49.0.639939151543.issue36710@roundup.psfhosted.org> Jeroen Demeyer added the comment: Changing *every* C API function to include a state parameter looks very cumbersome. Another alternative would be to store the interpreter state in every Python object (or every class, that would be sufficient). That way, you would only need to pass context to C API functions which do not take a Python object as argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 06:22:41 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 10:22:41 +0000 Subject: [issue36735] minimize disk size of cross-compiled python3.6 In-Reply-To: <1556304606.39.0.95403682645.issue36735@roundup.psfhosted.org> Message-ID: <1556360561.6.0.337917367841.issue36735@roundup.psfhosted.org> Stefan Behnel added the comment: Make sure you use CFLAGS that limit the amount of debug data in the binaries. "-g1" in gcc should be enough to get stack traces on crashes, while reducing the binaries quite considerably compared to the default. "-g0" will give another visible reduction but removes all debug symbols, thus making it difficult to diagnose problems remotely. Apart from that, there used to be support for stuffing the standard library into a zip file, which shrinks .py and .pyc files by a good margin. Not sure what the status of that is, though, since I never needed it. And finally, I'm not sure if this is worth a (bug) ticket, rather than starting a discussion on python-list. Since this is a usage and deployment issue, the larger audience there might have more ideas and experience with things that might work without changing CPython for it. In any case, there will be no changes from the CPython side for this regarding Python 3.6. Anything this ticket might result in would be targeted for a future yet-to-be-released Python version. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 06:42:32 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 27 Apr 2019 10:42:32 +0000 Subject: [issue18675] Daemon Threads can seg fault In-Reply-To: <1375867396.76.0.697227657582.issue18675@psf.upfronthosting.co.za> Message-ID: <1556361752.58.0.516102883998.issue18675@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:10:57 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:10:57 +0000 Subject: [issue28460] Minidom, order of attributes, datachars In-Reply-To: <1476708298.12.0.219819102875.issue28460@psf.upfronthosting.co.za> Message-ID: <1556377857.87.0.672205268173.issue28460@roundup.psfhosted.org> Change by Stefan Behnel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 10:25:47 2019 From: report at bugs.python.org (Eryk Sun) Date: Sat, 27 Apr 2019 14:25:47 +0000 Subject: [issue36736] Python crashes when calling win32file.LockFileEx In-Reply-To: <1556315870.81.0.352629640603.issue36736@roundup.psfhosted.org> Message-ID: <1556375147.44.0.779573427904.issue36736@roundup.psfhosted.org> Eryk Sun added the comment: > win32file.LockFileEx(h, win32con.LOCKFILE_EXCLUSIVE_LOCK, 5, 5, None) This is a third-party issue in the PyWin32 package. win32file.LockFileEx shouldn't allow passing None for the required 5th parameter `ol` (i.e. the lpOverlapped parameter of WINAPI LockFileEx [1]). Or at least it should allocate a default overlapped record in this case, with the offset set to 0. Passing a NULL pointer leads to an access-violation exception. [1]: https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-lockfileex FYI, setting a lock on the file is unecessary in this case. You created the kernel file object without data-access sharing (i.e. shareMode == 0). Until the handle is closed, opening the file again with read or write data access will fail as a sharing violation (32). ---------- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 09:44:34 2019 From: report at bugs.python.org (Peter Bauer) Date: Sat, 27 Apr 2019 13:44:34 +0000 Subject: [issue36739] "4.6. Defining Functions" should mention nonlocal In-Reply-To: <1556339049.57.0.959218106285.issue36739@roundup.psfhosted.org> Message-ID: <1556372674.94.0.404274381793.issue36739@roundup.psfhosted.org> Change by Peter Bauer : ---------- keywords: +patch pull_requests: +12908 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 10:39:55 2019 From: report at bugs.python.org (Steve Dower) Date: Sat, 27 Apr 2019 14:39:55 +0000 Subject: [issue36737] Warnings operate out of global runtime state. In-Reply-To: <1556317738.23.0.687262373674.issue36737@roundup.psfhosted.org> Message-ID: <1556375995.44.0.606512824502.issue36737@roundup.psfhosted.org> Steve Dower added the comment: > I could also see use cases for *also* configuring warnings process-wide but that could be handled separately if actually desired. Beyond "warning configuration is inherited by new interpreters", I don't see any reason to have process wide configuration. People using Python directly will get "process" wide from runtime configuration, and embedders don't want anything implicitly process-wide at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:55:03 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:55:03 +0000 Subject: [issue9521] xml.etree.ElementTree skips processing instructions when parsing In-Reply-To: <1281000343.34.0.102578281876.issue9521@psf.upfronthosting.co.za> Message-ID: <1556380503.6.0.207428424867.issue9521@roundup.psfhosted.org> Stefan Behnel added the comment: Ticket 24287 is a duplicate of this one and has some additional discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:53:59 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:53:59 +0000 Subject: [issue24287] Let ElementTree prolog include comments and processing instructions In-Reply-To: <1432601650.19.0.16515305979.issue24287@psf.upfronthosting.co.za> Message-ID: <1556380439.13.0.732599519091.issue24287@roundup.psfhosted.org> Stefan Behnel added the comment: This is a duplicate of 9521, but it's difficult to say which ticket is better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 13:00:59 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 17:00:59 +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: <1556384459.53.0.125472275428.issue18304@roundup.psfhosted.org> Stefan Behnel added the comment: I was referring to issue 28238 and issue 30485. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 12:58:56 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 16:58:56 +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: <1556384336.48.0.507570904269.issue18304@roundup.psfhosted.org> Stefan Behnel added the comment: Coming back to this issue after a while, I think it's still a relevant problem in some use cases. However, it's not currently clear what an improved solution would look like. The fully qualified tag names in Clark notation are long, sure, but also extremely convenient in being explicit and fully self-contained. One thing I noticed is that the examples used in this and other reports usually employ the .find() methods. Maybe issues 28238 and 30485 can reduce the pain to an acceptable level? Regarding the specific proposals: > root.xmlns_at_root.append('{namespace}') This cannot work since searches from a child element would then not know about the prefix. Elements in ElementTree do not have a global tree state. > 2. Leave the abbreviation colon-separated prefix in front of the element tags as they come in. Note that prefixes are only indirections. They do not have a meaning by themselves and multiple prefixes can (and often do) refer to the same namespace. Moving the prefix resolution from the parser to the users seems to make the situation worse instead of better. ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:42:07 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:42:07 +0000 Subject: [issue32235] test_xml_etree test_xml_etree_c failures with 2.7 and 3.6 branches 20171205 In-Reply-To: <1512578273.44.0.213398074469.issue32235@psf.upfronthosting.co.za> Message-ID: <1556379727.29.0.0576942668856.issue32235@roundup.psfhosted.org> Stefan Behnel added the comment: Closing as outdated / third-party. ---------- nosy: +scoder stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 12:26:25 2019 From: report at bugs.python.org (Eryk Sun) Date: Sat, 27 Apr 2019 16:26:25 +0000 Subject: [issue1776160] Buffer overflow when listing deeply nested directory Message-ID: <1556382385.42.0.700736477966.issue1776160@roundup.psfhosted.org> Eryk Sun added the comment: In Windows 7, FindFirstFileA uses a per-thread static buffer to decode the input bytes path to Unicode. This buffer limits the length to 259 characters (MAX_PATH - 1), even if a "\\?\" device path is used. Windows 8+ uses a dynamic buffer, but I don't see the point of switching to a dynamic buffer on our side given Windows 7 is still so widely used and the documentation still requires Unicode for long "\\?\" paths. Ideally, I think 2.7 should raise the same exception as 3.5 does in this case [1]. For example: >>> os.listdir(long_bytes_path) Traceback (most recent call last): File "", line 1, in ValueError: listdir: path too long for Windows [1]: https://github.com/python/cpython/blob/v3.5.7/Modules/posixmodule.c#L928 ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:55:22 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:55:22 +0000 Subject: [issue24287] Let ElementTree prolog include comments and processing instructions In-Reply-To: <1432601650.19.0.16515305979.issue24287@psf.upfronthosting.co.za> Message-ID: <1556380522.96.0.118141448173.issue24287@roundup.psfhosted.org> Change by Stefan Behnel : ---------- superseder: -> xml.etree.ElementTree skips processing instructions when parsing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:56:22 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:56:22 +0000 Subject: [issue9521] xml.etree.ElementTree skips processing instructions when parsing In-Reply-To: <1281000343.34.0.102578281876.issue9521@psf.upfronthosting.co.za> Message-ID: <1556380582.03.0.758868865772.issue9521@roundup.psfhosted.org> Stefan Behnel added the comment: Issue 24287 is a duplicate of this one and has some additional discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:02:59 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 18:02:59 +0000 Subject: [issue35502] Memory leak in xml.etree.ElementTree.iterparse In-Reply-To: <1544817540.85.0.788709270274.issue35502@psf.upfronthosting.co.za> Message-ID: <1556388179.13.0.832525996619.issue35502@roundup.psfhosted.org> Change by Stefan Behnel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:12:12 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 18:12:12 +0000 Subject: [issue1613500] Write mode option for fileinput module. Message-ID: <1556388732.13.0.21722608168.issue1613500@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:06:22 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 18:06:22 +0000 Subject: [issue36743] Docs: Descript __get__ signature defined differently across the docs In-Reply-To: <1556387803.45.0.177981206888.issue36743@roundup.psfhosted.org> Message-ID: <1556388382.62.0.577393791968.issue36743@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:56:08 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:56:08 +0000 Subject: [issue9521] xml.etree.ElementTree skips processing instructions when parsing In-Reply-To: <1281000343.34.0.102578281876.issue9521@psf.upfronthosting.co.za> Message-ID: <1556380568.34.0.360903073659.issue9521@roundup.psfhosted.org> Change by Stefan Behnel : ---------- Removed message: https://bugs.python.org/msg340994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:10:39 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:10:39 +0000 Subject: [issue28460] Minidom, order of attributes, datachars In-Reply-To: <1476708298.12.0.219819102875.issue28460@psf.upfronthosting.co.za> Message-ID: <1556377839.0.0.139303326179.issue28460@roundup.psfhosted.org> Stefan Behnel added the comment: I'll close this as a duplicate of issue 34160. I'm aware that you also proposed to reduce the text escaping, but it's still needed for attribute values. Not sure if it's really worth having two different escape functions. Feel free to provide a PR and create a new ticket for this, so that we can discuss a specific change proposal. It's not good to discuss more than one topic per ticket. ---------- nosy: +scoder superseder: -> ElementTree not preserving attribute order _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:59:38 2019 From: report at bugs.python.org (Eric Snow) Date: Sat, 27 Apr 2019 15:59:38 +0000 Subject: [issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable In-Reply-To: <1556110680.79.0.127639989845.issue36710@roundup.psfhosted.org> Message-ID: <1556380778.88.0.350907757979.issue36710@roundup.psfhosted.org> Eric Snow added the comment: FWIW, I don't mean to side-track this issue. If we want to have any further discussion about broader solutions then let's take this to capi-sig. In fact, I've started a thread there. I'd post the link, but I think it got stuck in moderation. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:39:05 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:39:05 +0000 Subject: [issue35502] Memory leak in xml.etree.ElementTree.iterparse In-Reply-To: <1544817540.85.0.788709270274.issue35502@psf.upfronthosting.co.za> Message-ID: <1556379545.71.0.680782593961.issue35502@roundup.psfhosted.org> Stefan Behnel added the comment: This ticket looks like it's done for 3.7/8. Can it be closed? I guess 3.6 isn't relevant anymore, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 13:56:43 2019 From: report at bugs.python.org (Jon Dufresne) Date: Sat, 27 Apr 2019 17:56:43 +0000 Subject: [issue36743] Docs: Descript __get__ signature defined differently across the docs Message-ID: <1556387803.45.0.177981206888.issue36743@roundup.psfhosted.org> New submission from Jon Dufresne : Here: https://docs.python.org/3/reference/datamodel.html#object.__get__ The __get__ signature is defined as: object.__get__(self, instance, owner) But here: https://docs.python.org/3/howto/descriptor.html#descriptor-protocol It is defined as: descr.__get__(self, obj, type=None) It is not clear to me as a reader if all descriptors should have the owner/type argument default to None or if it should be required. If it should default to None, I think all doc examples should follow this expectation to make it clear to someone implementing a descriptor for the first time. As best I can tell, the owner/type is always passed. So perhaps the =None shouldn't be there. Grepping the CPython code, I see lots of definitions for both required and optional, adding more confusion for me. If there is a definitive answer, I'm happy to follow through by updating the docs. ---------- assignee: docs at python components: Documentation messages: 341004 nosy: docs at python, jdufresne priority: normal severity: normal status: open title: Docs: Descript __get__ signature defined differently across the docs versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 13:32:50 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 17:32:50 +0000 Subject: [issue25707] Add the close method for ElementTree.iterparse() object In-Reply-To: <1448287045.22.0.0931965485798.issue25707@psf.upfronthosting.co.za> Message-ID: <1556386370.43.0.0163864162061.issue25707@roundup.psfhosted.org> Stefan Behnel added the comment: I don't think there is a need for a close() method. Instead, the iterator should close the file first thing when it's done with it, but only if it owns it. Therefore, the fix in issue 25688 seems correct. Closing can also be done explicitly in a finaliser of the iterator, if implicit closing via decref is too lax. ---------- nosy: +scoder versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 13:09:16 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 17:09:16 +0000 Subject: [issue36741] Variable about function and list In-Reply-To: <1556368028.48.0.990345863587.issue36741@roundup.psfhosted.org> Message-ID: <1556384956.48.0.0230099119576.issue36741@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: You are passing a reference to the list so changes in Flash are made to the actual variable. Using cards.copy() instead of cards passes a copy of the list and hence modifications inside the function won't affect the original list. This is not a bug in CPython and it's more suited python-tutor mailing list. Also in future bug reports please paste the program and output than images. Thanks ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:05:15 2019 From: report at bugs.python.org (Eric Snow) Date: Sat, 27 Apr 2019 15:05:15 +0000 Subject: [issue36737] Warnings operate out of global runtime state. In-Reply-To: <1556317738.23.0.687262373674.issue36737@roundup.psfhosted.org> Message-ID: <1556377515.4.0.319339310787.issue36737@roundup.psfhosted.org> Eric Snow added the comment: Good point. Also, the whole idea of inheriting things (settings, some copied objects, etc.) into subinterpreters is interesting. My initial reaction is that folks would appreciate that feature, at least for a handful of things. It's not critical, but is worth adding to the list of deferred ideas in PEP 554. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:05:17 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 18:05:17 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556388317.05.0.685689110355.issue36742@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This could be due to issue36216. ---------- nosy: +steve.dower, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 11:33:07 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 15:33:07 +0000 Subject: [issue33303] ElementTree Comment text isn't escaped In-Reply-To: <1524011592.66.0.682650639539.issue33303@psf.upfronthosting.co.za> Message-ID: <1556379187.44.0.784385604777.issue33303@roundup.psfhosted.org> Stefan Behnel added the comment: Yes, comment text should be escaped internally like all other text, not by the user. The same applies to processing instructions. This suggests that it's probably also untested currently. Could you provide a PR for that changes both and adds tests? ---------- stage: -> needs patch versions: +Python 3.8 -Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:00:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 27 Apr 2019 18:00:05 +0000 Subject: [issue35502] Memory leak in xml.etree.ElementTree.iterparse In-Reply-To: <1556379545.71.0.680782593961.issue35502@roundup.psfhosted.org> Message-ID: STINNER Victor added the comment: The 3.6 branch no longer accept bugfixes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 12:00:31 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 16:00:31 +0000 Subject: [issue21403] cElementTree's Element creation handles attrib argument different from ET In-Reply-To: <1398891480.86.0.531348738543.issue21403@psf.upfronthosting.co.za> Message-ID: <1556380831.42.0.880796628238.issue21403@roundup.psfhosted.org> Stefan Behnel added the comment: Let's not change this in Py2 anymore. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 12:32:07 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 27 Apr 2019 16:32:07 +0000 Subject: [issue8583] Hardcoded namespace_separator in the cElementTree.XMLParser In-Reply-To: <1272668249.2.0.865128956478.issue8583@psf.upfronthosting.co.za> Message-ID: <1556382727.54.0.383147294106.issue8583@roundup.psfhosted.org> Stefan Behnel added the comment: Closing as a duplicate of the more general issue 18304. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ElementTree -- provide a way to ignore namespace in tags and searches _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:15:31 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 18:15:31 +0000 Subject: [issue2091] file accepts 'rU+' as a mode In-Reply-To: <1202856909.89.0.801927341292.issue2091@psf.upfronthosting.co.za> Message-ID: <1556388931.82.0.352497565792.issue2091@roundup.psfhosted.org> Change by Berker Peksag : ---------- pull_requests: +12910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 14:14:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Sat, 27 Apr 2019 18:14:38 +0000 Subject: [issue36722] In debug build, load also C extensions compiled in release mode or compiled using the stable ABI In-Reply-To: <1556218847.85.0.311466244133.issue36722@roundup.psfhosted.org> Message-ID: <1556388878.16.0.630187077257.issue36722@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5c403b203510549a3f89d138d3265c5cc0cc12af by Victor Stinner (Paul Ganssle) in branch 'master': bpo-36722: Style and grammar edits for ABI news entries (GH-12979) https://github.com/python/cpython/commit/5c403b203510549a3f89d138d3265c5cc0cc12af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:09:25 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 19:09:25 +0000 Subject: [issue15388] SAX parse (ExpatParser) leaks file handle when given filename input In-Reply-To: <1342621050.08.0.170764357594.issue15388@psf.upfronthosting.co.za> Message-ID: <1556392165.41.0.494710021509.issue15388@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Is this fixed with d81f9e24ea89c0aaded1e0d3f8d8076bbd58c19a ? ---------- nosy: +scoder, serhiy.storchaka, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:39:42 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 19:39:42 +0000 Subject: [issue36025] Breaking change in PyDate_FromTimeStamp API In-Reply-To: <1550510525.68.0.55104762284.issue36025@roundup.psfhosted.org> Message-ID: <1556393982.57.0.0683656796883.issue36025@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 4d8c8c0ad6163c24136d3419eb04f310b31f7e64 by Berker Peksag (Paul Ganssle) in branch 'master': bpo-36025: Fix PyDate_FromTimestamp API (GH-11922) https://github.com/python/cpython/commit/4d8c8c0ad6163c24136d3419eb04f310b31f7e64 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:40:47 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 19:40:47 +0000 Subject: [issue2091] file accepts 'rU+' as a mode In-Reply-To: <1202856909.89.0.801927341292.issue2091@psf.upfronthosting.co.za> Message-ID: <1556394047.92.0.192349166578.issue2091@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 21a9ba1992775b5a833da28bfa0a9f028d1b6761 by Berker Peksag in branch 'master': bpo-2091: Fix typo in exception message (GH-12987) https://github.com/python/cpython/commit/21a9ba1992775b5a833da28bfa0a9f028d1b6761 ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:40:59 2019 From: report at bugs.python.org (miss-islington) Date: Sat, 27 Apr 2019 19:40:59 +0000 Subject: [issue2091] file accepts 'rU+' as a mode In-Reply-To: <1202856909.89.0.801927341292.issue2091@psf.upfronthosting.co.za> Message-ID: <1556394059.09.0.776612997959.issue2091@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:45:03 2019 From: report at bugs.python.org (=?utf-8?b?5by15pmo6Z+c?=) Date: Sat, 27 Apr 2019 19:45:03 +0000 Subject: [issue36741] Variable about function and list In-Reply-To: <1556368028.48.0.990345863587.issue36741@roundup.psfhosted.org> Message-ID: <1556394303.91.0.315145841849.issue36741@roundup.psfhosted.org> ??? added the comment: Sorry. This is my first time to use this.Next time I'll notice. Thanks a lot for your fast and patient answer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:48:56 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 27 Apr 2019 19:48:56 +0000 Subject: [issue36741] Variable about function and list In-Reply-To: <1556368028.48.0.990345863587.issue36741@roundup.psfhosted.org> Message-ID: <1556394536.71.0.11922468511.issue36741@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: No problem, closing this as not a bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 15:59:54 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 19:59:54 +0000 Subject: [issue36025] Breaking change in PyDate_FromTimeStamp API In-Reply-To: <1550510525.68.0.55104762284.issue36025@roundup.psfhosted.org> Message-ID: <1556395194.76.0.617291643492.issue36025@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 16:33:12 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 27 Apr 2019 20:33:12 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556397192.63.0.763481466695.issue21536@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- pull_requests: +12912 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 16:39:08 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 20:39:08 +0000 Subject: [issue2091] file accepts 'rU+' as a mode In-Reply-To: <1202856909.89.0.801927341292.issue2091@psf.upfronthosting.co.za> Message-ID: <1556397548.77.0.359759795538.issue2091@roundup.psfhosted.org> Berker Peksag added the comment: New changeset f5972cc0c9a8e3315207e2d67534f330d619af4e by Berker Peksag (Miss Islington (bot)) in branch '3.7': bpo-2091: Fix typo in exception message (GH-12987) https://github.com/python/cpython/commit/f5972cc0c9a8e3315207e2d67534f330d619af4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 16:48:12 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 27 Apr 2019 20:48:12 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556398092.86.0.000439738800525.issue21536@roundup.psfhosted.org> Xavier de Gaye added the comment: PR 12989 fixes the Android issue and has been checked on the Android emulator at API 24. Python is cross-compiled with '--enable-shared' and the python-config scripts give the expected result: generic_x86_64:/data/local/tmp/python/bin $ python -c "from sysconfig import get_config_var; print(get_config_var('Py_ENABLE_SHARED'))" 1 generic_x86_64:/data/local/tmp/python/bin $ sh python-config --libs -lpython3.8d -ldl -lm -lm generic_x86_64:/data/local/tmp/python/bin $ python python-config.py --libs -lpython3.8d -ldl -lm -lm ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 17:39:02 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 27 Apr 2019 21:39:02 +0000 Subject: [issue22640] Add silent mode for py_compile In-Reply-To: <1413361400.01.0.34334853586.issue22640@psf.upfronthosting.co.za> Message-ID: <1556401142.46.0.579935475737.issue22640@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 19:59:41 2019 From: report at bugs.python.org (Berker Peksag) Date: Sat, 27 Apr 2019 23:59:41 +0000 Subject: [issue15388] SAX parse (ExpatParser) leaks file handle when given filename input In-Reply-To: <1342621050.08.0.170764357594.issue15388@psf.upfronthosting.co.za> Message-ID: <1556409581.49.0.686947072657.issue15388@roundup.psfhosted.org> Berker Peksag added the comment: I just tested the snippet in msg165779 under Windows with Python 2.7.16. I didn't get WindowsError after I called os.unlink(path) and verified that path is removed from the file system. I think we can close this issue as 'out of date'. ---------- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 21:21:36 2019 From: report at bugs.python.org (Kevin) Date: Sun, 28 Apr 2019 01:21:36 +0000 Subject: [issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument Message-ID: <1556414496.49.0.573446462504.issue36744@roundup.psfhosted.org> New submission from Kevin : Passing a single argument as a keyword argument to a function decorated with @functools.singledispatch results in an error: $ python Python 3.7.2 (default, Feb 12 2019, 08:15:36) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from functools import singledispatch >>> @singledispatch ... def f(x): ... pass ... >>> f(x=1) Traceback (most recent call last): File "", line 1, in File "/lib/python3.7/functools.py", line 821, in wrapper raise TypeError(f'{funcname} requires at least ' TypeError: f requires at least 1 positional argument I think it's reasonable to expect f(x=1) to do the same as f(1) in this case. Since there is only one argument, it should be the one passed to dispatch(). Relevant code: def wrapper(*args, **kw): if not args: raise TypeError(f'{funcname} requires at least ' '1 positional argument') return dispatch(args[0].__class__)(*args, **kw) https://github.com/python/cpython/blob/445f1b35ce8461268438c8a6b327ddc764287e05/Lib/functools.py#L819-L824 I think the wrapper method could use something like next(iter(d.values())) instead of args[0] when there are no args, but exactly one keyword argument. I am happy to make the change myself ---------- components: Library (Lib) messages: 341016 nosy: KevinG, rhettinger priority: normal severity: normal status: open title: functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 21:49:39 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 28 Apr 2019 01:49:39 +0000 Subject: [issue26978] Implement pathlib.Path.link (Using os.link) Message-ID: <1556416179.14.0.10769762139.issue26978@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12913 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 22:38:39 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 28 Apr 2019 02:38:39 +0000 Subject: [issue26835] Add file-sealing ops to fcntl In-Reply-To: <1461505999.3.0.387096384665.issue26835@psf.upfronthosting.co.za> Message-ID: <1556419119.42.0.243554253939.issue26835@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 22:56:44 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 28 Apr 2019 02:56:44 +0000 Subject: [issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument In-Reply-To: <1556414496.49.0.573446462504.issue36744@roundup.psfhosted.org> Message-ID: <1556420204.3.0.528599337253.issue36744@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This was introduced as part of issue33967. ---------- nosy: +doerwalter, inada.naoki, lukasz.langa, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 23:00:59 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 28 Apr 2019 03:00:59 +0000 Subject: [issue26978] Implement pathlib.Path.link (Using os.link) Message-ID: <1556420459.86.0.258434208738.issue26978@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : This looks same as https://bugs.python.org/issue28608 ---------- nosy: +xtreak versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 27 23:32:56 2019 From: report at bugs.python.org (Kevin) Date: Sun, 28 Apr 2019 03:32:56 +0000 Subject: [issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument In-Reply-To: <1556414496.49.0.573446462504.issue36744@roundup.psfhosted.org> Message-ID: <1556422376.19.0.394556612788.issue36744@roundup.psfhosted.org> Kevin added the comment: I have read issue33967 before posting this one. The error message was introduced there, but the behavior hasn't changed. The problem that issue33967 solves is that while singledispatch requires at least one positional argument, there was no explicit error message that told you that when you didn't pass any. What this issue is about, is that singledispatch could also work without positional arguments IF only one keyword argument is provided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 00:14:28 2019 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sun, 28 Apr 2019 04:14:28 +0000 Subject: [issue35070] test_posix fails on macOS 10.14 Mojave In-Reply-To: <1540497129.89.0.788709270274.issue35070@psf.upfronthosting.co.za> Message-ID: <1556424868.66.0.643227087838.issue35070@roundup.psfhosted.org> Jeffrey Kintscher added the comment: My mistake. It still failed with gcc 8.3.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 00:41:48 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 28 Apr 2019 04:41:48 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1556426508.55.0.640433672586.issue32424@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset 50fed0b64faa3053300008ef5607b570fe209de6 by Stefan Behnel (Gordon P. Hemsley) in branch 'master': bpo-32424: Improve test coverage for xml.etree.ElementTree (GH-12891) https://github.com/python/cpython/commit/50fed0b64faa3053300008ef5607b570fe209de6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 01:59:44 2019 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 28 Apr 2019 05:59:44 +0000 Subject: [issue24758] unittest.mock.Mock's new "unsafe" feature needs a better error message In-Reply-To: <1438283225.26.0.251368779344.issue24758@psf.upfronthosting.co.za> Message-ID: <1556431184.98.0.557669810944.issue24758@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12914 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 02:02:40 2019 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 28 Apr 2019 06:02:40 +0000 Subject: [issue24758] unittest.mock.Mock's new "unsafe" feature needs a better error message In-Reply-To: <1438283225.26.0.251368779344.issue24758@psf.upfronthosting.co.za> Message-ID: <1556431360.09.0.834630313709.issue24758@roundup.psfhosted.org> Zackery Spytz added the comment: I've created a PR for this issue. ---------- nosy: +ZackerySpytz versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 03:12:09 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 28 Apr 2019 07:12:09 +0000 Subject: [issue36743] Docs: Descript __get__ signature defined differently across the docs In-Reply-To: <1556387803.45.0.177981206888.issue36743@roundup.psfhosted.org> Message-ID: <1556435529.55.0.161108310331.issue36743@roundup.psfhosted.org> Raymond Hettinger added the comment: Perhaps the datamodel docs can be clarified to note that callers are allowed to omit the third argument (which usually only makes sense when the second argument is not None). FWIW, section 3.3.2.3 already has an example of a direct call to a __get__ descriptor with only the *obj* argument. ---------- assignee: docs at python -> rhettinger versions: -Python 2.7, Python 3.5, Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 03:22:49 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 28 Apr 2019 07:22:49 +0000 Subject: [issue36715] Dictionary initialization In-Reply-To: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> Message-ID: <1556436169.76.0.69171114077.issue36715@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset da63b321f63b697f75e7ab2f88f55d907f56c187 by Raymond Hettinger in branch 'master': bpo-36715: Add usage note for dict.fromkeys() (GH-12974) https://github.com/python/cpython/commit/da63b321f63b697f75e7ab2f88f55d907f56c187 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 03:23:07 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 28 Apr 2019 07:23:07 +0000 Subject: [issue36715] Dictionary initialization In-Reply-To: <1556135397.5.0.612221590326.issue36715@roundup.psfhosted.org> Message-ID: <1556436187.54.0.167743011966.issue36715@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 04:11:19 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 28 Apr 2019 08:11:19 +0000 Subject: [issue36743] Docs: Descript __get__ signature defined differently across the docs In-Reply-To: <1556387803.45.0.177981206888.issue36743@roundup.psfhosted.org> Message-ID: <1556439079.39.0.593922586284.issue36743@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +12915 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 05:08:31 2019 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 28 Apr 2019 09:08:31 +0000 Subject: [issue27978] [threading] Executor#shutdown with timeout In-Reply-To: <1473187779.38.0.526925636347.issue27978@psf.upfronthosting.co.za> Message-ID: <1556442511.43.0.594071872456.issue27978@roundup.psfhosted.org> Change by Cheryl Sabella : ---------- nosy: +pitrou title: Executor#shutdown with timeout -> [threading] Executor#shutdown with timeout versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 08:17:00 2019 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 28 Apr 2019 12:17:00 +0000 Subject: [issue36745] A possible reference leak in PyObject_SetAttr() Message-ID: <1556453820.15.0.458693960323.issue36745@roundup.psfhosted.org> New submission from Zackery Spytz : If the PyUnicode_AsUTF8() call happens to fail in PyObject_SetAttr(), "name" will be leaked. ---------- components: Interpreter Core messages: 341025 nosy: ZackerySpytz priority: normal severity: normal status: open title: A possible reference leak in PyObject_SetAttr() versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 08:19:28 2019 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 28 Apr 2019 12:19:28 +0000 Subject: [issue36745] A possible reference leak in PyObject_SetAttr() In-Reply-To: <1556453820.15.0.458693960323.issue36745@roundup.psfhosted.org> Message-ID: <1556453968.78.0.170631717579.issue36745@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12916 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 08:58:59 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 28 Apr 2019 12:58:59 +0000 Subject: [issue36745] A possible reference leak in PyObject_SetAttr() In-Reply-To: <1556453820.15.0.458693960323.issue36745@roundup.psfhosted.org> Message-ID: <1556456339.7.0.266035941867.issue36745@roundup.psfhosted.org> miss-islington added the comment: New changeset e0dcb85b7d64153d1741698c04a6736c9669603a by Miss Islington (bot) (Zackery Spytz) in branch 'master': bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993) https://github.com/python/cpython/commit/e0dcb85b7d64153d1741698c04a6736c9669603a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 08:59:16 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 28 Apr 2019 12:59:16 +0000 Subject: [issue36745] A possible reference leak in PyObject_SetAttr() In-Reply-To: <1556453820.15.0.458693960323.issue36745@roundup.psfhosted.org> Message-ID: <1556456356.7.0.250184333359.issue36745@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12917 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 09:00:14 2019 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 28 Apr 2019 13:00:14 +0000 Subject: [issue36745] A possible reference leak in PyObject_SetAttr() In-Reply-To: <1556453820.15.0.458693960323.issue36745@roundup.psfhosted.org> Message-ID: <1556456414.01.0.308139165594.issue36745@roundup.psfhosted.org> Andrew Svetlov added the comment: thanks! ---------- nosy: +asvetlov resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 09:07:56 2019 From: report at bugs.python.org (Berker Peksag) Date: Sun, 28 Apr 2019 13:07:56 +0000 Subject: =?utf-8?q?=5Bissue23297=5D_Clarify_error_when_=E2=80=98tokenize=2Edetect?= =?utf-8?q?=5Fencoding=E2=80=99_receives_text?= In-Reply-To: <1421901626.89.0.392776519963.issue23297@psf.upfronthosting.co.za> Message-ID: <1556456876.01.0.873612598293.issue23297@roundup.psfhosted.org> Berker Peksag added the comment: The original problem has already been solved by making tokenize.generate_tokens() public in issue 12486. However, the same exception can be raised when tokenize.open() is used with tokenize.tokenize(), because it returns a text stream: https://github.com/python/cpython/blob/da63b321f63b697f75e7ab2f88f55d907f56c187/Lib/tokenize.py#L396 hello.py -------- def say_hello(): print("Hello, World!") say_hello() text.py ------- import tokenize with tokenize.open('hello.py') as f: token_gen = tokenize.tokenize(f.readline) for token in token_gen: print(token) When we pass f.readline to tokenize.tokenize(), the second call to detect_encoding() fails, because f.readline() returns str. In Lib/test/test_tokenize.py, it seems like tokenize.open() is only tested to open a file. Its output isn't passed to tokenize.tokenize(). Most of the tests either pass the readline() method of open(..., 'rb') or io.BytesIO() to tokenize.tokenize(). I will submit a documentation PR that suggests to use tokenize.generate_tokens() with tokenize.open(). ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 09:17:43 2019 From: report at bugs.python.org (miss-islington) Date: Sun, 28 Apr 2019 13:17:43 +0000 Subject: [issue36745] A possible reference leak in PyObject_SetAttr() In-Reply-To: <1556453820.15.0.458693960323.issue36745@roundup.psfhosted.org> Message-ID: <1556457463.93.0.357011840564.issue36745@roundup.psfhosted.org> miss-islington added the comment: New changeset 896c6357f3267fe5dc5a33979f8cf46b0a74cfee by Miss Islington (bot) in branch '3.7': bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993) https://github.com/python/cpython/commit/896c6357f3267fe5dc5a33979f8cf46b0a74cfee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 10:38:55 2019 From: report at bugs.python.org (Gordon P. Hemsley) Date: Sun, 28 Apr 2019 14:38:55 +0000 Subject: [issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element In-Reply-To: <1514141500.33.0.213398074469.issue32424@psf.upfronthosting.co.za> Message-ID: <1556462335.73.0.0361519736042.issue32424@roundup.psfhosted.org> Change by Gordon P. Hemsley : ---------- pull_requests: +12918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 14:13:52 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 28 Apr 2019 18:13:52 +0000 Subject: [issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace In-Reply-To: <1474461492.99.0.941056742104.issue28238@psf.upfronthosting.co.za> Message-ID: <1556475232.63.0.834024224425.issue28238@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +12919 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 14:15:07 2019 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 28 Apr 2019 18:15:07 +0000 Subject: [issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace In-Reply-To: <1474461492.99.0.941056742104.issue28238@psf.upfronthosting.co.za> Message-ID: <1556475307.85.0.217298149504.issue28238@roundup.psfhosted.org> Stefan Behnel added the comment: PR submitted, feedback welcome. ---------- assignee: -> scoder type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 14:32:58 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 28 Apr 2019 18:32:58 +0000 Subject: [issue36746] Create test for fcntl.lockf() Message-ID: <1556476378.45.0.872717637619.issue36746@roundup.psfhosted.org> New submission from Joannah Nanjekye : We need to implement a test for fcntl.lockf(). ---------- components: Tests messages: 341031 nosy: christian.heimes, nanjekyejoannah priority: normal severity: normal status: open title: Create test for fcntl.lockf() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 14:34:45 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 28 Apr 2019 18:34:45 +0000 Subject: [issue36746] Create test for fcntl.lockf() In-Reply-To: <1556476378.45.0.872717637619.issue36746@roundup.psfhosted.org> Message-ID: <1556476485.95.0.0105233359197.issue36746@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12920 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 14:40:42 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 28 Apr 2019 18:40:42 +0000 Subject: [issue36746] Create test for fcntl.lockf() In-Reply-To: <1556476378.45.0.872717637619.issue36746@roundup.psfhosted.org> Message-ID: <1556476842.68.0.418625830341.issue36746@roundup.psfhosted.org> Joannah Nanjekye added the comment: I have opened a PR with this test. If you think its great, we can use the same test to test posix.lock(). The one I have written in more detailed than the current test for posix.lock(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 15:22:09 2019 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 28 Apr 2019 19:22:09 +0000 Subject: [issue36740] zipimporter misses namespace packages for implicit dirs In-Reply-To: <1556352255.87.0.293489853138.issue36740@roundup.psfhosted.org> Message-ID: <1556479329.33.0.286689362072.issue36740@roundup.psfhosted.org> Eric V. Smith added the comment: This is a duplicate of issue 14905. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 15:23:28 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 28 Apr 2019 19:23:28 +0000 Subject: [issue36746] Create test for fcntl.lockf() In-Reply-To: <1556476378.45.0.872717637619.issue36746@roundup.psfhosted.org> Message-ID: <1556479408.69.0.792365323506.issue36746@roundup.psfhosted.org> Joannah Nanjekye added the comment: I have opened a PR with this test. If you think its great, we can use the same test to test posix.lockf(). The one I have written in more detailed than the current test for posix.lockf(). Correcting the above comment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 16:24:38 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 28 Apr 2019 20:24:38 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing Message-ID: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> New submission from Xavier de Gaye : The 'scriptsinstall' Makefile target runs the $(srcdir)/Tools/scripts/setup.py script that does not exist anymore. It has been removed by changeset d3f467ac7441a100eb26412424c2dd96ec3ceb67 (found after running 'cd Tools/scripts/ && git log --diff-filter=D --summary .'). Its content was then: from distutils.core import setup if __name__ == '__main__': setup( scripts=[ 'byteyears.py', 'checkpyc.py', 'copytime.py', 'crlf.py', 'dutree.py', 'ftpmirror.py', 'h2py.py', 'lfcr.py', '../i18n/pygettext.py', 'logmerge.py', '../../Lib/tabnanny.py', '../../Lib/timeit.py', 'untabify.py', ], ) ---------- components: Build messages: 341035 nosy: xdegaye priority: normal severity: normal status: open title: Tools/scripts/setup.py is missing type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 16:35:37 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 28 Apr 2019 20:35:37 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1556483737.23.0.496953770054.issue36546@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +12921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 16:38:51 2019 From: report at bugs.python.org (Berker Peksag) Date: Sun, 28 Apr 2019 20:38:51 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing In-Reply-To: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> Message-ID: <1556483931.71.0.55822560879.issue36747@roundup.psfhosted.org> Berker Peksag added the comment: IMO, it would be better if we just remove the scriptsinstall target. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 16:52:26 2019 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 28 Apr 2019 20:52:26 +0000 Subject: [issue36740] zipimporter misses namespace packages for implicit dirs In-Reply-To: <1556352255.87.0.293489853138.issue36740@roundup.psfhosted.org> Message-ID: <1556484746.46.0.544670447143.issue36740@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> zipimport needs to support namespace packages when no 'directory' entry exists _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 18:13:21 2019 From: report at bugs.python.org (Berker Peksag) Date: Sun, 28 Apr 2019 22:13:21 +0000 Subject: [issue36730] Change outdated references to macOS In-Reply-To: <1556241092.16.0.423050564241.issue36730@roundup.psfhosted.org> Message-ID: <1556489601.52.0.0645625343198.issue36730@roundup.psfhosted.org> Berker Peksag added the comment: Thank you for the report! This is already reported by Ned at https://github.com/python/pythondotorg/issues/1254 Closing this as 'third party'. ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 18:41:04 2019 From: report at bugs.python.org (Nir Soffer) Date: Sun, 28 Apr 2019 22:41:04 +0000 Subject: [issue26868] Document PyModule_AddObject's behavior on error In-Reply-To: <1461735404.8.0.653639688918.issue26868@psf.upfronthosting.co.za> Message-ID: <1556491264.89.0.753363670231.issue26868@roundup.psfhosted.org> Change by Nir Soffer : ---------- nosy: +nirs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 18:48:30 2019 From: report at bugs.python.org (Ben Finney) Date: Sun, 28 Apr 2019 22:48:30 +0000 Subject: =?utf-8?q?=5Bissue23297=5D_Clarify_error_when_=E2=80=98tokenize=2Edetect?= =?utf-8?q?=5Fencoding=E2=80=99_receives_text?= In-Reply-To: <1556456876.01.0.873612598293.issue23297@roundup.psfhosted.org> Message-ID: <20190428224820.GY26303@benfinney.id.au> Ben Finney added the comment: On 28-Apr-2019, Berker Peksag wrote: > The original problem has already been solved by making > tokenize.generate_tokens() public in issue 12486. I don't understand how that would affect the resolution of this issue. Isn't the correct resolution here going to entail correct implementation in ?file.readline?? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 19:57:01 2019 From: report at bugs.python.org (Matthias Bussonnier) Date: Sun, 28 Apr 2019 23:57:01 +0000 Subject: [issue22412] Towards an asyncio-enabled command line In-Reply-To: <1410729335.06.0.363715018256.issue22412@psf.upfronthosting.co.za> Message-ID: <1556495821.43.0.919202024589.issue22412@roundup.psfhosted.org> Matthias Bussonnier added the comment: I believe https://bugs.python.org/issue34616 is related as it track async-exec and seem to have a couple of devs that are favorable to it. ---------- nosy: +mbussonn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 22:24:44 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 29 Apr 2019 02:24:44 +0000 Subject: [issue36729] Delete unused text variable on tests In-Reply-To: <1556238336.33.0.148344310049.issue36729@roundup.psfhosted.org> Message-ID: <1556504684.82.0.121011229062.issue36729@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 86f0c8215c2fdaeef58d185ff00b854a45971f84 by Serhiy Storchaka (Emmanuel Arias) in branch 'master': bpo-36729: Delete unused text variable on tests. (GH-12959) https://github.com/python/cpython/commit/86f0c8215c2fdaeef58d185ff00b854a45971f84 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 23:32:47 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 03:32:47 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556508767.56.0.844483132631.issue36540@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lukasz.langa priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 28 23:36:59 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 03:36:59 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556509019.95.0.783589778135.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: ?ukasz, are you ok if we include this one in alpha4 as we were discussing in the PRs? If you are happy with that I will merge it so there is early testing and then we can keep working on the documentation and minor details for the next stage. If not, please, unmark it as a release blocker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 00:32:04 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 29 Apr 2019 04:32:04 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1556512324.88.0.401717160544.issue36546@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset db81ba1393af40ba920a996651e2c11943c3663c by Raymond Hettinger in branch 'master': bpo-36546: More tests: type preservation and equal inputs (#13000) https://github.com/python/cpython/commit/db81ba1393af40ba920a996651e2c11943c3663c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 01:31:03 2019 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 29 Apr 2019 05:31:03 +0000 Subject: [issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace In-Reply-To: <1474461492.99.0.941056742104.issue28238@psf.upfronthosting.co.za> Message-ID: <1556515863.33.0.994781472535.issue28238@roundup.psfhosted.org> Stefan Behnel added the comment: BTW, I found that lxml and ET differ in their behaviour when searching for '*'. ET takes it as meaning "any tree node", whereas lxml interprets it as "any Element". Since ET's parser does not create comments and processing instructions by default, this does not make a difference in most cases, but when the tree contains comments or PIs, then they will be found by '*' in ET but not in lxml. At least for "{*}*", they now both return only Elements. Changing either behaviour for '*' is probably not a good idea at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 01:40:47 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 29 Apr 2019 05:40:47 +0000 Subject: [issue36546] Add quantiles() to the statistics module In-Reply-To: <1554585736.61.0.903931747573.issue36546@roundup.psfhosted.org> Message-ID: <1556516447.85.0.807166840812.issue36546@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: +12922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 02:12:38 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 29 Apr 2019 06:12:38 +0000 Subject: [issue36748] Optimize textio write buffering Message-ID: <1556518358.69.0.33229526654.issue36748@roundup.psfhosted.org> New submission from Inada Naoki : textio uses list of textio for internal buffering. There are two inefficiency: * When textio is line buffered and all written strings are line (it's very common), list object is allocated and freed. * We convert texts into bytes, and call b''.join(list_of_bytes). But when texts are ASCII and codecs are ASCII-compat, we can skip temporary bytes objects. Attached patch is benchmark for buffered and line buffered write. Faster (6): - write_ascii_32k: 101 ns +- 1 ns -> 73.1 ns +- 0.4 ns: 1.39x faster (-28%) - write_ascii_8k: 102 ns +- 1 ns -> 73.4 ns +- 0.4 ns: 1.38x faster (-28%) - write_ascii_linebuffered: 815 ns +- 12 ns -> 731 ns +- 3 ns: 1.12x faster (-10%) - write_unicode_linebuffered: 840 ns +- 11 ns -> 789 ns +- 15 ns: 1.06x faster (-6%) - write_unicode_8k: 124 ns +- 1 ns -> 122 ns +- 1 ns: 1.01x faster (-1%) - write_unicode_32k: 124 ns +- 1 ns -> 122 ns +- 1 ns: 1.01x faster (-1%) ---------- components: IO files: bm_textio.py messages: 341044 nosy: inada.naoki priority: normal severity: normal status: open title: Optimize textio write buffering type: performance versions: Python 3.8 Added file: https://bugs.python.org/file48289/bm_textio.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 02:18:42 2019 From: report at bugs.python.org (Inada Naoki) Date: Mon, 29 Apr 2019 06:18:42 +0000 Subject: [issue36748] Optimize textio write buffering In-Reply-To: <1556518358.69.0.33229526654.issue36748@roundup.psfhosted.org> Message-ID: <1556518722.84.0.909905891869.issue36748@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +12923 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 02:56:16 2019 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 29 Apr 2019 06:56:16 +0000 Subject: [issue13611] Integrate ElementC14N module into xml.etree package In-Reply-To: <1324023461.04.0.625039310668.issue13611@psf.upfronthosting.co.za> Message-ID: <1556520976.81.0.977045928207.issue13611@roundup.psfhosted.org> Stefan Behnel added the comment: Playing around with it a bit more, I ended up changing the interface of the canonicalize() function to return its output as a string by default. It's really nice to be able to say c14n_xml = canonicalize(plain_xml) To write to a file, you now do this: with open("c14n_output.xml", mode='w', encoding='utf-8') as out_file: canonicalize(xml_data, out=out_file) and to read from a file: canonicalize(from_file=fileobj) I think that nicely handles all use cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 03:27:52 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 07:27:52 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556522872.5.0.520864250052.issue21536@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 254b309c801f82509597e3d7d4be56885ef94c11 by Victor Stinner (xdegaye) in branch 'master': bpo-21536: On Android, C extensions are linked to libpython (GH-12989) https://github.com/python/cpython/commit/254b309c801f82509597e3d7d4be56885ef94c11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 03:33:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 07:33:38 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1556523218.75.0.741914736692.issue34814@roundup.psfhosted.org> STINNER Victor added the comment: FYI I modified Python 3.8 to never link C extensions to libpython on Unix (except on Android): bpo-21536, but with a different rationale (better reasons to do so). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 03:40:52 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 29 Apr 2019 07:40:52 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing In-Reply-To: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> Message-ID: <1556523652.09.0.872125989409.issue36747@roundup.psfhosted.org> Xavier de Gaye added the comment: Agreed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 03:42:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 07:42:12 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing In-Reply-To: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> Message-ID: <1556523732.48.0.980518613192.issue36747@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 03:55:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 07:55:40 +0000 Subject: [issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols Message-ID: <1556524540.38.0.725004152071.issue36749@roundup.psfhosted.org> New submission from STINNER Victor : First failure: https://buildbot.python.org/all/#/builders/10/builds/2507 Running the test suite fails with "ModuleNotFoundError: No module named '_socket'". Example of (dynamic) linker issue: *** WARNING: renaming "_socket" since importing it failed: 0509-130 Symbol resolution failed for build/lib.aix-7.2-3.8-pydebug/_socket.so because: 0509-136 Symbol PyCapsule_New (number 8) is not exported from dependent module python. 0509-136 Symbol PyErr_CheckSignals (number 9) is not exported from dependent module python. 0509-136 Symbol PyErr_Clear (number 10) is not exported from dependent module python. 0509-136 Symbol PyErr_ExceptionMatches (number 11) is not exported from dependent module python. 0509-136 Symbol PyErr_Fetch (number 12) is not exported from dependent module python. 0509-136 Symbol PyErr_Format (number 13) is not exported from dependent module python. 0509-021 Additional errors occurred but are not reported. 0509-192 Examine .loader section symbols with the 'dump -Tv' command. IMHO it's a regression caused by my commit 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b for bpo-21536. I guess that ---------- components: Build messages: 341049 nosy: vstinner priority: normal severity: normal status: open title: PPC64 AIX 3.x: compilation issue, linker fails to locate symbols versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:01:38 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 29 Apr 2019 08:01:38 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing In-Reply-To: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> Message-ID: <1556524898.91.0.707434422948.issue36747@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +12924 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:10:19 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 29 Apr 2019 08:10:19 +0000 Subject: [issue36729] Delete unused text variable on tests In-Reply-To: <1556238336.33.0.148344310049.issue36729@roundup.psfhosted.org> Message-ID: <1556525419.15.0.851413633469.issue36729@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:14:26 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 08:14:26 +0000 Subject: [issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols In-Reply-To: <1556524540.38.0.725004152071.issue36749@roundup.psfhosted.org> Message-ID: <1556525666.4.0.562854095664.issue36749@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12925 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:17:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 08:17:40 +0000 Subject: [issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols In-Reply-To: <1556524540.38.0.725004152071.issue36749@roundup.psfhosted.org> Message-ID: <1556525860.31.0.0893512004679.issue36749@roundup.psfhosted.org> STINNER Victor added the comment: David, Michael: Is one of you able to reproduce this issue? If yes, would you mind to test my PR 13004 to validate that it fix the issue? Michael: Your useername "aixtools at gmail.com" on bugs.python.org is surprising. Maybe you should strip "@gmail.com" from it. ---------- nosy: +aixtools at gmail.com, db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:22:10 2019 From: report at bugs.python.org (David Bolen) Date: Mon, 29 Apr 2019 08:22:10 +0000 Subject: [issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols In-Reply-To: <1556524540.38.0.725004152071.issue36749@roundup.psfhosted.org> Message-ID: <1556526130.61.0.159146667371.issue36749@roundup.psfhosted.org> David Bolen added the comment: I think I'm the wrong David for this... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:26:44 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 29 Apr 2019 08:26:44 +0000 Subject: [issue36750] test_socket failed (env changed) on Azure pipeline Message-ID: <1556526404.64.0.613873773496.issue36750@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : This PR https://github.com/python/cpython/pull/12271 has consistent build failures in test_socket even after merging the master branch. Sample build failure : https://dev.azure.com/Python/cpython/_build/results?buildId=41411 I tried reproducing this and I can't reproduce it in Ubuntu. Mac OS seems to fail with leaked references which I think is unrelated to the above Azure failure. The Mac issue is open (issue35092 reported by Victor closed as duplicate of issue23828) but it was about warning though running with regrtest seems to leak references in addition to warnings. Ubuntu build : karthi at ubuntu-s-1vcpu-1gb-blr1-01:~/cpython$ ./python -m test -R 3:3 test_socket Run tests sequentially 0:00:00 load avg: 0.01 [1/1] test_socket beginning 6 repetitions 123456 ...... test_socket passed in 3 min 7 sec == Tests result: SUCCESS == 1 test OK. Total duration: 3 min 7 sec Tests result: SUCCESS Mac OS build (Mac OS 10.10.4 (14E46)) ? cpython git:(master) ./python.exe -m test -R 3:3 test_socket Run tests sequentially 0:00:00 load avg: 2.00 [1/1] test_socket beginning 6 repetitions 123456 /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2419: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2510: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2419: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2510: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2419: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2510: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2419: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2510: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2419: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2510: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2419: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_socket.py:2510: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) . test_socket leaked [20, 20, 20] file descriptors, sum=60 test_socket failed in 2 min 31 sec == Tests result: FAILURE == 1 test failed: test_socket Total duration: 2 min 31 sec Tests result: FAILURE ---------- components: Library (Lib) messages: 341052 nosy: giampaolo.rodola, vstinner, xtreak priority: normal severity: normal status: open title: test_socket failed (env changed) on Azure pipeline type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:33:34 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 29 Apr 2019 08:33:34 +0000 Subject: [issue36750] test_socket failed (env changed) on Azure pipeline In-Reply-To: <1556526404.64.0.613873773496.issue36750@roundup.psfhosted.org> Message-ID: <1556526814.93.0.0646297992044.issue36750@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > issue35092 reported by Victor closed as duplicate of issue23828 Sorry, it was reported by Pablo in issue35092. I haven't seen any old reports of this in search. The other buildbots on Ubuntu run fine so not sure if it's only for Azure and Ubuntu for the PR since master is green on Azure and the buildbots so feel free to close this if needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:38:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 08:38:51 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1556527131.22.0.0924563300725.issue36475@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f781d202a2382731b43bade845a58d28a02e9ea1 by Victor Stinner (Joannah Nanjekye) in branch 'master': bpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly (GH-12667) https://github.com/python/cpython/commit/f781d202a2382731b43bade845a58d28a02e9ea1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:48:32 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 08:48:32 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1556527712.14.0.754377372669.issue36475@roundup.psfhosted.org> STINNER Victor added the comment: I am not comfortable to backport this change to Python 3.7. It's too early to know how it will impact applications and how many complains we will get :-) If someone really wants to backport this scary change to 3.7, I would suggest to wait for 1 month after Python 3.8.0 final release. I close the issue. See bpo-36479 for the follow-up. ---------- versions: +Python 3.6 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 04:54:56 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 08:54:56 +0000 Subject: [issue36479] Exit threads when interpreter is finalizing rather than runtime. In-Reply-To: <1553896742.19.0.478613119545.issue36479@roundup.psfhosted.org> Message-ID: <1556528096.14.0.169691255439.issue36479@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:01:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:01:48 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing In-Reply-To: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> Message-ID: <1556528508.22.0.478653546093.issue36747@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7a5a1cfe04892351bba8e8d7d21ae2262fa35b67 by Victor Stinner (xdegaye) in branch 'master': bpo-36747: Remove the stale scriptsinstall Makefile target (GH-13003) https://github.com/python/cpython/commit/7a5a1cfe04892351bba8e8d7d21ae2262fa35b67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:03:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:03:29 +0000 Subject: [issue36747] Tools/scripts/setup.py is missing In-Reply-To: <1556483078.82.0.709276726367.issue36747@roundup.psfhosted.org> Message-ID: <1556528609.33.0.75839807951.issue36747@roundup.psfhosted.org> STINNER Victor added the comment: The broken scriptsinstall Makefile target of Python 3.7 doesn't hurt. I suggest to leave it, it's not used by any other target. I prefer to not backport the change just to avoid any risk of regression. Thanks Xavier for the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:05:10 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:05:10 +0000 Subject: [issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols In-Reply-To: <1556524540.38.0.725004152071.issue36749@roundup.psfhosted.org> Message-ID: <1556528710.45.0.951973355998.issue36749@roundup.psfhosted.org> STINNER Victor added the comment: David Bolen: Oops, right, I was looking for David Edelsohn :-) David Edelsohn: Are you able to reproduce this issue? If yes, would you mind to test my PR 13004 to validate that it fix the issue? ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:07:16 2019 From: report at bugs.python.org (Laurie Opperman) Date: Mon, 29 Apr 2019 09:07:16 +0000 Subject: [issue36602] Recursive directory list with pathlib.Path.iterdir In-Reply-To: <1554980374.32.0.410571505677.issue36602@roundup.psfhosted.org> Message-ID: <1556528836.3.0.720255885514.issue36602@roundup.psfhosted.org> Laurie Opperman added the comment: I've updated the pull-request to list directories pointed to by listed symbolic links, preventing cyclic listing. An extra instance method `pathlib.Path._iterdir_recursive` was added for this. We still need to decide whether to yield the directories themselves rather than just the files under those directories. Very easy to implement this. One thing I just realised is that a symlink can point to a subdirectory further down the chain. The current implementation will list the files under that directory using the symlink as prefix rather than the full path. Shouldn't matter though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:12:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:12:33 +0000 Subject: [issue36750] test_socket leaks file descriptors on macOS In-Reply-To: <1556526404.64.0.613873773496.issue36750@roundup.psfhosted.org> Message-ID: <1556529153.6.0.926312671189.issue36750@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +pablogsal title: test_socket failed (env changed) on Azure pipeline -> test_socket leaks file descriptors on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:16:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:16:01 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556529361.9.0.114941893042.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b36e5d627d4232a01850707eb78a5067f3fd77f4 by Victor Stinner in branch 'master': bpo-36356: Destroy the GIL at exit (GH-12453) https://github.com/python/cpython/commit/b36e5d627d4232a01850707eb78a5067f3fd77f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:19:57 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:19:57 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556529597.15.0.0448517215286.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: The initial issue has been fixed, so I close the issue. I prefer to get more specific issues like bpo-36724 "Clear _PyRuntime at exit" to following changes. Thanks Ben Harper for the bug report and the fix. Note: Ben, I like your songs! Good to know that you chose to contribute to Python in your free time! ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:23:39 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:23:39 +0000 Subject: [issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly. In-Reply-To: <1553887580.94.0.470279627742.issue36475@roundup.psfhosted.org> Message-ID: <1556529819.7.0.944868032126.issue36475@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:26:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:26:33 +0000 Subject: [issue36749] PPC64 AIX 3.x: compilation issue, linker fails to locate symbols In-Reply-To: <1556524540.38.0.725004152071.issue36749@roundup.psfhosted.org> Message-ID: <1556529992.99.0.715506269638.issue36749@roundup.psfhosted.org> STINNER Victor added the comment: Oh, that's strange now. The following build succeeded! https://buildbot.python.org/all/#/builders/10/builds/2508 I don't understand why this buildbot runs builds on commits which are now 1 month old. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:29:55 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 29 Apr 2019 09:29:55 +0000 Subject: [issue24048] remove_module() needs to save/restore exception state In-Reply-To: <1429855118.66.0.488857300303.issue24048@psf.upfronthosting.co.za> Message-ID: <1556530195.66.0.90059464835.issue24048@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +12926 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:30:49 2019 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 29 Apr 2019 09:30:49 +0000 Subject: [issue24048] remove_module() needs to save/restore exception state In-Reply-To: <1429855118.66.0.488857300303.issue24048@psf.upfronthosting.co.za> Message-ID: <1556530249.68.0.716337544372.issue24048@roundup.psfhosted.org> Zackery Spytz added the comment: I've created a PR for this issue. ---------- nosy: +ZackerySpytz versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 05:47:21 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 09:47:21 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556531241.84.0.644888387691.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: Oh. test_daemon_threads_shutdown_stdout_deadlock of test_io fails randomly on buildbots. I ran "./python -m test test_io -m '*daemon*' -F -j4" for 5 minutes on my Fedora 29 before merging my PR, but I didn't get any failure :-( ====================================================================== FAIL: test_daemon_threads_shutdown_stdout_deadlock (test.test_io.CMiscIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_io.py", line 4186, in test_daemon_threads_shutdown_stdout_deadlock self.check_daemon_threads_shutdown_deadlock('stdout') File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_io.py", line 4177, in check_daemon_threads_shutdown_deadlock self.assertIn("Fatal Python error: could not acquire lock " AssertionError: "Fatal Python error: could not acquire lock for <_io.BufferedWriter name=''> at interpreter shutdown, possibly due to daemon threads" not found in 'Fatal Python error: PyCOND_FINI(_PyRuntime.ceval.gil.cond) failed' Failures: AMD64 Fedora Rawhide Clang Installed 3.x: fail then pass https://buildbot.python.org/all/#/builders/188/builds/93 s390x Debian 3.x: fail then pass https://buildbot.python.org/all/#/builders/13/builds/2799 s390x RHEL 3.x: fail twice https://buildbot.python.org/all/#/builders/21/builds/2780 AMD64 Debian root 3.x: fail twice https://buildbot.python.org/all/#/builders/27/builds/2759 ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 06:09:37 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 10:09:37 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556532577.59.0.575267119664.issue36356@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12927 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 06:50:03 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 29 Apr 2019 10:50:03 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556535003.62.0.0513508379203.issue35952@roundup.psfhosted.org> Change by Xavier de Gaye : ---------- keywords: +patch pull_requests: +12928 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 06:58:10 2019 From: report at bugs.python.org (Charalampos Stratakis) Date: Mon, 29 Apr 2019 10:58:10 +0000 Subject: [issue35907] Unnecessary URL scheme exists to allow file:// reading file in urllib In-Reply-To: <1549441191.29.0.148559977828.issue35907@roundup.psfhosted.org> Message-ID: <1556535490.44.0.528325266683.issue35907@roundup.psfhosted.org> Change by Charalampos Stratakis : ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 07:04:12 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 11:04:12 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556535852.32.0.663780112771.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 99fcc616d400cd31af0733c3f8cc93bcc1d32a44 by Victor Stinner in branch 'master': Revert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006) https://github.com/python/cpython/commit/99fcc616d400cd31af0733c3f8cc93bcc1d32a44 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 07:04:51 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 11:04:51 +0000 Subject: [issue36356] Failure to build with address sanitizer In-Reply-To: <1552967277.69.0.646647509224.issue36356@roundup.psfhosted.org> Message-ID: <1556535891.48.0.0342495792456.issue36356@roundup.psfhosted.org> STINNER Victor added the comment: I just reverted the change. I'm unable to reproduce and I am not available this week to investigate anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 07:15:50 2019 From: report at bugs.python.org (Utkarsh Gupta) Date: Mon, 29 Apr 2019 11:15:50 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556536550.65.0.403555732293.issue35329@roundup.psfhosted.org> Utkarsh Gupta added the comment: Hey, I'd be happy to submit one :) ---------- nosy: +utkarsh2102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 07:20:07 2019 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 29 Apr 2019 11:20:07 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556536807.43.0.104204243418.issue35952@roundup.psfhosted.org> Xavier de Gaye added the comment: Attached pythoninfo_api_24.txt, the output of pythoninfo for Android API 24 with PR 13007. ---------- nosy: +vstinner Added file: https://bugs.python.org/file48290/pythoninfo_api_24.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 07:20:26 2019 From: report at bugs.python.org (Utkarsh Gupta) Date: Mon, 29 Apr 2019 11:20:26 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556536826.88.0.712529569335.issue35329@roundup.psfhosted.org> Change by Utkarsh Gupta : ---------- keywords: +patch pull_requests: +12929 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 07:42:55 2019 From: report at bugs.python.org (Dain Dwarf) Date: Mon, 29 Apr 2019 11:42:55 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1556538175.74.0.40856090897.issue34155@roundup.psfhosted.org> Dain Dwarf added the comment: Hello, kind of new here. I just wanted to note that the issue that lead to Tchap's security attack still exists in the non-deprecated message_from_string function: email.message_from_string('From: a at malicious.org@important.com', policy=email.policy.default)['from'].addresses (Address(display_name='', username='a', domain='malicious.org'),) So, deprecating parseaddr is not enough for security purpose, unless there is another ticket for the new email API. ---------- nosy: +Dain Dwarf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:03:35 2019 From: report at bugs.python.org (Jakub Wilk) Date: Mon, 29 Apr 2019 12:03:35 +0000 Subject: [issue34155] email.utils.parseaddr mistakenly parse an email In-Reply-To: <1532012023.85.0.56676864532.issue34155@psf.upfronthosting.co.za> Message-ID: <1556539415.66.0.497085332226.issue34155@roundup.psfhosted.org> Change by Jakub Wilk : ---------- nosy: -jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:13:17 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 12:13:17 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 Message-ID: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : This issue is to discuss how to handle the changes in the inspect module for PEP 570. In particular, how to handle: * getfullargspec * formatargspec for positional-only parameters. ---------- components: Interpreter Core messages: 341070 nosy: pablogsal, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Changes in the inspect module for PEP 570 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:15:04 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 12:15:04 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556540104.34.0.467136471125.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Opened https://bugs.python.org/issue36751 to track changes in the inspect module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:37:13 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 12:37:13 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556541433.65.0.722939044214.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8c77b8cb9188165a123f2512026e3629bf03dc9b by Pablo Galindo in branch 'master': bpo-36540: PEP 570 -- Implementation (GH-12701) https://github.com/python/cpython/commit/8c77b8cb9188165a123f2512026e3629bf03dc9b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:50:07 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 12:50:07 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556542207.67.0.486913087406.issue36540@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:51:10 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 12:51:10 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556542270.78.0.294638397125.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The implementation has been merged, so I will remove the "release blocker". We are still missing the documentation and the final changes to the inspect module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:53:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 12:53:35 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556542415.74.0.136475702539.issue35952@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a86e06433a010f873dfd7957e0f87a39539876ee by Victor Stinner (xdegaye) in branch 'master': bpo-35952: Fix test.pythoninfo when the compiler is missing (GH-13007) https://github.com/python/cpython/commit/a86e06433a010f873dfd7957e0f87a39539876ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 08:56:31 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 12:56:31 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556542591.05.0.530302646943.issue35952@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:02:35 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:02:35 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556542955.08.0.474277764506.issue36751@roundup.psfhosted.org> STINNER Victor added the comment: Context: see https://github.com/python/cpython/pull/12701 discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:07:20 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:07:20 +0000 Subject: [issue36752] test multiprocessing: test_rapid_restart() crash on AIX Message-ID: <1556543240.21.0.411629530832.issue36752@roundup.psfhosted.org> New submission from STINNER Victor : POWER6 AIX 3.x: https://buildbot.python.org/all/#/builders/161/builds/1050 ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_forkserver.WithManagerTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2872, in test_rapid_restart queue = manager.get_queue() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 737, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 620, in _create conn = self._Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 79] Connection refused ====================================================================== ERROR: test_remote (test.test_multiprocessing_forkserver.WithManagerTestRemoteManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2835, in test_remote manager2.connect() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 545, in connect conn = Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 508, in Client answer_challenge(c, authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 751, in answer_challenge message = connection.recv_bytes(256) # reject large message File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 216, in recv_bytes buf = self._recv_bytes(maxlength) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 414, in _recv_bytes buf = self._recv(4) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 379, in _recv chunk = read(handle, remaining) ConnectionResetError: [Errno 73] Connection reset by peer ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_forkserver.WithProcessesTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2872, in test_rapid_restart queue = manager.get_queue() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 737, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 620, in _create conn = self._Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 79] Connection refused ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_forkserver.WithThreadsTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2872, in test_rapid_restart queue = manager.get_queue() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 737, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 620, in _create conn = self._Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 79] Connection refused ---------------------------------------------------------------------- Ran 345 tests in 268.109s FAILED (errors=4, skipped=29) Warning -- files was modified by test_multiprocessing_forkserver Before: [] After: ['core'] test test_multiprocessing_forkserver failed ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_spawn.WithManagerTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2872, in test_rapid_restart queue = manager.get_queue() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 737, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 620, in _create conn = self._Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 79] Connection refused ====================================================================== ERROR: test_remote (test.test_multiprocessing_spawn.WithManagerTestRemoteManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2835, in test_remote manager2.connect() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 545, in connect conn = Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 508, in Client answer_challenge(c, authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 751, in answer_challenge message = connection.recv_bytes(256) # reject large message File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 216, in recv_bytes buf = self._recv_bytes(maxlength) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 414, in _recv_bytes buf = self._recv(4) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 379, in _recv chunk = read(handle, remaining) ConnectionResetError: [Errno 73] Connection reset by peer ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_spawn.WithProcessesTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2872, in test_rapid_restart queue = manager.get_queue() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 737, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 620, in _create conn = self._Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 79] Connection refused ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_spawn.WithThreadsTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/_test_multiprocessing.py", line 2872, in test_rapid_restart queue = manager.get_queue() File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 737, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/managers.py", line 620, in _create conn = self._Client(self._address, authkey=self._authkey) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 796, in XmlClient return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 502, in Client c = SocketClient(address) File "/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/multiprocessing/connection.py", line 629, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 79] Connection refused ---------------------------------------------------------------------- Ran 345 tests in 632.619s FAILED (errors=4, skipped=32) Warning -- files was modified by test_multiprocessing_spawn Before: [] After: ['core'] test test_multiprocessing_spawn failed ---------- components: Tests messages: 341076 nosy: vstinner priority: normal severity: normal status: open title: test multiprocessing: test_rapid_restart() crash on AIX versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:19:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:19:29 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556543969.26.0.189036265897.issue35952@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:20:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:20:29 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556544029.83.0.193534671732.issue35952@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5e09a9973b46cd6361a25877e0ca8dd0ab82d678 by Victor Stinner in branch '3.7': bpo-35952: Sync test.pythoninfo from master (GH-13009) https://github.com/python/cpython/commit/5e09a9973b46cd6361a25877e0ca8dd0ab82d678 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:20:40 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:20:40 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556544040.41.0.0569795617435.issue35952@roundup.psfhosted.org> STINNER Victor added the comment: New changeset be6cbfb7670c852ef8abf52b63989442b6942dbb by Victor Stinner in branch '2.7': bpo-35952: Sync test.pythoninfo from master (GH-13010) https://github.com/python/cpython/commit/be6cbfb7670c852ef8abf52b63989442b6942dbb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:21:29 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:21:29 +0000 Subject: [issue35952] test.pythoninfo prints a stack trace and exits with 1 when the compiler does not exist In-Reply-To: <1549746365.16.0.119204181787.issue35952@roundup.psfhosted.org> Message-ID: <1556544089.45.0.703671641283.issue35952@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:22:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:22:06 +0000 Subject: [issue36004] Add datetime.fromisocalendar In-Reply-To: <1550240916.35.0.451510247621.issue36004@roundup.psfhosted.org> Message-ID: <1556544126.27.0.682789903472.issue36004@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 88c093705615c50c47fdd9ab976803f73de7e308 by Victor Stinner (Paul Ganssle) in branch 'master': bpo-36004: Add date.fromisocalendar (GH-11888) https://github.com/python/cpython/commit/88c093705615c50c47fdd9ab976803f73de7e308 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:31:05 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 13:31:05 +0000 Subject: [issue36004] Add datetime.fromisocalendar In-Reply-To: <1550240916.35.0.451510247621.issue36004@roundup.psfhosted.org> Message-ID: <1556544665.15.0.830353945297.issue36004@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Paul, nice enhancement! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:40:38 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 13:40:38 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556545238.93.0.534318305984.issue36751@roundup.psfhosted.org> Steve Dower added the comment: Marking as a release blocker and adding RM. The 3.8 branch now contains breaking API changes to these functions that we have to resolve before the next release (or revert while deciding how to handle the change) - PR 12701 has been merged. ---------- keywords: +3.7regression nosy: +lukasz.langa, steve.dower priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:43:23 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 13:43:23 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556545403.29.0.688752741655.issue36751@roundup.psfhosted.org> Steve Dower added the comment: My bad, there were PR changes that GitHub didn't show me. As you were ---------- nosy: -lukasz.langa priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 09:43:42 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 13:43:42 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556545422.51.0.816430999481.issue36751@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: -steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:02:10 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 14:02:10 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556546530.03.0.598497801374.issue36751@roundup.psfhosted.org> Steve Dower added the comment: Nope, I was right the first time. The FullArgSpec tulle has changed indexes, and formatargspec has additional (undocumented) arguments. Since formatargspec is deprecated, it should probably just not change. The FullArgSpec tuple might have to become a concrete class implementation so that it can have positional-only args as a named attribute but not part of unpacking. As for where the new information *can* go, I suspect the Signature object is the only place. Though that has limitations, and for C APIs in particular much of my code only uses the more reliable getfullargspec. ---------- nosy: +lukasz.langa, steve.dower priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:37:55 2019 From: report at bugs.python.org (reimar) Date: Mon, 29 Apr 2019 14:37:55 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1556548675.57.0.349986067346.issue34814@roundup.psfhosted.org> reimar added the comment: > In short, RTLD_LOCAL is not supported. I am sorry, this is not a workable stance. This does not just affect loading libpython directly. It also affects dlopen of a library that links to a library ... that links to libpython. For a developer is impossible to know if some library via dozens of dependencies might ever bring in libpython. Thus your stance is essentially equivalent to "nobody must ever use RTLD_LOCAL". I find it hard to consider that an acceptable "solution". ---------- nosy: +reimar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:42:36 2019 From: report at bugs.python.org (reimar) Date: Mon, 29 Apr 2019 14:42:36 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556548956.17.0.637781365118.issue21536@roundup.psfhosted.org> reimar added the comment: As explained in Issue34814, this change not only breaks RTLD_LOCAL of libpython, but it breaks it in fact system-wide. It seems a bit much for Python to enforce a system-wide policy to not use RTLD_LOCAL just because of its own technical challenges, and thus I'd ask to reconsider the original change. ---------- nosy: +reimar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:44:31 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 14:44:31 +0000 Subject: [issue21536] extension built with a shared python cannot be loaded with a static python In-Reply-To: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za> Message-ID: <1556549071.75.0.992010661785.issue21536@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:46:28 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 29 Apr 2019 14:46:28 +0000 Subject: [issue36729] Delete unused text variable on tests In-Reply-To: <1556525419.16.0.967239413841.issue36729@roundup.psfhosted.org> Message-ID: Emmanuel Arias added the comment: Hello, Yes not problem. Tonight when I was just to make the MR, I see that the bugs was solved. Thanks Arias Emmanuel eamanu.com El lun., 29 de abr. de 2019 05:10, Serhiy Storchaka escribi?: > > Change by Serhiy Storchaka : > > > ---------- > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:46:44 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 14:46:44 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1556549204.07.0.912862128819.issue34814@roundup.psfhosted.org> STINNER Victor added the comment: > In short, RTLD_LOCAL is not supported. reimar: "I am sorry, this is not a workable stance. This does not just affect loading libpython directly. (...)" This issue is now closed, as bpo-21536. Would you mind to open a new issuse to clearly explain your own case? Please mention your platform. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:51:12 2019 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 29 Apr 2019 14:51:12 +0000 Subject: [issue36729] Delete unused text variable on tests In-Reply-To: Message-ID: Emmanuel Arias added the comment: Sorry for the noise I confused on my mail. Arias Emmanuel eamanu.com El lun., 29 de abr. de 2019 11:46, Emmanuel Arias escribi?: > > Emmanuel Arias added the comment: > > Hello, > > Yes not problem. Tonight when I was just to make the MR, I see that the > bugs was solved. > > Thanks > > Arias Emmanuel > eamanu.com > > El lun., 29 de abr. de 2019 05:10, Serhiy Storchaka < > report at bugs.python.org> > escribi?: > > > > > Change by Serhiy Storchaka : > > > > > > ---------- > > resolution: -> fixed > > stage: patch review -> resolved > > status: open -> closed > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:55:59 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 29 Apr 2019 14:55:59 +0000 Subject: [issue1613500] Write mode option for fileinput module. Message-ID: <1556549759.31.0.179296913653.issue1613500@roundup.psfhosted.org> Berker Peksag added the comment: New changeset be6dbfb43b89989ccc83fbc4c5234f50f44c47ad by Berker Peksag in branch 'master': bpo-1613500: Don't hardcode output file mode in fileinput.FileInput (GH-12986) https://github.com/python/cpython/commit/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 10:56:18 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 29 Apr 2019 14:56:18 +0000 Subject: [issue1613500] Write mode option for fileinput module. Message-ID: <1556549778.96.0.939406326851.issue1613500@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 11:05:44 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 29 Apr 2019 15:05:44 +0000 Subject: [issue34214] Pylint recusion stack overflow abort In-Reply-To: <1532463381.11.0.56676864532.issue34214@psf.upfronthosting.co.za> Message-ID: <1556550344.07.0.677317321073.issue34214@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +eric.smith, nanjekyejoannah, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 11:23:25 2019 From: report at bugs.python.org (=?utf-8?b?UmHDumwgTsO6w7FleiBkZSBBcmVuYXM=?=) Date: Mon, 29 Apr 2019 15:23:25 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556551405.74.0.641518454691.issue26493@roundup.psfhosted.org> Ra?l N??ez de Arenas added the comment: I'm sorry to say that this still happens in Python 3.7.0... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 11:31:35 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 15:31:35 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556551895.21.0.0148177019412.issue26493@roundup.psfhosted.org> Steve Dower added the comment: It still happens because nobody has proposed a patch to specially handle this one particular error code. The earlier messages explained why we can't do formatting on error messages. If this one is particularly common, then it's best for it to be handled in Python code at the point where it shows up and converted into something more readable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 11:36:09 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 15:36:09 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556552169.75.0.889189494879.issue36742@roundup.psfhosted.org> Steve Dower added the comment: Yes, it's due to that. I guess we need to do netloc.rpartition(':') like we currently do for '@' in _checknetloc. Promoting to release blocker and security issue to match the original issue. I can't get to this today, but I should be able to at the PyCon sprints next week if nobody else gets it sooner. ---------- keywords: +3.5regression, 3.6regression, 3.7regression nosy: +benjamin.peterson, larry, lukasz.langa, ned.deily priority: normal -> release blocker type: behavior -> security versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 11:52:25 2019 From: report at bugs.python.org (=?utf-8?b?UmHDumwgTsO6w7FleiBkZSBBcmVuYXM=?=) Date: Mon, 29 Apr 2019 15:52:25 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556553145.15.0.74791415433.issue26493@roundup.psfhosted.org> Ra?l N??ez de Arenas added the comment: Hi Steve :) I assumed that the issue was solved, that's why I warned, in case a patch was applied and it didn't work. When I did read "I suggest to only call reformat_strerror() when an user complains", I supposed a patch was ready O:) No big deal, I can deal with that particular error in my code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 11:53:50 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 15:53:50 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556553230.73.0.842810844767.issue26493@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 12:16:00 2019 From: report at bugs.python.org (reimar) Date: Mon, 29 Apr 2019 16:16:00 +0000 Subject: [issue36753] Python modules not linking to libpython causes issues for RTLD_LOCAL system-wide Message-ID: <1556554560.81.0.844742203447.issue36753@roundup.psfhosted.org> New submission from reimar : Most affected platforms: RedHat and Debian, but with the changes from issue21536 probably all Linux distributions will be affected. issue34814 and issue21536 and https://bugzilla.redhat.com/show_bug.cgi?id=1585201 make statements along the lines of "In short, RTLD_LOCAL is not supported." This might have been considered a reasonable stance because of the specific example opening libpython directly. However Python modules not linking to libpython also breaks things when libpython is loaded in the most indirect ways via dlopen. E.g. dlopen("libA.so", RTLD_LOCAL | RTLD_NOW) libA might have linked against libB, libB against libC and libC might optionally link against libpython. As a developer generally cannot really know if some library might ever pull in a most indirect reference to libpython, not supporting RTLD_LOCAL in Python essentially means RTLD_LOCAL can NEVER EVER be used safely. A test-case that will fail the import command when modules have not been linked against libpython is attached (demonstrating only one layer of indirection, but much more complex cases are of course possible). You will need to adjust the (include, lib) paths in test.sh for your Python version, it was written to demonstrate the issue against RedHat's modifications of Python 2.7 (to my knowledge, RedHat and Debian has been affected by this issue much longer than mainline Python). While dlmopen is an alternative with similar behaviour to RTLD_LOCAL on recent Linux versions for this case, it is not portable. ---------- components: Library (Lib) files: pytest.tar.gz messages: 341094 nosy: reimar priority: normal severity: normal status: open title: Python modules not linking to libpython causes issues for RTLD_LOCAL system-wide type: behavior Added file: https://bugs.python.org/file48291/pytest.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 12:16:50 2019 From: report at bugs.python.org (reimar) Date: Mon, 29 Apr 2019 16:16:50 +0000 Subject: [issue34814] makesetup: must link C extensions to libpython when compiled in shared mode In-Reply-To: <1537980934.49.0.545547206417.issue34814@psf.upfronthosting.co.za> Message-ID: <1556554610.81.0.844415545442.issue34814@roundup.psfhosted.org> reimar added the comment: Sorry for my laziness. I opened Issue36753. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 12:30:59 2019 From: report at bugs.python.org (Matthias Klose) Date: Mon, 29 Apr 2019 16:30:59 +0000 Subject: [issue36753] Python modules not linking to libpython causes issues for RTLD_LOCAL system-wide In-Reply-To: <1556554560.81.0.844742203447.issue36753@roundup.psfhosted.org> Message-ID: <1556555459.02.0.694486119315.issue36753@roundup.psfhosted.org> Matthias Klose added the comment: why is this an issue on Debian? Debian is already not linking with libpython. ---------- nosy: +doko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 12:33:42 2019 From: report at bugs.python.org (Eric N. Vander Weele) Date: Mon, 29 Apr 2019 16:33:42 +0000 Subject: [issue36753] Python modules not linking to libpython causes issues for RTLD_LOCAL system-wide In-Reply-To: <1556554560.81.0.844742203447.issue36753@roundup.psfhosted.org> Message-ID: <1556555622.31.0.395330037701.issue36753@roundup.psfhosted.org> Change by Eric N. Vander Weele : ---------- nosy: +ericvw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 12:56:46 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 16:56:46 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556557006.72.0.515580642685.issue36707@roundup.psfhosted.org> Ned Deily added the comment: This change has an impact on downstream packagers and users of Python 3.8 because the SOABI flag values are also used to construct a number of file names and directories names in an Unix or macOS framework install besides the extension module (*.so) file names. Suggest comparing the directory/file names installed to an alternate prefix (./configure --prefix=/tmp/3x ; make install) in 3.7 versus master with this PR. Also suggest reading PEP 3149, which introduced the ABI-specific file names, and the various issues in the bug tracker that reference it. At the very least, these changes need to be documented in the What's New for 3.8. But the impact of the change should probably also be discussed with at least some of the large distributors. (The change already inadvertently broke the macOS installer build - fixing.) ---------- nosy: +ned.deily priority: normal -> deferred blocker resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 12:58:39 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 16:58:39 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556557119.88.0.567906957548.issue36707@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:02:29 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 29 Apr 2019 17:02:29 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556557349.65.0.26841674651.issue36751@roundup.psfhosted.org> Brett Cannon added the comment: Steve's right that we can't change the indexes on those functions for pre-existing values, so appending to the end is the only real option in that case. I still think they should both be deprecated due to how limiting their APIs are. Obviously signature() can be updated cleanly. ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:03:43 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 17:03:43 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556557423.08.0.841789248726.issue36707@roundup.psfhosted.org> STINNER Victor added the comment: About the PEP, I asked Barry to review the change and he approved it. About the doc, I didn't know that anyone rely on the exact filename. I documented all changes in a top-level section of the What's New in Python 3.8: https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build Sorry for thr annoyance. I didn't know that the macOS installer rely on these filenames. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:07:21 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 17:07:21 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556557641.06.0.319445829524.issue36707@roundup.psfhosted.org> Ned Deily added the comment: No, you didn't document all the changed file names, See, for instance, /usr/bin/python3* for a start :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:10:08 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 17:10:08 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556557808.27.0.716700133575.issue36751@roundup.psfhosted.org> STINNER Victor added the comment: IMHO getargs(), getargspec(), getfullargspec() should be deprecated in favor of signature() which is future-proof. But Nick Coghlan undeprecated these functions in 2017 https://bugs.python.org/issue20438 whereas these were deprecated since 2015. I didn't understand the subtle issues. That's why I asked Pablo to open a separated issue, to get Nick and others involved to get the context. My proposal was to raise an exception if the input function has positonal arguments. There is good way to fix these legacy functions, their design cannot be extended, whereas signature() is fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:32:39 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 17:32:39 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556559159.26.0.919793271934.issue36751@roundup.psfhosted.org> Steve Dower added the comment: > My proposal was to raise an exception if the input function has positonal arguments Counter-proposal - just report them as regular position-or-name arguments. Users of inspect are most likely to be IDEs or editors getting information to present to users. And in my experience, most just ignore all exceptions because bugs cause some function objects to raise errors when trying to inspect them. Which means a new exception will just result in a worse experience for users and no indication of what's wrong. On the other hand, if there is no change made, they'll just report a normal looking signature until they migrate to using updated Signature objects. Anyone using current Signature objects should similarly get the argument count right, even if they totally ignore the positional-only count. Since one of the arguments for supporting positional-only parameters is that they're for parameters that you'd never consider passing by name, but these tools still need to show a name, very few people should ever be tripped up by them being misreported. And when they do they'll be tripped up very quickly. Basically, this is not a scenario that *requires* existing users to be broken. So we should avoid breaking them at all costs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:34:55 2019 From: report at bugs.python.org (Berker Peksag) Date: Mon, 29 Apr 2019 17:34:55 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556559295.73.0.0682170220559.issue26493@roundup.psfhosted.org> Berker Peksag added the comment: FYI, in msg261315, Eryk has mentioned about possible improvement of the exception message on POSIX. The filename has been added to the exception message in 8621bb5d93239316f97281826461b85072ff6db7: >>> import subprocess, os >>> os.access('log.txt', os.X_OK) True >>> subprocess.call(['./log.txt']) Traceback (most recent call last): File "", line 1, in File "/Users/berkerpeksag/projects/cpython/Lib/subprocess.py", line 325, in call with Popen(*popenargs, **kwargs) as p: File "/Users/berkerpeksag/projects/cpython/Lib/subprocess.py", line 830, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/Users/berkerpeksag/projects/cpython/Lib/subprocess.py", line 1648, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: './log.txt' ---------- nosy: +berker.peksag stage: -> needs patch versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:45:33 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 29 Apr 2019 17:45:33 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556559933.62.0.353333387576.issue36751@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:49:37 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 29 Apr 2019 17:49:37 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556560177.49.0.142210466694.issue36751@roundup.psfhosted.org> Brett Cannon added the comment: If I remember correctly the un-deprecation was because 2/3 code could only use getfullargspec() to get all relevant details. Since we're so close to being done w/ Python 2 I think this might be the last change to make to them, document their deprecation, tack this info on to the end of the tuple, and then start raising DeprecationWarning in 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:50:37 2019 From: report at bugs.python.org (reimar) Date: Mon, 29 Apr 2019 17:50:37 +0000 Subject: [issue36753] Python modules not linking to libpython causes issues for RTLD_LOCAL system-wide In-Reply-To: <1556554560.81.0.844742203447.issue36753@roundup.psfhosted.org> Message-ID: <1556560237.55.0.813553124718.issue36753@roundup.psfhosted.org> reimar added the comment: The modules not linking against libpython CAUSES this issue, thus Debian being affected even for old Python versions before issue21536. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:51:48 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 29 Apr 2019 17:51:48 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1556560308.91.0.698288585938.issue18748@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The ValueError warnings in test_urllib noted in msg340059 feels like an issue with the test where FakeSocket calls close by itself once it's internal io_refs counter is 0 and during destructor again close is called on an already closed object causing the ValueError. * The test uses fakehttp() creating FakeSocket starting with io_refs as 1 [1] * During the test in urlopen, sock.makefile() (io_refs += 1) is called increasing the io_refs to be 2. * HTTPConnection.close calls sock.close (fakesocket.close) [3] calling io_refs -= 1 and to fakesocket.io_ref to be 1. * This test uses raises status 302 with http_error_302 which calls self.redirect_internal where self.close is again called causing fp.io_refs == 0 and subsequently calling io.BytesIO.close(self) to close the object. [4] * During the end of the test destructor is called on the above closed fakesocket object and trying to flush on a closed object causes the ValueError warnings . Maybe a check could be added during flush to make sure the object is not closed by testing for self.closed but I am not sure if closed attribute is guaranteed to be present. Removing the manual call to close in fakesocket could help since the destructor should be taking care of it and I could see no test failures or warnings removing the close as io_refs gets to 0. [1] https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/test/test_urllib.py#L61 [2] https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/test/test_urllib.py#L67 [3] https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/http/client.py#L919 [4] https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/urllib/request.py#L2145 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 13:53:25 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 17:53:25 +0000 Subject: [issue36754] Remove smart quotes in pydoc text Message-ID: <1556560405.97.0.464374588222.issue36754@roundup.psfhosted.org> New submission from Steve Dower : Not all console configurations can correctly render smart quotes in help() text. See the "?" in "superclass's" below. When building for pydoc-topics, it would be ideal to disable smart quotes. (I'm assuming from issue31793 that this can be done in configuration, though I'm not entirely sure how - it's not clear to me from those PRs) --- >>> help("BASICMETHODS") Basic customization ******************* object.__new__(cls[, ...]) ... Typical implementations create a new instance of the class by invoking the superclass?s "__new__()" method using "super().__new__(cls[, ...])" with appropriate arguments and then modifying the newly-created instance as necessary before returning it. ---------- assignee: docs at python components: Documentation messages: 341107 nosy: docs at python, steve.dower priority: normal severity: normal stage: needs patch status: open title: Remove smart quotes in pydoc text type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 14:03:12 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 29 Apr 2019 18:03:12 +0000 Subject: [issue28608] Support creating hardlink using `pathlib` In-Reply-To: <1543384022.76.0.788709270274.issue28608@psf.upfronthosting.co.za> Message-ID: <1556560992.36.0.31496728061.issue28608@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Closing this as a duplicate of issue26978 which has an open PR with comments from @pitrou. Thanks ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Implement pathlib.Path.link (Using os.link) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 14:14:43 2019 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 29 Apr 2019 18:14:43 +0000 Subject: [issue36754] Remove smart quotes in pydoc text In-Reply-To: <1556560405.97.0.464374588222.issue36754@roundup.psfhosted.org> Message-ID: <20190429181436.GF12773@ando.pearwood.info> Steven D'Aprano added the comment: > Not all console configurations can correctly render smart quotes in > help() text. See the "?" in "superclass's" below. That suggests to me a mismatch in encodings, rather than inability to render curly quotes at all. It's 2019 and surely we don't have to target ASCII as the lowest common denominator any more? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 14:29:30 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 18:29:30 +0000 Subject: [issue36754] Remove smart quotes in pydoc text In-Reply-To: <1556560405.97.0.464374588222.issue36754@roundup.psfhosted.org> Message-ID: <1556562570.08.0.752769240228.issue36754@roundup.psfhosted.org> Steve Dower added the comment: > mismatch in encodings Also likely. I haven't looked into how pydoc does its rendering, but certainly Python 3.7 on Windows should be able to print regular Unicode. Perhaps it's not going through stdout for some reason? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 14:48:20 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 18:48:20 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556563700.06.0.771058799594.issue34602@roundup.psfhosted.org> Change by Ned Deily : ---------- keywords: +patch pull_requests: +12932 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 14:48:20 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 18:48:20 +0000 Subject: [issue18075] Infinite recursion tests triggering a segfault In-Reply-To: <1369702928.42.0.612737848185.issue18075@psf.upfronthosting.co.za> Message-ID: <1556563700.15.0.195014185461.issue18075@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +12933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:07:44 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 19:07:44 +0000 Subject: [issue18075] Infinite recursion tests triggering a segfault In-Reply-To: <1369702928.42.0.612737848185.issue18075@psf.upfronthosting.co.za> Message-ID: <1556564864.19.0.135120064478.issue18075@roundup.psfhosted.org> Ned Deily added the comment: New changeset 883dfc668f9730b00928730035b5dbd24b9da2a0 by Ned Deily in branch 'master': bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) https://github.com/python/cpython/commit/883dfc668f9730b00928730035b5dbd24b9da2a0 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:07:44 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 19:07:44 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556564864.28.0.275362154308.issue34602@roundup.psfhosted.org> Ned Deily added the comment: New changeset 883dfc668f9730b00928730035b5dbd24b9da2a0 by Ned Deily in branch 'master': bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) https://github.com/python/cpython/commit/883dfc668f9730b00928730035b5dbd24b9da2a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:08:00 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 29 Apr 2019 19:08:00 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556564880.06.0.644291437742.issue34602@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:08:00 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 29 Apr 2019 19:08:00 +0000 Subject: [issue18075] Infinite recursion tests triggering a segfault In-Reply-To: <1369702928.42.0.612737848185.issue18075@psf.upfronthosting.co.za> Message-ID: <1556564880.13.0.1612223868.issue18075@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:27:39 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 29 Apr 2019 19:27:39 +0000 Subject: [issue18075] Infinite recursion tests triggering a segfault In-Reply-To: <1369702928.42.0.612737848185.issue18075@psf.upfronthosting.co.za> Message-ID: <1556566059.04.0.0975472223886.issue18075@roundup.psfhosted.org> miss-islington added the comment: New changeset 52a5b71063af68c42b048095c4e555e93257f151 by Miss Islington (bot) in branch '3.7': bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) https://github.com/python/cpython/commit/52a5b71063af68c42b048095c4e555e93257f151 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:27:39 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 29 Apr 2019 19:27:39 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556566059.19.0.598964536343.issue34602@roundup.psfhosted.org> miss-islington added the comment: New changeset 52a5b71063af68c42b048095c4e555e93257f151 by Miss Islington (bot) in branch '3.7': bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) https://github.com/python/cpython/commit/52a5b71063af68c42b048095c4e555e93257f151 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:32:07 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 29 Apr 2019 19:32:07 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556566327.24.0.812911914266.issue34602@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:32:07 2019 From: report at bugs.python.org (miss-islington) Date: Mon, 29 Apr 2019 19:32:07 +0000 Subject: [issue18075] Infinite recursion tests triggering a segfault In-Reply-To: <1369702928.42.0.612737848185.issue18075@psf.upfronthosting.co.za> Message-ID: <1556566327.32.0.7949877477.issue18075@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12937 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:43:13 2019 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 29 Apr 2019 19:43:13 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556566993.79.0.611971249413.issue36751@roundup.psfhosted.org> ?ukasz Langa added the comment: I'm with Steve on this one. Report positional-only args as regular arguments in the old functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:53:25 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 19:53:25 +0000 Subject: [issue36432] Running python test suite fails on macOS 10.14.4 with resource.RLIMIT_STACK error In-Reply-To: <1553584151.61.0.380593331105.issue36432@roundup.psfhosted.org> Message-ID: <1556567605.03.0.923320394869.issue36432@roundup.psfhosted.org> Ned Deily added the comment: Thanks, Inada-san, for the pointer. Closing this as a duplicate of Issue34602 ---------- resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> python3 resource.setrlimit strange behaviour under macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:57:20 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 19:57:20 +0000 Subject: [issue18075] Infinite recursion tests triggering a segfault In-Reply-To: <1369702928.42.0.612737848185.issue18075@psf.upfronthosting.co.za> Message-ID: <1556567840.45.0.206097824319.issue18075@roundup.psfhosted.org> Ned Deily added the comment: New changeset fbe2a1394bf52f5a4455681e1b1f705a31559585 by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) (GH-13014) https://github.com/python/cpython/commit/fbe2a1394bf52f5a4455681e1b1f705a31559585 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:57:20 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 19:57:20 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556567840.53.0.734926531803.issue34602@roundup.psfhosted.org> Ned Deily added the comment: New changeset fbe2a1394bf52f5a4455681e1b1f705a31559585 by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011) (GH-13014) https://github.com/python/cpython/commit/fbe2a1394bf52f5a4455681e1b1f705a31559585 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 15:59:08 2019 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 29 Apr 2019 19:59:08 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1556567948.25.0.304488676261.issue36540@roundup.psfhosted.org> ?ukasz Langa added the comment: +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 16:12:07 2019 From: report at bugs.python.org (Ned Deily) Date: Mon, 29 Apr 2019 20:12:07 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1556568727.27.0.0602710214883.issue34602@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the analyses everyone! Also see the discussion in duplicate Issue36432. I was never able to reproduce the failure on earlier versions of macOS but then it seemed to become a hard failure with the release of 10.14.4. I haven't gone back and tried running the tests on all supported older versions with this reversion in place but those I have did not exhibit any new failures. So we should keep an eye open for reports of segfaults running tests as originally reported in Issue18075. But better that then not being able to run any tests. "Fixed" in 3.8.0a4, 3.7.4, and 3.6.9 (to allow tests to be run on macOS) by reverting the change for Issue18075. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 17:26:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Mon, 29 Apr 2019 21:26:15 +0000 Subject: [issue36707] The "m" ABI flag of SOABI for pymalloc is no longer needed In-Reply-To: <1556065645.57.0.820338293941.issue36707@roundup.psfhosted.org> Message-ID: <1556573175.69.0.755130573828.issue36707@roundup.psfhosted.org> STINNER Victor added the comment: > No, you didn't document all the changed file names, See, for instance, /usr/bin/python3* for a start :) Oh, I see. I was thinking at something else. First I proposed to drop the "d" from the SOABI for debug build, but then I changed my mind. So yeah, I didn't change the SOABI for: https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build And this change should be documented elsewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 17:29:50 2019 From: report at bugs.python.org (Lisa Roach) Date: Mon, 29 Apr 2019 21:29:50 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1556573390.16.0.889036733951.issue36674@roundup.psfhosted.org> Lisa Roach added the comment: +1, I think tests should run the same way in debug() and run(), the difference being limited only to how the result is handled. Marking a test as skipped should still be skipped while debugging, else it pollutes the results with tests that will not run with run(). ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 17:30:56 2019 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 29 Apr 2019 21:30:56 +0000 Subject: [issue26835] Add file-sealing ops to fcntl In-Reply-To: <1461505999.3.0.387096384665.issue26835@psf.upfronthosting.co.za> Message-ID: <1556573456.84.0.73954179291.issue26835@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- keywords: +patch pull_requests: +12938 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 17:46:22 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 21:46:22 +0000 Subject: [issue36632] test_multiprocessing_forkserver: test_rapid_restart() leaked a dangling process on AMD64 FreeBSD 10-STABLE Non-Debug 3.x In-Reply-To: <1555326100.12.0.0433329524894.issue36632@roundup.psfhosted.org> Message-ID: <1556574382.16.0.582843061002.issue36632@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: May be related to this failure: https://buildbot.python.org/all/#/builders/58/builds/2292 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 18:31:52 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 22:31:52 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556577112.47.0.308818544932.issue36751@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +12939 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 18:35:17 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 29 Apr 2019 22:35:17 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556577317.83.0.198115414197.issue36751@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 13016 adds the positional-only arguments together with the regular arguments as suggested by Steve and ?ukasz and deprecates getfullargspec() in favour of inspect.signature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 18:36:03 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 22:36:03 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556577363.93.0.495051450155.issue36742@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +12940 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 18:39:13 2019 From: report at bugs.python.org (Steve Dower) Date: Mon, 29 Apr 2019 22:39:13 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556577553.67.0.996252870357.issue36742@roundup.psfhosted.org> Steve Dower added the comment: I found the time to get the first patch. Hopefully backports to 3.6 and 3.7 are easy, but I think 2.7 will take manual steps. Chihiro Ito - if you have other test scenarios, it would be great if you could try them out with the fix in PR 13017. It should be easy enough to copy into your installed Python. ---------- assignee: -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 19:23:31 2019 From: report at bugs.python.org (Brett Cannon) Date: Mon, 29 Apr 2019 23:23:31 +0000 Subject: [issue36232] Improve error message on dbm.open In-Reply-To: <1552039612.76.0.91124690084.issue36232@roundup.psfhosted.org> Message-ID: <1556580211.65.0.60489334418.issue36232@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 81c5a905951aaf46f292eb459c32649c0b74ef61 by Brett Cannon (Marco Rougeth) in branch 'master': bpo-36232: Improve error message on dbm.open() when the db doesn't exist (GH-12060) https://github.com/python/cpython/commit/81c5a905951aaf46f292eb459c32649c0b74ef61 ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 20:45:01 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 00:45:01 +0000 Subject: [issue36755] [2.7] test_httplib leaked [8, 8, 8] references with OpenSSL 1.1.1 Message-ID: <1556585101.72.0.886455290046.issue36755@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Fedora Rawhide Refleaks 2.7 buildbot: https://buildbot.python.org/all/#/builders/190/builds/18 test_httplib leaked [8, 8, 8] references, sum=24 When I run the test on my Fedora 29 ("OpenSSL 1.1.1b FIPS 26 Feb 2019"), I can reproduce leak: $ ./python -m test -R 3:3 -m test.test_httplib.HTTPSTest.test_local_bad_hostname test_httplib ... test_httplib leaked [8, 8, 8] references, sum=24 ... My bet is that the issue is related to OpenSSL 1.1.1 which changes how a TLS connection is terminated. Running the test in verbose mode logs a traceback: $ ./python -m test -v test_httplib ... test_local_bad_hostname (test.test_httplib.HTTPSTest) ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 48554) Traceback (most recent call last): File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 293, in _handle_request_noblock self.process_request(request, client_address) File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 321, in process_request self.finish_request(request, client_address) File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 655, in __init__ self.handle() File "/home/vstinner/prog/python/2.7/Lib/BaseHTTPServer.py", line 340, in handle self.handle_one_request() File "/home/vstinner/prog/python/2.7/Lib/BaseHTTPServer.py", line 310, in handle_one_request self.raw_requestline = self.rfile.readline(65537) File "/home/vstinner/prog/python/2.7/Lib/socket.py", line 480, in readline data = self._sock.recv(self._rbufsize) File "/home/vstinner/prog/python/2.7/Lib/ssl.py", line 754, in recv return self.read(buflen) File "/home/vstinner/prog/python/2.7/Lib/ssl.py", line 641, in read v = self._sslobj.read(len) error: [Errno 104] Connection reset by peer ---------------------------------------- server (('127.0.0.1', 44923):44923 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)): [30/Apr/2019 02:40:01] code 404, message File not found server (('127.0.0.1', 44923):44923 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)): [30/Apr/2019 02:40:01] "GET /nonexistent HTTP/1.1" 404 - stopping HTTPS server joining HTTPS thread ok Without -v, the test fails with: vstinner at apu$ ./python -m test test_httplib Run tests sequentially 0:00:00 load avg: 0.63 [1/1] test_httplib Traceback (most recent call last): File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 293, in _handle_request_noblock self.process_request(request, client_address) File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 321, in process_request self.finish_request(request, client_address) File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/vstinner/prog/python/2.7/Lib/SocketServer.py", line 655, in __init__ self.handle() File "/home/vstinner/prog/python/2.7/Lib/BaseHTTPServer.py", line 340, in handle self.handle_one_request() File "/home/vstinner/prog/python/2.7/Lib/BaseHTTPServer.py", line 310, in handle_one_request self.raw_requestline = self.rfile.readline(65537) File "/home/vstinner/prog/python/2.7/Lib/socket.py", line 480, in readline data = self._sock.recv(self._rbufsize) File "/home/vstinner/prog/python/2.7/Lib/ssl.py", line 754, in recv return self.read(buflen) File "/home/vstinner/prog/python/2.7/Lib/ssl.py", line 641, in read v = self._sslobj.read(len) error: [Errno 104] Connection reset by peer test test_httplib produced unexpected output: ********************************************************************** ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 56044) ---------------------------------------- ********************************************************************** == Tests result: FAILURE == 1 test failed: test_httplib Total duration: 281 ms Tests result: FAILURE My attempt to fix the warning: diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py index 3df3323a97..8fe29e9d3e 100644 --- a/Lib/BaseHTTPServer.py +++ b/Lib/BaseHTTPServer.py @@ -332,6 +332,12 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): self.log_error("Request timed out: %r", e) self.close_connection = 1 return + except socket.error as exc: + # Using ssl and OpenSSL 1.1.1, sometimes readline() can fail + # with error(104, 'Connection reset by peer') + self.close_connection = 1 + exc = None + return def handle(self): """Handle multiple requests if necessary.""" ---------- components: Tests messages: 341127 nosy: vstinner priority: normal severity: normal status: open title: [2.7] test_httplib leaked [8, 8, 8] references with OpenSSL 1.1.1 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 21:01:16 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 30 Apr 2019 01:01:16 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556586076.63.0.446775912521.issue36751@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d5d2b4546939b98244708e5bb0cfccd55b99d244 by Pablo Galindo in branch 'master': bpo-36751: Deprecate getfullargspec and report positional-only args as regular args (GH-13016) https://github.com/python/cpython/commit/d5d2b4546939b98244708e5bb0cfccd55b99d244 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 21:02:30 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 30 Apr 2019 01:02:30 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556586150.09.0.891985700779.issue36751@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 13016 is fixed, and I will remove the release blocker, but I will leave it open for now until we can check if there is consensus on the status and future of the inspect module after PEP 570 :) ---------- priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 21:02:48 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 30 Apr 2019 01:02:48 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556586168.32.0.0619879024853.issue36751@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 13016 is merged, and I will remove the release blocker, but I will leave it open for now until we can check if there is consensus on the status and future of the inspect module after PEP 570 :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 21:02:54 2019 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 30 Apr 2019 01:02:54 +0000 Subject: [issue36751] Changes in the inspect module for PEP 570 In-Reply-To: <1556539997.22.0.720636636419.issue36751@roundup.psfhosted.org> Message-ID: <1556586174.76.0.116628706353.issue36751@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg341129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 21:44:43 2019 From: report at bugs.python.org (Michal Gregorczyk) Date: Tue, 30 Apr 2019 01:44:43 +0000 Subject: [issue36735] minimize disk size of cross-compiled python3.6 In-Reply-To: <1556304606.39.0.95403682645.issue36735@roundup.psfhosted.org> Message-ID: <1556588683.64.0.940537858411.issue36735@roundup.psfhosted.org> Michal Gregorczyk added the comment: Thank you. I'm closing and will ask on python-list as suggested ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 22:20:10 2019 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 30 Apr 2019 02:20:10 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556590810.84.0.00918914569405.issue35329@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset ee0309f3d83ab9ffa02542bcf45ece84f4fb265e by Benjamin Peterson (Utkarsh Gupta) in branch 'master': closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008) https://github.com/python/cpython/commit/ee0309f3d83ab9ffa02542bcf45ece84f4fb265e ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 22:20:24 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 02:20:24 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556590824.41.0.730782840122.issue35329@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 22:20:33 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 02:20:33 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556590833.33.0.695066448164.issue35329@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 22:25:44 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 02:25:44 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556591144.23.0.904788849508.issue35329@roundup.psfhosted.org> miss-islington added the comment: New changeset 3e5c4a7c804c3ad76a558e5463655c329aee6437 by Miss Islington (bot) in branch '2.7': closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008) https://github.com/python/cpython/commit/3e5c4a7c804c3ad76a558e5463655c329aee6437 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 29 22:26:03 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 02:26:03 +0000 Subject: [issue35329] Documentation - capitalization issue In-Reply-To: <1543337036.72.0.788709270274.issue35329@psf.upfronthosting.co.za> Message-ID: <1556591163.14.0.319140695106.issue35329@roundup.psfhosted.org> miss-islington added the comment: New changeset 4b5340bb634be2ee2a40242cdf4e3f7a0b6c757a by Miss Islington (bot) in branch '3.7': closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008) https://github.com/python/cpython/commit/4b5340bb634be2ee2a40242cdf4e3f7a0b6c757a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 00:15:51 2019 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 30 Apr 2019 04:15:51 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1556597751.23.0.205397717401.issue36674@roundup.psfhosted.org> Terry J. Reedy added the comment: 1. NO SKIP utest.py with debug prints added and @skipIf initially commented out. --- from unittest import TestCase, skipIf #@skipIf(True, "Skip Testing") class Tests(TestCase): def test_skip(self): "this test will fail - if not skipped" print('asserting') self.assertEqual(0, 1) print(Tests("test_skip").run()) print(Tests("test_skip").debug()) --- test_skip is run twice, with the output difference being as documented. asserting asserting Traceback (most recent call last): ... AssertionError: 0 != 1 2. SKIPTEST Adding "self.skipTest('why')" either in a new setUp() or at the top of skip_test() and adding another print print(Tests("test_skip").run().skipped) results in the output I expect from the doc. [(<__main__.Tests testMethod=test_skip>, 'why')] Traceback (most recent call last): ... unittest.case.SkipTest: why 3. SKIPIF CLASS Uncommenting @skipIf (the OP's case) instead results in None asserting Traceback ... AssertionError: 0 != 1 Since .run does not run the test, I agree that debug() running the test and raising AssertionError is a bug. The test should not be run. In my original comments, I expected SkipTest, as in cases 2 above and 4 below. I have not yet checked the current tests. 4. SKIPIF FUNC Moving the skipIf decorator to test_skip results in None Traceback (most recent call last): .. unittest.case.SkipTest: Skip Testing I don't know why run() returns None for skipIf cases instead of returning a TestResult with non-empty skipped, as it does for skipTest, or if the None is a separate bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 01:59:32 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 30 Apr 2019 05:59:32 +0000 Subject: [issue36750] test_socket leaks file descriptors on macOS In-Reply-To: <1556526404.64.0.613873773496.issue36750@roundup.psfhosted.org> Message-ID: <1556603972.78.0.233813064563.issue36750@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The test failure is reproducible on the PR 12271 merging master branch on Ubuntu with -R 3:3 test_socket. Sorry, I tried it initially on master thinking it was a master branch problem. I don't see C related code in the PR. There was a merge commit [0] after which the failure is consistently reproducible. I tried reverting parts of the PR to narrow down the failure and happened to come across the below statement in the diff where the test object and elapsed test for time are stored to be printed later. Commenting out the call makes tests pass for test_socket and much more baffling is that changing the code to use list instead of tuple causes the error to go away. Also I tried changing append to use extend or just to append test object instead of a tuple of test object and elapsed time which all pass. Instead of using test object in tuple just using (object(), elapsed) as a tuple also causes failure. I guess there is something with tuples here but it doesn't make much sense. On trying to bisect the merge commit I have narrowed down the below commits where the PR passes with tuple itself and then fails. In between the success and failure commit there were some changes made to hunterleaks and socket.create_server utility was added. f66e336f45 (success) 58721a9030 (success) 2b00db68554422ec37faba2a80179a0172df6349 (fails) # Sample failure on PR's HEAD on Ubuntu ?> ~/cpython on pr_12271 ./python -m test --fail-env-changed -R 3:3 test_socket 05:45:52 Run tests sequentially 0:00:00 load avg: 0.22 [1/1] test_socket beginning 6 repetitions 123456 Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) Dangling thread: Dangling thread: Dangling thread: Dangling thread: Dangling thread: <_MainThread(MainThread, started 140152731227904)> ...... test_socket failed (env changed) in 3 min 6 sec == Tests result: ENV CHANGED == 1 test altered the execution environment: test_socket Total duration: 3 min 6 sec Tests result: ENV CHANGED The below patch on the PR to use list causes the tests to pass but I am highly confused over how changing to tuple to list fixes this and this might potentially be hiding a bug. $ git diff diff --git a/Lib/unittest/result.py b/Lib/unittest/result.py index 273ca3beef..b8fd714679 100644 --- a/Lib/unittest/result.py +++ b/Lib/unittest/result.py @@ -160,7 +160,7 @@ class TestResult(object): def addDuration(self, test, elapsed): """Called when a test finished to run, regardless of its outcome.""" - self.collectedDurations.append((test, elapsed)) + self.collectedDurations.append([test, elapsed]) def wasSuccessful(self): """Tells whether or not this result was a success.""" [0] https://github.com/python/cpython/commit/3c4af91c1e7c02561efa752885011ff642725bd8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 02:07:00 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 30 Apr 2019 06:07:00 +0000 Subject: [issue36018] Add a Normal Distribution class to the statistics module In-Reply-To: <1550448059.37.0.914986932061.issue36018@roundup.psfhosted.org> Message-ID: <1556604420.45.0.554199380108.issue36018@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +12943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 02:47:37 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 30 Apr 2019 06:47:37 +0000 Subject: [issue36018] Add a Normal Distribution class to the statistics module In-Reply-To: <1550448059.37.0.914986932061.issue36018@roundup.psfhosted.org> Message-ID: <1556606857.07.0.879810967152.issue36018@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset b0a2c0fa83f9b79616ccf451687096542de1e6f8 by Raymond Hettinger in branch 'master': bpo-36018: Test idempotence. Test two methods against one-another. (GH-13021) https://github.com/python/cpython/commit/b0a2c0fa83f9b79616ccf451687096542de1e6f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 03:54:50 2019 From: report at bugs.python.org (Inada Naoki) Date: Tue, 30 Apr 2019 07:54:50 +0000 Subject: [issue25430] speed up ipaddress __contain__ method In-Reply-To: <1445083038.14.0.911555841878.issue25430@psf.upfronthosting.co.za> Message-ID: <1556610890.8.0.802045378643.issue25430@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 3bbcc92577f8e616bc94c679040043bacd00ebf1 by Inada Naoki (gescheit) in branch 'master': bpo-25430: improve performance of IPNetwork.__contains__ (GH-1785) https://github.com/python/cpython/commit/3bbcc92577f8e616bc94c679040043bacd00ebf1 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 05:04:34 2019 From: report at bugs.python.org (Eduardo Suarez-Santana) Date: Tue, 30 Apr 2019 09:04:34 +0000 Subject: [issue32223] distutils doesn't correctly read UTF-8 content from config files In-Reply-To: <1512492386.04.0.213398074469.issue32223@psf.upfronthosting.co.za> Message-ID: <1556615074.89.0.677413349451.issue32223@roundup.psfhosted.org> Eduardo Suarez-Santana added the comment: In my opinion, 'setup.cfg' is setuptools stuff and not part of python project. Anyway I think it is a good idea to read it as UTF-8. Setuptools seems to be defaulting to UTF-8: https://github.com/pypa/setuptools/pull/1735 ---------- nosy: +esuarezsantana _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 05:09:45 2019 From: report at bugs.python.org (Wolfram Kraus) Date: Tue, 30 Apr 2019 09:09:45 +0000 Subject: [issue36756] createcommand memory leak Message-ID: <1556615385.08.0.753953745903.issue36756@roundup.psfhosted.org> New submission from Wolfram Kraus : When using tk.createcommand you get a memory leak when you don't explicitly call tk.deletecommand to remove this command. See attached file: __del__ never get's called due to the memory leak and because of that calling tk.deletecommand inside __del__ has no effect. If you remove the tk.createcommand everything works fine. ---------- components: Tkinter files: tclmem_bug.py messages: 341140 nosy: WKraus priority: normal severity: normal status: open title: createcommand memory leak type: resource usage versions: Python 2.7, Python 3.7 Added file: https://bugs.python.org/file48292/tclmem_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 05:19:48 2019 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Cabessa?=) Date: Tue, 30 Apr 2019 09:19:48 +0000 Subject: [issue36757] uuid constructor accept invalid strings (extra dash) Message-ID: <1556615988.91.0.308330120393.issue36757@roundup.psfhosted.org> New submission from C?dric Cabessa : UUID constructor accept string with too many dashes or keyword like urn: / uuid: For eg, this code do not raise ``` >>> import uuid >>> uuid.UUID('0be--468urn:urn:urn:urn:54-4bf9-41----------d4-9697-41d735uuid:4fbe85uuid:') UUID('0be46854-4bf9-41d4-9697-41d7354fbe85') ``` For the context, we use a validator based on `uuid.UUID` for an API. Some customer send string with a UUID followed by extra `-`, the validator let it pass but the sql connector raise an exception We workaround this in our validator, but UUID constructor should not accept string like the one in exemple ---------- components: Library (Lib) messages: 341141 nosy: C?dric Cabessa priority: normal severity: normal status: open title: uuid constructor accept invalid strings (extra dash) versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 05:24:31 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 30 Apr 2019 09:24:31 +0000 Subject: [issue36756] tkinter tk.createcommand memory leak In-Reply-To: <1556615385.08.0.753953745903.issue36756@roundup.psfhosted.org> Message-ID: <1556616271.35.0.166698887974.issue36756@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gpolo, serhiy.storchaka title: createcommand memory leak -> tkinter tk.createcommand memory leak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:10:00 2019 From: report at bugs.python.org (Michael Osipov) Date: Tue, 30 Apr 2019 10:10:00 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556619000.83.0.863788878368.issue36734@roundup.psfhosted.org> Michael Osipov <1983-01-06 at gmx.net> added the comment: The memset() works as expected and compiles for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:19:55 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 10:19:55 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556619595.96.0.715262654742.issue36734@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b84cb70880a0acfcbbaca7bcda405af08f94d269 by Victor Stinner in branch 'master': bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970) https://github.com/python/cpython/commit/b84cb70880a0acfcbbaca7bcda405af08f94d269 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:20:30 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 10:20:30 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556619000.83.0.863788878368.issue36734@roundup.psfhosted.org> Message-ID: STINNER Victor added the comment: Thanks for testing, I merged my PR. Does Python 3.7 have the same issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:36:58 2019 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 30 Apr 2019 10:36:58 +0000 Subject: [issue6584] gzip module has no custom exception In-Reply-To: <1248675050.27.0.747048824781.issue6584@psf.upfronthosting.co.za> Message-ID: <1556620618.37.0.604142250385.issue6584@roundup.psfhosted.org> Change by Zackery Spytz : ---------- pull_requests: +12944 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:37:44 2019 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 30 Apr 2019 10:37:44 +0000 Subject: [issue6584] gzip module has no custom exception In-Reply-To: <1248675050.27.0.747048824781.issue6584@psf.upfronthosting.co.za> Message-ID: <1556620664.62.0.0551230576545.issue6584@roundup.psfhosted.org> Zackery Spytz added the comment: I'd like to see this issue move forward, so I've created a PR. ---------- nosy: +ZackerySpytz versions: +Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:42:40 2019 From: report at bugs.python.org (=?utf-8?b?UmHDumwgTsO6w7FleiBkZSBBcmVuYXM=?=) Date: Tue, 30 Apr 2019 10:42:40 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556620960.9.0.678070241889.issue26493@roundup.psfhosted.org> Ra?l N??ez de Arenas added the comment: That's the kind of patch I assumed was created for the Windows part, Berker, that's why I reopened the issue. Thanks for the information. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 06:52:19 2019 From: report at bugs.python.org (Michael Osipov) Date: Tue, 30 Apr 2019 10:52:19 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556621539.48.0.291947328882.issue36734@roundup.psfhosted.org> Michael Osipov <1983-01-06 at gmx.net> added the comment: I do not know because I haven't really tested that branch. My HP-UX PRs (https://github.com/python/cpython/pulls/michael-o) are still open and apply to master currently. We (you and me) agreed some time ago, that we go master first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 07:15:48 2019 From: report at bugs.python.org (Michael Osipov) Date: Tue, 30 Apr 2019 11:15:48 +0000 Subject: [issue36758] configured libdir not correctly passed to Python executable Message-ID: <1556622948.14.0.900799269401.issue36758@roundup.psfhosted.org> New submission from Michael Osipov <1983-01-06 at gmx.net>: I do compile Python from master on HP-UX with aCC: # echo $LDFLAGS $CPPFLAGS -L/opt/ports/lib/hpux32 -I/opt/ports/include UNIX_STD=1998 LDFLAGS="$LDFLAGS -lreadline" CPPFLAGS="-I$PREFIX/include/ncurses $CPPFLAGS" ./configure --prefix=/opt/python \ --libdir=/opt/python/lib/hpux32 --with-system-expat --with-openssl=/opt/openssl having libs in hpux32 or hpux64 is a convention on this platform. When Python is installed the following happens: $ /opt/python/bin/python3 Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Python 3.8.0a3+ (default, Apr 30 2019, 12:09:29) [C] on hp-ux11 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/opt/python/lib/python38.zip', '/opt/python/lib/python3.8', '/opt/python/lib/lib-dynload', '/net/home/osipovmi/.local/lib/python3.8/site-packages', '/opt/python/lib/python3.8/site-packages'] I don't see hpux32 anywhere here. Though all shared objects are there. Reconfiguring: # echo $LDFLAGS $CPPFLAGS -L/opt/ports/lib/hpux32 -I/opt/ports/include UNIX_STD=1998 LDFLAGS="$LDFLAGS -lreadline" CPPFLAGS="-I$PREFIX/include/ncurses $CPPFLAGS" ./configure --prefix=/opt/python \ --with-system-expat --with-openssl=/opt/openssl gives me the expected result: $ /opt/python/bin/python3 Python 3.8.0a3+ (default, Apr 30 2019, 12:21:15) [C] on hp-ux11 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/opt/python/lib/python38.zip', '/opt/python/lib/python3.8', '/opt/python/lib/python3.8/lib-dynload', '/net/home/osipovmi/.local/lib/python3.8/site-packages', '/opt/python/lib/python3.8/site-packages'] >>> It pretty much seems like '--libdir' is not correctly passed down to the installation. I can see that at least this is wrong: ./Lib/distutils/tests/test_install.py:59: libdir = os.path.join(destination, "lib", "python") ./Lib/distutils/command/install.py:32: 'purelib': '$base/lib/python$py_version_short/site-packages', ./Lib/distutils/command/install.py:33: 'platlib': '$platbase/lib/python$py_version_short/site-packages', ./Lib/distutils/command/install.py:39: 'purelib': '$base/lib/python', ./Lib/distutils/command/install.py:40: 'platlib': '$base/lib/python', ./Lib/sysconfig.py:23: 'stdlib': '{installed_base}/lib/python{py_version_short}', ./Lib/sysconfig.py:24: 'platstdlib': '{platbase}/lib/python{py_version_short}', ./Lib/sysconfig.py:25: 'purelib': '{base}/lib/python{py_version_short}/site-packages', ./Lib/sysconfig.py:26: 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', ./Lib/sysconfig.py:35: 'stdlib': '{installed_base}/lib/python', ./Lib/sysconfig.py:36: 'platstdlib': '{base}/lib/python', ./Lib/sysconfig.py:37: 'purelib': '{base}/lib/python', ./Lib/sysconfig.py:38: 'platlib': '{base}/lib/python', ./Lib/sysconfig.py:65: 'stdlib': '{userbase}/lib/python{py_version_short}', ./Lib/sysconfig.py:66: 'platstdlib': '{userbase}/lib/python{py_version_short}', ./Lib/sysconfig.py:67: 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', ./Lib/sysconfig.py:68: 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', ./Lib/sysconfig.py:74: 'stdlib': '{userbase}/lib/python', ./Lib/sysconfig.py:75: 'platstdlib': '{userbase}/lib/python', ./Lib/sysconfig.py:76: 'purelib': '{userbase}/lib/python/site-packages', ./Lib/sysconfig.py:77: 'platlib': '{userbase}/lib/python/site-packages', ./configure.ac:4653: LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}" ./Misc/python-config.sh.in:50:LIBDEST=${prefix_real}/lib/python${VERSION} ./Modules/getpath.c:129: wchar_t *lib_python; /* "lib/pythonX.Y" */ ./Modules/getpath.c:131: wchar_t zip_path[MAXPATHLEN+1]; /* ".../lib/pythonXY.zip" */ ./Modules/getpath.c:520: * e.g. /usr/local/lib/python1.5 is reduced to /usr/local. ./Modules/getpath.c:1018: err = joinpath(calculate->zip_path, L"lib/python00.zip", zip_path_len); ./Modules/getpath.c:1147: calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len); ./Python/coreconfig.c:103:# define PYTHONHOMEHELP "/lib/pythonX.X" I have changed those files manually by adding '/hpux32' everywhere and ran configure with custom libdir: no avail. 'lib/python' will still be used. If this cannot be changed, a warning should be issued with ./configure that custom libdir will lead to loading issues. ---------- components: Build, Installation messages: 341148 nosy: michael-o, vstinner priority: normal severity: normal status: open title: configured libdir not correctly passed to Python executable versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 07:36:26 2019 From: report at bugs.python.org (Snidhi Sofpro) Date: Tue, 30 Apr 2019 11:36:26 +0000 Subject: [issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument Message-ID: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> New submission from Snidhi Sofpro : With: Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32 import datetime; d_Time = datetime.datetime.strptime('03:30 PM', '%I:%M %p'); d_Time = d_Time.astimezone(datetime.timezone.utc); # RESULTS IN OSError: [Errno 22] Invalid argument # WHEREAS the foll. does not have the issue! d_Time = datetime.datetime(year = d_Time.year, month = d_Time.month, day = d_Time.day, hour = d_Time.hour, minute = d_Time.minute, second = d_Time.second, tzinfo = datetime.timezone.utc); print(d_Time); ---------- components: Library (Lib) messages: 341149 nosy: Snidhi priority: normal severity: normal status: open title: datetime: astimezone() results in OSError: [Errno 22] Invalid argument type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 08:03:15 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 12:03:15 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556625795.78.0.87158891703.issue36742@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 08:03:19 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 30 Apr 2019 12:03:19 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556625799.53.0.924955328357.issue36742@roundup.psfhosted.org> Steve Dower added the comment: New changeset d537ab0ff9767ef024f26246899728f0116b1ec3 by Steve Dower in branch 'master': bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017) https://github.com/python/cpython/commit/d537ab0ff9767ef024f26246899728f0116b1ec3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 08:03:22 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 12:03:22 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556625802.06.0.395799545329.issue36742@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 08:11:08 2019 From: report at bugs.python.org (Steve Dower) Date: Tue, 30 Apr 2019 12:11:08 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556626268.32.0.801008970577.issue36742@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +12947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 08:21:05 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 12:21:05 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556626865.62.0.748630957221.issue36742@roundup.psfhosted.org> miss-islington added the comment: New changeset 4d723e76e1ad17e9e7d5e828e59bb47e76f2174b by Miss Islington (bot) in branch '3.7': bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017) https://github.com/python/cpython/commit/4d723e76e1ad17e9e7d5e828e59bb47e76f2174b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 09:23:55 2019 From: report at bugs.python.org (Windson Yang) Date: Tue, 30 Apr 2019 13:23:55 +0000 Subject: [issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1556630635.78.0.438415946524.issue36759@roundup.psfhosted.org> Windson Yang added the comment: on macOS 10.14.4, I got `ValueError: offset must be a timedelta representing a whole number of minutes, not datetime.timedelta(0, 29143).` I will do some research to see why this happen. ---------- nosy: +Windson Yang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 10:53:50 2019 From: report at bugs.python.org (Andreas Schneider) Date: Tue, 30 Apr 2019 14:53:50 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1556636030.75.0.639484729335.issue33012@roundup.psfhosted.org> Andreas Schneider added the comment: Looking at: https://github.com/python/cpython/commit/359a2f3daba49fde0d3a07fb3c7a8b051c450d08 This is not fixing the underlying issue but hiding it. The right fix would be to use a union for ml_meth providing members for the 3 different function. So the developer could assign them correctly and the compiler would warn if he would do something wrong. Casting to (void *) is just hiding the problem not fixing it! ---------- nosy: +asn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 11:32:48 2019 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 30 Apr 2019 15:32:48 +0000 Subject: [issue36757] uuid constructor accept invalid strings (extra dash) In-Reply-To: <1556615988.91.0.308330120393.issue36757@roundup.psfhosted.org> Message-ID: <1556638368.08.0.184900768125.issue36757@roundup.psfhosted.org> Josh Rosenberg added the comment: The documentation does describe a fairly flexible parser. Perhaps it's a little too flexible on stuff like URN prefixes, but I don't think we could start enforcing a stricter class of hyphen separations without potentially breaking existing code. Is there are reason your validator doesn't use uuid.UUID to normalize the value? That is, whatever the customer provides, why not use the result of stringifying the resulting UUID, rather than just convert to UUID to validate, then throwing it away? As long as the result is compatible with your sql connector, and logically equivalent to what the customer provided, that seems a valid solution. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 11:38:33 2019 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 30 Apr 2019 15:38:33 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1556638713.96.0.790423307261.issue33012@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, and this particular case was fixed in adfffc7343ce7ebc88ec734a803d3247ba8927fb. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 11:45:56 2019 From: report at bugs.python.org (Andreas Schneider) Date: Tue, 30 Apr 2019 15:45:56 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1556639155.99.0.288268172032.issue33012@roundup.psfhosted.org> Andreas Schneider added the comment: And how do you deal with METH_VARARGS|METH_KEYWORDS functions which have 3 arguments? PyObject* myfunc(PyObject *py_obj, PyObject *args, PyObject *kwargs) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 12:31:16 2019 From: report at bugs.python.org (SilentGhost) Date: Tue, 30 Apr 2019 16:31:16 +0000 Subject: [issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument In-Reply-To: <1556624186.01.0.847614978011.issue36759@roundup.psfhosted.org> Message-ID: <1556641876.29.0.916300943861.issue36759@roundup.psfhosted.org> SilentGhost added the comment: This seems like a duplicate (or at least very similar) to the issue 29097. Could you try a newer version of Python (that issue was fixed in 3.6.7) to make sure it's not a duplicate? That was specifically a Windows bug, Windson, make sure that what you're seeing is not fixed elsewhere if you only have macOS available. ---------- nosy: +SilentGhost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 12:38:56 2019 From: report at bugs.python.org (Joe Borg) Date: Tue, 30 Apr 2019 16:38:56 +0000 Subject: [issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT Message-ID: <1556642336.59.0.253389839782.issue36760@roundup.psfhosted.org> New submission from Joe Borg : Reading from https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess """ If you ran the process with stderr=subprocess.STDOUT, stdout and stderr will be combined in this attribute, and stderr will be None. """ But, if you run `run()` with `capture_output=True`, you get the following exception: """ ValueError: stdout and stderr arguments may not be used with capture_output. """ So, it seems impossible to get the combined outputs of stdout and stderr with `run()`. ---------- components: Library (Lib) messages: 341158 nosy: Joe.Borg priority: normal severity: normal status: open title: subprocess.run fails with capture_output=True and stderr=STDOUT type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 13:02:11 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 30 Apr 2019 17:02:11 +0000 Subject: [issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT In-Reply-To: <1556642336.59.0.253389839782.issue36760@roundup.psfhosted.org> Message-ID: <1556643731.65.0.54981786513.issue36760@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Are you using something like below? This exception was added with ce0f33d04528fcafc673a8707871f8430d8f7ce8 (issue32102) >>> subprocess.run('ls', stdout=subprocess.PIPE, capture_output=True) Traceback (most recent call last): File "", line 1, in File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/subprocess.py", line 469, in run raise ValueError('stdout and stderr arguments may not be used ' ValueError: stdout and stderr arguments may not be used with capture_output. There is a note on the docs and a discussion on the issue that capture_output and stdout/stderr cannot be used at the same time. https://docs.python.org/3/library/subprocess.html#subprocess.run > If capture_output is true, stdout and stderr will be captured. When used, the internal Popen object is automatically created with stdout=PIPE and stderr=PIPE. The stdout and stderr arguments may not be supplied at the same time as capture_output. ---------- nosy: +gregory.p.smith, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 14:48:02 2019 From: report at bugs.python.org (wim glenn) Date: Tue, 30 Apr 2019 18:48:02 +0000 Subject: [issue36761] Extended slice assignment + iterable unpacking Message-ID: <1556650082.38.0.163364239874.issue36761@roundup.psfhosted.org> New submission from wim glenn : Could cases like these be made to work? *Should* cases like these be made to work? L = [0, 1, 2] L[::2], *rest = "abcdef" # ValueError: attempt to assign sequence of size 1 to extended slice of size 2 a, L[::2] = "abc" # ValueError: too many values to unpack (expected 2) The list slice knows exactly how many slots need to be filled, so I can't immediately think of any obvious ambiguity. Maybe there are some implementation complications with supporting e.g. generators on the RHS (because RHS must be evaluated before LHS - https://docs.python.org/3/reference/expressions.html#evaluation-order). ---------- components: Interpreter Core messages: 341160 nosy: wim.glenn priority: normal severity: normal status: open title: Extended slice assignment + iterable unpacking type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 16:34:49 2019 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 30 Apr 2019 20:34:49 +0000 Subject: [issue14546] lll.py can't handle multiple parameters correctly In-Reply-To: <1334154576.79.0.440664410533.issue14546@psf.upfronthosting.co.za> Message-ID: <1556656489.04.0.686665122841.issue14546@roundup.psfhosted.org> Change by Zackery Spytz : ---------- pull_requests: +12948 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 16:36:28 2019 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 30 Apr 2019 20:36:28 +0000 Subject: [issue14546] lll.py can't handle multiple parameters correctly In-Reply-To: <1334154576.79.0.440664410533.issue14546@psf.upfronthosting.co.za> Message-ID: <1556656588.59.0.92506428633.issue14546@roundup.psfhosted.org> Zackery Spytz added the comment: I've created a PR for this issue (with a test). ---------- nosy: +ZackerySpytz versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 16:41:36 2019 From: report at bugs.python.org (Berker Peksag) Date: Tue, 30 Apr 2019 20:41:36 +0000 Subject: [issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d In-Reply-To: <1552917459.29.0.295748589939.issue36345@roundup.psfhosted.org> Message-ID: <1556656896.61.0.989163513034.issue36345@roundup.psfhosted.org> Berker Peksag added the comment: Please revert 360e1e4c519cfc139de707bcdd1e6c871eec79ee. It's not a good example to put into the documentation. It uses different naming convention. It would only confuse users relatively new to the wsgiref module and WSGI protocol. FileWrapper was supposed to support __getitem__ and __iter__ protocols for compatibility with older Python versions, but its __getiem__ implementation is buggy and is already deprecated. It has no use case in modern Python code. It has zero exception handling and will return a cryptic traceback if mimetype cannot detect type of the file. The examples in the wsgiref documentation already cover most of the cases. There is no need to add more similar ones. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 17:04:59 2019 From: report at bugs.python.org (Berker Peksag) Date: Tue, 30 Apr 2019 21:04:59 +0000 Subject: [issue36329] use the right python "make -C Doc/ serve" In-Reply-To: <1552849058.57.0.633692372704.issue36329@roundup.psfhosted.org> Message-ID: <1556658299.65.0.382673742846.issue36329@roundup.psfhosted.org> Berker Peksag added the comment: Personally, I'd prefer removing the 'serve' target completely. make -C Doc htmlview should already cover most of its use cases. There is no deprecation period needed and there is already a replacement (and IMO better) for it. ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 17:11:47 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 21:11:47 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556658707.59.0.974472417186.issue36734@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +12949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 17:30:47 2019 From: report at bugs.python.org (miss-islington) Date: Tue, 30 Apr 2019 21:30:47 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556659847.32.0.242843529079.issue36734@roundup.psfhosted.org> miss-islington added the comment: New changeset 5f5b187bfa17254f5ae55593820fc938c45c2b32 by Miss Islington (bot) in branch '3.7': bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970) https://github.com/python/cpython/commit/5f5b187bfa17254f5ae55593820fc938c45c2b32 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 18:00:06 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 22:00:06 +0000 Subject: [issue36734] Modules/faulthandler.c does not compile on HP-UX due to bpo-35214/1584a0081500d35dc93ff88e5836df35faf3e3e2 In-Reply-To: <1556278148.43.0.578360230422.issue36734@roundup.psfhosted.org> Message-ID: <1556661606.95.0.627972527379.issue36734@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.7 was also affected: I fixed it as well. Thanks for your bug report. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 18:31:42 2019 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 30 Apr 2019 22:31:42 +0000 Subject: [issue36762] Teach "import *" to warn when overwriting globals or builtins Message-ID: <1556663502.82.0.194449689186.issue36762@roundup.psfhosted.org> New submission from Raymond Hettinger : One reason we usually suggest that people don't use star imports is that it is too easy to shadow a builtin or overwrite an existing global. Momma Gump always used to say, "import star is like a box of chocolates, you never know what you've going to get". >>> from os import * Warning (from warnings module): File "__main__", line 1 ImportWarning: The 'open' variable in the 'os' module shadows a variable in the 'builtins' module >>> alpha = 2.0 >>> beta = 3.0 >>> gamma = 4.5 >>> delta = 5.5 >>> from math import * >>> from os import * Warning (from warnings module): File "__main__", line 8 ImportWarning: The 'gamma' variable in the 'math' overwrites an existing variable in the globals. ---------- components: Interpreter Core messages: 341166 nosy: rhettinger priority: normal severity: normal status: open title: Teach "import *" to warn when overwriting globals or builtins type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 18:38:59 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 22:38:59 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP Message-ID: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> New submission from STINNER Victor : I'm working on changes to complete the PEP 587, Python initiaization API. ---------- components: Interpreter Core messages: 341167 nosy: vstinner priority: normal severity: normal status: open title: PEP 587: Rework initialization API to prepare second version of the PEP versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 18:42:52 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 22:42:52 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP In-Reply-To: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> Message-ID: <1556664172.2.0.119666641366.issue36763@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +12950 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 18:54:18 2019 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 30 Apr 2019 22:54:18 +0000 Subject: [issue36740] zipimporter misses namespace packages for implicit dirs In-Reply-To: <1556352255.87.0.293489853138.issue36740@roundup.psfhosted.org> Message-ID: <1556664858.99.0.863633426666.issue36740@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 18:54:33 2019 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 30 Apr 2019 22:54:33 +0000 Subject: [issue14905] zipimport needs to support namespace packages when no 'directory' entry exists In-Reply-To: <1337905627.12.0.841961188355.issue14905@psf.upfronthosting.co.za> Message-ID: <1556664873.83.0.156327930087.issue14905@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 19:36:17 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 23:36:17 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP In-Reply-To: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> Message-ID: <1556667377.12.0.946955100494.issue36763@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 463b82a3efe8a6a9f3924a5b37482e961dffe3b8 by Victor Stinner in branch 'master': bpo-36763: Fix Py_SetStandardStreamEncoding() (GH-13028) https://github.com/python/cpython/commit/463b82a3efe8a6a9f3924a5b37482e961dffe3b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 19:40:48 2019 From: report at bugs.python.org (STINNER Victor) Date: Tue, 30 Apr 2019 23:40:48 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP In-Reply-To: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> Message-ID: <1556667648.5.0.0387214950792.issue36763@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 20:01:41 2019 From: report at bugs.python.org (Martin Panter) Date: Wed, 01 May 2019 00:01:41 +0000 Subject: [issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT In-Reply-To: <1556642336.59.0.253389839782.issue36760@roundup.psfhosted.org> Message-ID: <1556668901.09.0.986723410403.issue36760@roundup.psfhosted.org> Martin Panter added the comment: Python 3.7 added the "capture_output" parameter, for Issue 32102. Before that change, you could use "subprocess.PIPE": https://docs.python.org/3.6/library/subprocess.html#subprocess.run ?To [capture output], pass PIPE for the ?stdout? and/or ?stderr? arguments? Since "capture_output" was added, it looks like you can still pass "subprocess.PIPE" on your own, but the documentation now only gives subtle hints that this might be supported. This was also brought up in Issue 33319. ---------- nosy: +bbayles, martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 20:12:53 2019 From: report at bugs.python.org (Eryk Sun) Date: Wed, 01 May 2019 00:12:53 +0000 Subject: [issue26493] Bad formatting in WinError 193 when using subprocess.check_call In-Reply-To: <1457283389.71.0.286389844503.issue26493@psf.upfronthosting.co.za> Message-ID: <1556669573.27.0.0349125222422.issue26493@roundup.psfhosted.org> Eryk Sun added the comment: >> A new issue should be raised to fix the FormatMessage calls in the >> standard library that mistakenly leave out >> FORMAT_MESSAGE_IGNORE_INSERTS. > > Do you suggest to modify OSError constructor to modify the call to > FormatMessageW(): don't pass the FORMAT_MESSAGE_IGNORE_INSERTS flag? > I prefer "%1 is not a valid Win32 application" message than > "". I suggested creating a new issue to fix the calls that omit this flag. I think it's just two modules: Modules/overlapped.c and Modules/_ctypes/callproc.c. If there are more inserts than arguments (i.e. any inserts in our case since we pass no arguments), then FormatMessageW fails and the above modules use a default message. For example: >>> _overlapped.FormatMessage(193) 'unknown error code 193' >>> _ctypes.FormatError(193) '' > There is no need to re-raise the exception: the "strerror" attribute > contains the error message and it can be modified. I meant that Popen._execute_child would handle the exception by modifying and reraising it. In general for OSError exceptions, we could set `filename` to either `executable`, if it's defined, or else parse it out of the commandline. For ERROR_BAD_EXE_FORMAT (193), we could also change `strerror` to something like "Invalid executable format" instead of "%1 is not a valid Win32 application". This is more consistent with how we append ": {filename}" to the message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 20:16:57 2019 From: report at bugs.python.org (Chihiro Ito) Date: Wed, 01 May 2019 00:16:57 +0000 Subject: [issue36742] urlsplit doesn't accept a NFKD hostname with a port number In-Reply-To: <1556368216.92.0.317568776121.issue36742@roundup.psfhosted.org> Message-ID: <1556669817.29.0.00169040863718.issue36742@roundup.psfhosted.org> Chihiro Ito added the comment: I have confirmed that all of my app's test cases have passed. What I've done: 1. Installed Python 3.7.3. 2. Replaced urllib/parse.py with the one from 781ffb1. 3. Ran my app's test cases. Thank you for the quick fix! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 20:30:15 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 May 2019 00:30:15 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP In-Reply-To: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> Message-ID: <1556670615.02.0.18402209149.issue36763@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5f38b8407b071acd96da2c8cde411d0e26967735 by Victor Stinner in branch 'master': bpo-36763: Add _PyCoreConfig_SetArgv() (GH-13030) https://github.com/python/cpython/commit/5f38b8407b071acd96da2c8cde411d0e26967735 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 20:34:33 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 May 2019 00:34:33 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP In-Reply-To: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> Message-ID: <1556670873.68.0.963301281417.issue36763@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +12952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 20:56:00 2019 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 01 May 2019 00:56:00 +0000 Subject: [issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None In-Reply-To: <1541543349.68.0.788709270274.issue35181@psf.upfronthosting.co.za> Message-ID: <1556672160.94.0.370080894186.issue35181@roundup.psfhosted.org> Barry A. Warsaw added the comment: I've approved both PRs, however I am rather uncomfortable about the code snippet in import.rst. G?ry's change is a good one AFAICT, and thanks for the contribution! I would feel much better about the long term correctness of this code snippet if we had a doctest to run over it. But that's for another time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 22:12:37 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 01 May 2019 02:12:37 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1556676757.87.0.548940994971.issue30458@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset c4e671eec20dfcb29b18596a89ef075f826c9f96 by Gregory P. Smith in branch 'master': bpo-30458: Disallow control chars in http URLs. (GH-12755) https://github.com/python/cpython/commit/c4e671eec20dfcb29b18596a89ef075f826c9f96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 22:18:09 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 01 May 2019 02:18:09 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1556677089.89.0.195275491572.issue30458@roundup.psfhosted.org> Gregory P. Smith added the comment: backports to older releases will need to be done manually and take care depending on how much of a concern tightening the existing abusive lenient behavior of the http.client API to enforce what characters are allowed in URLs is to stable releases. I question if this is _really_ worthy of a "security" tag and a CVE (thus its non-high ranking)... it is a bug in the calling program if it blindly uses untrusted data as a URL. What this issue addresses is that we catch that more often and raise an error; a good thing to do for sure, but the stdlib should be the last line of defense. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 22:18:51 2019 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 01 May 2019 02:18:51 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1556677131.27.0.352518639357.issue30458@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: gregory.p.smith -> stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 23:30:25 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 01 May 2019 03:30:25 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1556681425.79.0.581745824951.issue30458@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This causes buildbot failure (AMD64 FreeBSD 10-STABLE Non-Debug 3.x and AMD64 Debian root 3.x). I tried debugging and it's reproducible on my mac machine that has python not built with ssl and not reproducible on Ubuntu machine built with ssl. The failed tests use https scheme and as I can see from the file there is one another test (test_cafile_and_context) which is skipped and has skip test if ssl is absent @unittest.skipUnless(ssl, "ssl module required"). It seems perhaps wrapping these machines don't have ssl built with skip test might help. Since primary CI has ssl built it would have been caught. On trying to add a print statement for lookup variable at https://github.com/python/cpython/blob/c4e671eec20dfcb29b18596a89ef075f826c9f96/Lib/urllib/request.py#L485 I can see the below output where httpshandler was not defined for machines without built ssl. HTTPSConnection was not present as part of http.client due to import ssl causing ImportError. Ubuntu with ssl {'unknown': [], 'http': [], 'ftp': [], 'file': [], 'data': [], 'https': []} Mac without ssl (https handler missing causing unknown to be taken up for the test) {'unknown': [], 'http': [], 'ftp': [], 'file': [], 'data': []} Gregory, I can create a PR with below patch if my analysis right to see if it helps or you can try a buildbot-custom branch to see if this works with buildbots since my PR won't have any effect on primary CI which have ssl built version of Python. I am not sure I have privileges to trigger a custom buildbot run. I tested it on my Mac without ssl and it has no failures since the tests are skipped. diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index e87c85b928..c5b23f935b 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -329,6 +329,7 @@ class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): finally: self.unfakehttp() + @unittest.skipUnless(ssl, "ssl module required") def test_url_with_control_char_rejected(self): for char_no in list(range(0, 0x21)) + [0x7f]: char = chr(char_no) @@ -354,6 +355,7 @@ class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): finally: self.unfakehttp() + @unittest.skipUnless(ssl, "ssl module required") def test_url_with_newline_header_injection_rejected(self): self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.") host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123" ---------- assignee: -> gregory.p.smith stage: backport needed -> patch review versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 23:35:38 2019 From: report at bugs.python.org (STINNER Victor) Date: Wed, 01 May 2019 03:35:38 +0000 Subject: [issue36763] PEP 587: Rework initialization API to prepare second version of the PEP In-Reply-To: <1556663939.96.0.509924822981.issue36763@roundup.psfhosted.org> Message-ID: <1556681738.47.0.716737058227.issue36763@roundup.psfhosted.org> STINNER Victor added the comment: New changeset db7197543112954b0912e3d46e39fefcb1c3b950 by Victor Stinner in branch 'master': bpo-36763: Rework _PyInitError API (GH-13031) https://github.com/python/cpython/commit/db7197543112954b0912e3d46e39fefcb1c3b950 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 30 23:59:58 2019 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 01 May 2019 03:59:58 +0000 Subject: [issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699) In-Reply-To: <1495638091.75.0.96439752743.issue30458@psf.upfronthosting.co.za> Message-ID: <1556683198.9.0.371405804726.issue30458@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Sorry, I will toggle back the issue status. Not sure why bpo didn't warn in this case. ---------- assignee: gregory.p.smith -> stage: patch review -> backport needed versions: -Python 3.8 _______________________________________ Python tracker _______________________________________