From report at bugs.python.org Sat Aug 1 00:39:25 2020 From: report at bugs.python.org (Joshua Bronson) Date: Sat, 01 Aug 2020 04:39:25 +0000 Subject: [issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6 In-Reply-To: <1596242031.59.0.938089827478.issue41451@roundup.psfhosted.org> Message-ID: <1596256765.81.0.716596997426.issue41451@roundup.psfhosted.org> Joshua Bronson added the comment: Whittled this down to an even more minimal repro: """Repro for Python 3.6 slots + weakref + typing.Generic subclass bug.""" from typing import Generic, TypeVar from weakref import ref T = TypeVar("T") class MyGeneric(Generic[T]): """MyGeneric works as expected. >>> example = MyGeneric() >>> from pickle import dumps, loads >>> pickled = dumps(example) >>> roundtripped = loads(pickled) >>> roundtripped <__main__.MyGeneric object at ...> """ __slots__ = ("_other", "__weakref__") def __init__(self) -> None: self._init_other() def _init_other(self) -> None: other = self.__class__.__new__(self.__class__) other._other = self self._other = ref(other) def __getstate__(self) -> dict: """Needed to enable pickling due to use of __slots__ and weakrefs.""" return {} def __setstate__(self, _) -> None: """Needed because use of __slots__ would prevent unpickling otherwise.""" self._init_other() # So far so good, but now let's make a subclass. # The following class definition works on Python > 3.6, but fails on 3.6 with # TypeError: __weakref__ slot disallowed: either we already got one, or __itemsize__ != 0 class FailsInPy36(MyGeneric[T]): """Minimal repro. >>> repro = FailsInPy36() >>> repro <__main__.FailsInPy36 object at ...> """ if __name__ == "__main__": import doctest doctest.testmod(optionflags=doctest.ELLIPSIS) ---------- title: Class with __weakref__ slot cannot inherit from typing.Generic subclass -> Cannot subclass typing.Generic with __weakref__ slot in Python 3.6 Added file: https://bugs.python.org/file49355/bpo41451-repro-min.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 01:07:32 2020 From: report at bugs.python.org (Joshua Oreman) Date: Sat, 01 Aug 2020 05:07:32 +0000 Subject: [issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6 In-Reply-To: <1596242031.59.0.938089827478.issue41451@roundup.psfhosted.org> Message-ID: <1596258452.88.0.344170246882.issue41451@roundup.psfhosted.org> Joshua Oreman added the comment: The problem appears to be occurring when the base class is subscripted, not when it's inherited. I can reproduce this issue on Python 3.6.10 by just evaluating Base[T]. 'del Base.__slots__' after Base is constructed seems to work around the issue, and allow Base[T] to be evaluated. Of course, Base is still slotted at this point, since __slots__ are consulted only when initially building the class. ---------- nosy: +Joshua Oreman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 01:37:39 2020 From: report at bugs.python.org (Ma Lin) Date: Sat, 01 Aug 2020 05:37:39 +0000 Subject: [issue41452] Inefficient BufferedReader.read(-1) In-Reply-To: <1596252854.24.0.567639060257.issue41452@roundup.psfhosted.org> Message-ID: <1596260259.79.0.610433864825.issue41452@roundup.psfhosted.org> Change by Ma Lin : ---------- keywords: +patch pull_requests: +20842 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21698 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 01:37:36 2020 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 01 Aug 2020 05:37:36 +0000 Subject: [issue41453] A possible reference leak in _locale.localeconv() Message-ID: <1596260256.93.0.581733214467.issue41453@roundup.psfhosted.org> New submission from Zackery Spytz : If the _Py_GetLocaleconvNumeric() call fails in _locale_localeconv_impl(), "decimal_point" may be leaked. ---------- components: Extension Modules messages: 374655 nosy: ZackerySpytz priority: normal severity: normal status: open title: A possible reference leak in _locale.localeconv() versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 01:44:18 2020 From: report at bugs.python.org (Ma Lin) Date: Sat, 01 Aug 2020 05:44:18 +0000 Subject: [issue41330] Inefficient error-handle for CJK encodings In-Reply-To: <1595048019.57.0.348575052072.issue41330@roundup.psfhosted.org> Message-ID: <1596260658.71.0.622281127081.issue41330@roundup.psfhosted.org> Ma Lin added the comment: At least fix this bug: the error-handler object is not cached, it needs to be looked up from a dict every time, which is very inefficient. The code: https://github.com/python/cpython/blob/v3.9.0b4/Modules/cjkcodecs/multibytecodec.c#L81-L98 I will submit a PR at some point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 01:45:08 2020 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 01 Aug 2020 05:45:08 +0000 Subject: [issue41453] A possible reference leak in _locale.localeconv() In-Reply-To: <1596260256.93.0.581733214467.issue41453@roundup.psfhosted.org> Message-ID: <1596260708.16.0.385702554833.issue41453@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +20843 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 01:59:43 2020 From: report at bugs.python.org (Ma Lin) Date: Sat, 01 Aug 2020 05:59:43 +0000 Subject: [issue41452] Inefficient BufferedReader.read(-1) In-Reply-To: <1596252854.24.0.567639060257.issue41452@roundup.psfhosted.org> Message-ID: <1596261583.64.0.999017642196.issue41452@roundup.psfhosted.org> Ma Lin added the comment: Some underlying stream has fast-path for .readall(). So close this issue. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 02:16:03 2020 From: report at bugs.python.org (fj92f3jj923f923) Date: Sat, 01 Aug 2020 06:16:03 +0000 Subject: [issue41445] Adding configure temporary files to gitignore In-Reply-To: <1596126231.09.0.21986498647.issue41445@roundup.psfhosted.org> Message-ID: <1596262563.73.0.83303353883.issue41445@roundup.psfhosted.org> fj92f3jj923f923 added the comment: Closing it as not important :) ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 03:26:17 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 01 Aug 2020 07:26:17 +0000 Subject: [issue41447] Resource Tracker in Multiprocessing Shared Memory not working correctly In-Reply-To: <1596129575.64.0.828449737414.issue41447@roundup.psfhosted.org> Message-ID: <1596266777.98.0.630519376284.issue41447@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 04:18:50 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Aug 2020 08:18:50 +0000 Subject: [issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha In-Reply-To: <1595959149.08.0.339696183777.issue41421@roundup.psfhosted.org> Message-ID: <1596269930.3.0.32058711723.issue41421@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 5c3270939c09e4c8e80fd26449b718a998701912 by Raymond Hettinger in branch 'master': bpo-41421: Algebraic simplification for random.paretovariate() (GH-21695) https://github.com/python/cpython/commit/5c3270939c09e4c8e80fd26449b718a998701912 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 07:43:23 2020 From: report at bugs.python.org (Dennis Clarke) Date: Sat, 01 Aug 2020 11:43:23 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596282203.31.0.0738559450753.issue29269@roundup.psfhosted.org> Dennis Clarke added the comment: Well here we are in 2020 and Solaris systems are still running just fine. In fact, some big Fujitsu SPARC systems are running in production for years and years and also, no surprise, this test still fails horrifically on old stable Solaris 10. Python is turning into a piece of supposedly open source software with many commercial interests with their hands inside of it. I am not sure how to get this bug fixed but I can certainly report that it is still broken in 3.7.8 on a very stable and reliable platform. ---------- nosy: +blastwave versions: +Python 3.7 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 09:16:15 2020 From: report at bugs.python.org (Dexter Ramos) Date: Sat, 01 Aug 2020 13:16:15 +0000 Subject: [issue41454] while loop bug on list Message-ID: <1596287775.85.0.902720236195.issue41454@roundup.psfhosted.org> New submission from Dexter Ramos : The output should have no duplicates but it has. When I added another "5" on the list it goes okay and is still okay if I add more. But when there is only two 5's it won't do its job. ---------- components: Windows files: app.py messages: 374661 nosy: Dexter Ramos, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: while loop bug on list type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49356/app.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 09:21:34 2020 From: report at bugs.python.org (Joshua Bronson) Date: Sat, 01 Aug 2020 13:21:34 +0000 Subject: [issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6 In-Reply-To: <1596242031.59.0.938089827478.issue41451@roundup.psfhosted.org> Message-ID: <1596288094.67.0.530040881136.issue41451@roundup.psfhosted.org> Joshua Bronson added the comment: Thanks so much, @oremanj! Indeed, merely subscripting the class triggers the bug, and your 'del slots' workaround does the trick! For completeness, there is an updated (yet more minimal) repro below/attached. """Repro for Python 3.6 slots + weakref + typing.Generic subclass bug.""" from typing import Generic, TypeVar from weakref import ref T = TypeVar("T") class MyGeneric(Generic[T]): """MyGeneric works as expected. >>> example = MyGeneric() >>> example <__main__.MyGeneric object at ...> >>> example._other <__main__.MyGeneric object at ...> >>> example._other._other >>> from pickle import dumps, loads >>> pickled = dumps(example) >>> roundtripped = loads(pickled) >>> roundtripped <__main__.MyGeneric object at ...> """ __slots__ = ("_other", "__weakref__") def __init__(self) -> None: self._init_other() def _init_other(self) -> None: other = self.__class__.__new__(self.__class__) other._other = ref(self) self._other = other def __getstate__(self) -> dict: """Needed to enable pickling due to use of __slots__ and weakrefs.""" return {} def __setstate__(self, _) -> None: """Needed because use of __slots__ would prevent unpickling otherwise.""" self._init_other() # Merely the following is enough to trigger the bug on Python 3.6: MyGeneric[T] # This works around the issue if run first (thanks @oremanj): del MyGeneric.__slots__ # does not actually 'unslot' the class if __name__ == "__main__": import doctest doctest.testmod(optionflags=doctest.ELLIPSIS) ---------- Added file: https://bugs.python.org/file49357/bpo41451-repro-min+workaround.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 09:45:17 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 Aug 2020 13:45:17 +0000 Subject: [issue41454] while loop bug on list In-Reply-To: <1596287775.85.0.902720236195.issue41454@roundup.psfhosted.org> Message-ID: <1596289517.35.0.777995984564.issue41454@roundup.psfhosted.org> Eric V. Smith added the comment: You're mutating the list while iterating over it, which is causing the behavior you're seeing. This isn't a bug. See for example https://stackoverflow.com/questions/6260089/strange-result-when-removing-item-from-a-list Also, when reporting bugs in the future, please include the output you got, and how it differs from what you expected. It's difficult to guess. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 10:07:41 2020 From: report at bugs.python.org (Dexter Ramos) Date: Sat, 01 Aug 2020 14:07:41 +0000 Subject: [issue41454] while loop bug on list In-Reply-To: <1596287775.85.0.902720236195.issue41454@roundup.psfhosted.org> Message-ID: <1596290861.0.0.687564431192.issue41454@roundup.psfhosted.org> Dexter Ramos added the comment: Thank you Mr. Erick Smith. Now I know. I also tried to find the hard way like this: --------finding nemo------------- [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4] --->index [4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6] --->original list / --->started at index 0 with value of 4 [1, 2, 5, 7, 2, 8, 9, 5, 3, 2, 6, 4] --->1st iteration, all 4's are removed then appended so the index adjusted / --->next at index 1 with a value of 2 (whereas value 1 was skipped which had index 1 originally; this is not seen on the output because it has no duplicate) [1, 5, 7, 8, 9, 5, 3, 6, 4, 2] --->3rd iteration / --->next at index 2 with value of 7; value 5 was skipped which had the index 2 originally; cause found! [1, 5, 8, 9, 5, 3, 6, 4, 2, 7] --->4th ... ... ---------------nemo found----------------------- Credits to you. Here is the new working code: -------code------------------------------------------------ bunchofnumbers = [4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6] for eachnumber in bunchofnumbers.copy(): while eachnumber in bunchofnumbers: bunchofnumbers.remove(eachnumber) bunchofnumbers.append(eachnumber) bunchofnumbers.sort() -------end of code----------------------------------------- OUTPUT: [1, 2, 3, 4, 5, 6, 7, 8, 9] print(bunchofnumbers) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 13:58:11 2020 From: report at bugs.python.org (Yaroslac) Date: Sat, 01 Aug 2020 17:58:11 +0000 Subject: [issue41455] Python Devguide differs from python docs Message-ID: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> New submission from Yaroslac : As I can see here https://github.com/python/devguide/blob/master/garbage_collector.rst#collecting-the-oldest-generation > the GC only triggers a full collection of the oldest generation if the ratio long_lived_pending / long_lived_total is above a given value (hardwired to 25%) But in the python docs here https://docs.python.org/3.10/library/gc.html#gc.set_threshold > When the number of allocations minus the number of deallocations exceeds threshold0, collection starts. Initially only generation 0 is examined. If generation 0 has been examined more than threshold1 times since generation 1 has been examined, then generation 1 is examined as well. Similarly, threshold2 controls the number of collections of generation 1 before collecting generation 2. So, which one is correct? ---------- assignee: docs at python components: Documentation messages: 374665 nosy: Yaroslav, docs at python priority: normal severity: normal status: open title: Python Devguide differs from python docs type: resource usage versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 15:36:19 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 Aug 2020 19:36:19 +0000 Subject: [issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha In-Reply-To: <1595959149.08.0.339696183777.issue41421@roundup.psfhosted.org> Message-ID: <1596310579.47.0.743107420758.issue41421@roundup.psfhosted.org> Raymond Hettinger added the comment: How about this wording? If alpha is smaller than 0.1, an occasional OverflowError can arise when the variate exceeds the range of Python float. I like using 0.1 because it's easy and gives us some wiggle room. The actual cutoff is lower: >>> alpha = 0.05079 >>> sys.float_info.epsilon ** (-1.0 / alpha) >>> alpha = 0.05078 >>> sys.float_info.epsilon ** (-1.0 / alpha) Traceback (most recent call last): File "", line 1, in sys.float_info.epsilon ** (-1.0 / alpha) 1.590779741838475e+308 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 15:39:43 2020 From: report at bugs.python.org (Johannes Reiff) Date: Sat, 01 Aug 2020 19:39:43 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1596310783.96.0.639844715226.issue41402@roundup.psfhosted.org> Johannes Reiff added the comment: Thanks! Is there anything I need to do regarding the Python 3.8 and 3.9 backports? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 16:20:09 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Aug 2020 20:20:09 +0000 Subject: [issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface In-Reply-To: <1209319360.66.0.583090952017.issue2704@psf.upfronthosting.co.za> Message-ID: <1596313209.34.0.648455263108.issue2704@roundup.psfhosted.org> Terry J. Reedy added the comment: #41075 is specifically about history navigation. I tried Shift/Control/Alt - Up/Down and none worked. Rebinding just Up/Down did (in Shell, with Editor unchanged). But not having up/down work to move between lines in the Shell multiline statement entry area is not acceptable to me. Two additional idea from the new issue: a) Add history commands to context menu to make them more discoverable; b) When statement has SyntaxError, put Error message in box and let user edit bad code directly, as in Editor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 16:23:46 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Aug 2020 20:23:46 +0000 Subject: [issue41075] IDLE: Better support history navigation In-Reply-To: <1592824587.6.0.226335506835.issue41075@roundup.psfhosted.org> Message-ID: <1596313426.36.0.478594896469.issue41075@roundup.psfhosted.org> Terry J. Reedy added the comment: History and up/down is apart of #2704. It has patches that include the up/down change, but I don't expect to use any of them as they are. I tried Shift/Control/Alt - Up/Down and none worked. Rebinding just Up/Down did (in Shell only, leaving up/down unchanged in Editor). But not having up/down work to move between lines in the Shell multiline statement entry area is not acceptable to me. I don't know if modifiers can never work with up/down or if there is something that would make it work. ---------- nosy: -epaine stage: resolved -> status: closed -> open title: Make support of navigating through prev. commands in IDLE more conspicuous -> IDLE: Better support history navigation versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 16:26:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Aug 2020 20:26:06 +0000 Subject: [issue41075] IDLE: Better support history navigation In-Reply-To: <1592824587.6.0.226335506835.issue41075@roundup.psfhosted.org> Message-ID: <1596313566.34.0.160991061217.issue41075@roundup.psfhosted.org> Terry J. Reedy added the comment: Yes, history works fine with the current bindings to alt-p and alt-n, or with binding to up or down, but not with binding to modifier-up/down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 16:29:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 Aug 2020 20:29:20 +0000 Subject: [issue41075] IDLE: Better support history navigation In-Reply-To: <1592824587.6.0.226335506835.issue41075@roundup.psfhosted.org> Message-ID: <1596313760.08.0.946390686771.issue41075@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 17:07:18 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 01 Aug 2020 21:07:18 +0000 Subject: [issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha In-Reply-To: <1595959149.08.0.339696183777.issue41421@roundup.psfhosted.org> Message-ID: <1596316038.61.0.31234840533.issue41421@roundup.psfhosted.org> Tim Peters added the comment: That text is fine, if you feel something needs to be said at all. I really don't. A Pareto distribution of this kind with parameter <= 1.0 has infinite expected value - VERY long tail. Anyone who knows what they're doing already knows that. The reason the implementation can't "blow up" for parameters >= (roughly) 0.1 isn't that IEEE doubles have such a large dynamic range but rather that they can't represent a number < 1.0 larger than 1 - 2**-53 (so u = 1 - random.random() is always at least 2**-53). The actual distribution has infinite expected value nonetheless, but the implementation is incapable of generating any of its very large values (which, while very rare, are also very large). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 17:19:36 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 01 Aug 2020 21:19:36 +0000 Subject: [issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6 In-Reply-To: <1596242031.59.0.938089827478.issue41451@roundup.psfhosted.org> Message-ID: <1596316776.41.0.870320755226.issue41451@roundup.psfhosted.org> Ned Deily added the comment: Thank you for the report and for the analysis. As you probably know, Python 3.6 is now in the security phase of its life cycle so generally only fixes for security-related issues are provided at this point. This issue doesn't seem to fall into that category. If you have a workaround for 3.6.x, documenting it is probably the best available option. I'm going to close this as "wont fix". https://www.python.org/downloads/ ---------- nosy: +ned.deily resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 20:40:14 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Aug 2020 00:40:14 +0000 Subject: [issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha In-Reply-To: <1595959149.08.0.339696183777.issue41421@roundup.psfhosted.org> Message-ID: <1596328814.84.0.168638373743.issue41421@roundup.psfhosted.org> Raymond Hettinger added the comment: Okay, marking this as closed. ---------- resolution: -> works for me stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 21:05:04 2020 From: report at bugs.python.org (Luciano Ramalho) Date: Sun, 02 Aug 2020 01:05:04 +0000 Subject: [issue40978] Document that typing.SupportsXXX protocols are runtime checkable In-Reply-To: <1592163787.83.0.523481527574.issue40978@roundup.psfhosted.org> Message-ID: <1596330304.78.0.414084686363.issue40978@roundup.psfhosted.org> Luciano Ramalho added the comment: I have added a note about the protocols decorated with `@runtime_checkable` to the `Procools` section of the reorganized `typing.rst` in https://bugs.python.org/issue40979. I also expanded the note about the caveats of `@runtime_checkable` in its entry in `Functions and decorators` section, giving `SupportsFloat` as an example issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 21:08:16 2020 From: report at bugs.python.org (Luciano Ramalho) Date: Sun, 02 Aug 2020 01:08:16 +0000 Subject: [issue40979] typing module docs: keep text, add subsections In-Reply-To: <1592164571.1.0.235029301981.issue40979@roundup.psfhosted.org> Message-ID: <1596330496.34.0.0197514413447.issue40979@roundup.psfhosted.org> Luciano Ramalho added the comment: I have incorporated Guido's suggestions and added additional subsections to make it easier to navigate the page. I also added notes that fix the issue https://bugs.python.org/issue40978 ? "Document that typing.SupportsXXX protocols are runtime checkable" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 21:23:39 2020 From: report at bugs.python.org (Inada Naoki) Date: Sun, 02 Aug 2020 01:23:39 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1596331419.35.0.465141784464.issue38605@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 1 23:30:08 2020 From: report at bugs.python.org (tedder) Date: Sun, 02 Aug 2020 03:30:08 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596339008.19.0.399707667036.issue41449@roundup.psfhosted.org> Change by tedder : ---------- nosy: +tedder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 01:17:52 2020 From: report at bugs.python.org (Mariatta) Date: Sun, 02 Aug 2020 05:17:52 +0000 Subject: [issue41446] New demo, using a web api In-Reply-To: <1596129527.79.0.745234109519.issue41446@roundup.psfhosted.org> Message-ID: <1596345472.23.0.417381757424.issue41446@roundup.psfhosted.org> Mariatta added the comment: Thanks for your interest in adding this to CPython but I think this demo does not belong in CPython repository. Perhaps it should be written as a demo for helioviewer API and be part of helioviewer documentation. We already have a documentation for urllib for how to make API calls. ---------- nosy: +Mariatta resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 02:11:25 2020 From: report at bugs.python.org (Rishav Kundu) Date: Sun, 02 Aug 2020 06:11:25 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1596348685.22.0.484898151998.issue41410@roundup.psfhosted.org> Change by Rishav Kundu : ---------- keywords: +patch nosy: +xrisk nosy_count: 3.0 -> 4.0 pull_requests: +20844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 02:21:47 2020 From: report at bugs.python.org (Rishav Kundu) Date: Sun, 02 Aug 2020 06:21:47 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1596349307.11.0.985311661892.issue41410@roundup.psfhosted.org> Rishav Kundu added the comment: Submitted a PR. Please let me know if I missed something :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 02:40:35 2020 From: report at bugs.python.org (Guo Xiyong) Date: Sun, 02 Aug 2020 06:40:35 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over Message-ID: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> New submission from Guo Xiyong : code like this: import asyncio import time import threading def sync_test(): time.sleep(1) async def run_test(): loop = asyncio.get_event_loop() for _ in range(10): # r = await loop.getaddrinfo('wq.io', 443) # print(r) loop.run_in_executor(None, sync_test) for t in threading.enumerate(): print(t) while True: await asyncio.sleep(1) asyncio.run(run_test()) after run, the 10 thread will always exist ---------- components: asyncio messages: 374679 nosy: asvetlov, cielpy, yselivanov priority: normal severity: normal status: open title: loop.run_in_executor creat thread but not destory it after the task run over versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 03:27:29 2020 From: report at bugs.python.org (Amir Mohamadi) Date: Sun, 02 Aug 2020 07:27:29 +0000 Subject: [issue41395] pickle and pickletools cli interface doesn't close input and output file. In-Reply-To: <1595686330.63.0.838691465271.issue41395@roundup.psfhosted.org> Message-ID: <1596353249.14.0.148699993498.issue41395@roundup.psfhosted.org> Change by Amir Mohamadi : ---------- nosy: +Amir nosy_count: 6.0 -> 7.0 pull_requests: +20845 pull_request: https://github.com/python/cpython/pull/21702 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 04:23:22 2020 From: report at bugs.python.org (Yaroslav) Date: Sun, 02 Aug 2020 08:23:22 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596356602.24.0.765183997462.issue41455@roundup.psfhosted.org> Yaroslav added the comment: As I can see here https://github.com/python/devguide/blob/master/garbage_collector.rst#collecting-the-oldest-generation > the GC only triggers a full collection of the oldest generation if the ratio long_lived_pending / long_lived_total is above a given value (hardwired to 25%) But in the python docs here https://docs.python.org/3.10/library/gc.html#gc.set_threshold > When the number of allocations minus the number of deallocations exceeds threshold0, collection starts. Initially only generation 0 is examined. If generation 0 has been examined more than threshold1 times since generation 1 has been examined, then generation 1 is examined as well. Similarly, threshold2 controls the number of collections of generation 1 before collecting generation 2. As I can see here: https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L1456 the first one is correct. We should probably fix python docs accordingly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 04:36:14 2020 From: report at bugs.python.org (Roundup Robot) Date: Sun, 02 Aug 2020 08:36:14 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596357374.71.0.765645188204.issue41455@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +20846 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21703 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 04:37:33 2020 From: report at bugs.python.org (Yaroslav) Date: Sun, 02 Aug 2020 08:37:33 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596357453.12.0.879601868324.issue41455@roundup.psfhosted.org> Yaroslav added the comment: Here's opened PR. https://github.com/python/cpython/pull/21703 ---------- nosy: -python-dev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 05:50:11 2020 From: report at bugs.python.org (Ram Rachum) Date: Sun, 02 Aug 2020 09:50:11 +0000 Subject: [issue41457] Implement random.shuffled Message-ID: <1596361811.95.0.711891724377.issue41457@roundup.psfhosted.org> New submission from Ram Rachum : Writing the patch now. Thread: https://mail.python.org/archives/list/python-ideas at python.org/thread/OHLXVKIBMNSQO6BCFK6LEHSYNXDB6OQJ/ ---------- components: Library (Lib) messages: 374683 nosy: cool-RR priority: normal severity: normal status: open title: Implement random.shuffled type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 05:52:33 2020 From: report at bugs.python.org (Ram Rachum) Date: Sun, 02 Aug 2020 09:52:33 +0000 Subject: [issue41457] Implement random.shuffled In-Reply-To: <1596361811.95.0.711891724377.issue41457@roundup.psfhosted.org> Message-ID: <1596361953.62.0.240397889358.issue41457@roundup.psfhosted.org> Change by Ram Rachum : ---------- keywords: +patch pull_requests: +20848 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 06:01:11 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 02 Aug 2020 10:01:11 +0000 Subject: [issue41457] Implement random.shuffled In-Reply-To: <1596361811.95.0.711891724377.issue41457@roundup.psfhosted.org> Message-ID: <1596362471.06.0.0793959236461.issue41457@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 06:50:09 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 02 Aug 2020 10:50:09 +0000 Subject: [issue41457] Implement random.shuffled In-Reply-To: <1596361811.95.0.711891724377.issue41457@roundup.psfhosted.org> Message-ID: <1596365409.05.0.882826059916.issue41457@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a duplicate of issue26393 and issue27964. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> random.shuffled _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 08:25:48 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 02 Aug 2020 12:25:48 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596371148.86.0.560881150943.issue38628@roundup.psfhosted.org> Ronald Oussoren added the comment: David, is the issue you mention in your message at 2020-02-05 reproducible with valid usage of ctypes (that is, by calling a C function with the correct signature)? What do you mean with "this is documented in Python ctypes"? ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 11:30:05 2020 From: report at bugs.python.org (David Edelsohn) Date: Sun, 02 Aug 2020 15:30:05 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596382205.95.0.00131352260102.issue38628@roundup.psfhosted.org> David Edelsohn added the comment: I thought that the ctypes documentation mentioned that Arrays passed by Value are converted to Structures. I cannot find it in the ctypes documentation at the moment. But Modules/_ctypes/stgdict.c has a large comment about passing Arrays by Value as Structs. * See bpo-22273. Arrays are normally treated as pointers, which is * fine when an array name is being passed as parameter, but not when * passing structures by value that contain arrays. On 64-bit Linux, * small structures passed by value are passed in registers, and in * order to do this, libffi needs to know the true type of the array * members of structs. Treating them as pointers breaks things. The comment proceeds to discuss 64-bit Linux, which means x86_64 Linux. Python ctypes coerces the array into a structure, which works on x86_64 Linux. Something about the libffi descriptor created by Python ctypes does not work correctly for AIX, and it may be a fundamental difference in the alignment and padding rules for passing Arrays versus Structures. Python ctypes assumes that Arrays and Structures are interchangeable with respect to argument passing. And, again, the initial example was completely wrong and illegal and not expected to work because it created a data object that doesn't match the function signature, which happened to behave correctly on x86. The initial example in the bug report repeatedly confuses people because they continually try to debug an incorrect use of ctypes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 15:06:17 2020 From: report at bugs.python.org (Alexey Namyotkin) Date: Sun, 02 Aug 2020 19:06:17 +0000 Subject: [issue7291] urllib2 cannot handle https with proxy requiring auth In-Reply-To: <1257741498.16.0.683281197284.issue7291@psf.upfronthosting.co.za> Message-ID: <1596395177.86.0.901225982397.issue7291@roundup.psfhosted.org> Alexey Namyotkin added the comment: It has been 5 years, now the urllib3 is actively used, but it also inherited this problem: if no authentication data has been received, then the method _tunnel raises an exception OSError that does not contain response headers. Accordingly, this exception cannot be handled. And perhaps this is an obstacle to building a convenient system of authentication on a proxy server in a widely used library requests (it would be nice to be able to just provide an argument proxy_auth, similar to how it is done for server authorization). Now, if a user wants to send a https request through a proxy that requires complex authentication (Kerberos, NTLM, Digest, other) using the urllib3, he must first send a separate request to the proxy, receive a response, extract the necessary data to form the header Proxy-Authorization, then generate this header and pass it to the ProxyManager. And if we are talking about Requests, then the situation there is worse, because you cannot pass proxy headers directly (https://github.com/psf/requests/issues/2708). If we were to aim to simplify the authentication procedure on the proxy server for the user, then where would we start, do we need to change the http.client so that the error returned by the method _tunnel contains headers? Or maybe it's not worth changing anything at all and the path with preliminary preparation by user of the header Proxy-Authorization is the only correct one? Martin Panter, could you also give your opinion? Thank you in advance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 15:09:31 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 Aug 2020 19:09:31 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596395371.24.0.541562467934.issue41425@roundup.psfhosted.org> Terry J. Reedy added the comment: Look at the next subsection for example with 1. and 2. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 15:17:12 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 Aug 2020 19:17:12 +0000 Subject: [issue41439] test_uuid.py and test_ssl.py failures on OS without os.fork In-Reply-To: <1596089205.38.0.465991237875.issue41439@roundup.psfhosted.org> Message-ID: <1596395832.58.0.246142616381.issue41439@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: some test cases in test_uuid.py and test_ssl.py fail on some operating systems because of no os.fork support -> test_uuid.py and test_ssl.py failures on OS without os.fork _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 15:28:45 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 Aug 2020 19:28:45 +0000 Subject: [issue41439] test_uuid.py and test_ssl.py failures on OS without os.fork In-Reply-To: <1596089205.38.0.465991237875.issue41439@roundup.psfhosted.org> Message-ID: <1596396525.72.0.409028605817.issue41439@roundup.psfhosted.org> Terry J. Reedy added the comment: Are this and similar issues theoretical ("if Python were implemented on such systems...") or actual ("python is implemented on one such system (VxWorks?) and these tests fail"). If the latter, does the test suite pass at least with respect to, in this case, os.fork? I expect that there are other tests that depend on os.fork, but maybe they are already guarded. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 15:41:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 Aug 2020 19:41:20 +0000 Subject: [issue41439] test_uuid.py and test_ssl.py failure on OSes without os.fork In-Reply-To: <1596089205.38.0.465991237875.issue41439@roundup.psfhosted.org> Message-ID: <1596397280.14.0.17164759212.issue41439@roundup.psfhosted.org> Terry J. Reedy added the comment: Similar issues: #41440 os.cpu_count #41442 unix shell #41443 some posix.x functions PR 21684 is fine as far as it goes, and I could merge and backport, but I don't know about our test policy with respect to need and minimized OSes. We do not put conditions for unsupported oses in production code, but I don't know about skips for such systems in tests. Victor, do you know, or know who would? ---------- nosy: +vstinner title: test_uuid.py and test_ssl.py failures on OS without os.fork -> test_uuid.py and test_ssl.py failure on OSes without os.fork _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 16:02:42 2020 From: report at bugs.python.org (Nathan Maynes) Date: Sun, 02 Aug 2020 20:02:42 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596398562.27.0.188028825862.issue41424@roundup.psfhosted.org> Nathan Maynes added the comment: I'd like to create a pull request for this issue. Should be able to complete it this evening. ---------- nosy: +nmaynes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 16:03:18 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 02 Aug 2020 20:03:18 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() Message-ID: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> New submission from Raymond Hettinger : For float inputs, the math.prod() function could be made smarter about avoiding overflow() and underflow(). That would also improve commutativity as well. Other tools like math.hypot() already take measures to avoid overflow/underflow and to improve commutativity. This makes them nicer to use than n?ive implementations. The recipe that I've been using for years is shown below. It certainly isn't the best way, but it is O(n) and always avoids overflow and underflow when possible. It has made for a nice primitive when implementing other functions that need to be as robust as possible. For example, in the quadratic formula, the ?(b?-4ac) factors to b?(1-4ac/b?) and the rightmost term gets implemented in Python as product([4.0, a, c, 1.0/b, 1.0/b]). >>> from math import prod, fabs >>> from collections import deque >>> from itertools import permutations >>> def product(seq): s = deque() for x in seq: s.appendleft(x) if fabs(x) < 1.0 else s.append(x) while len(s) > 1: x = s.popleft() * s.pop() s.appendleft(x) if fabs(x) < 1.0 else s.append(x) return s[0] if s else 1.0 >>> data = [2e300, 2e200, 0.5e-150, 0.5e-175] >>> for factors in permutations(data): print(product(factors), prod(factors), sep='\t') 1e+175 inf 1.0000000000000001e+175 inf 1e+175 inf 1e+175 1e+175 1.0000000000000001e+175 inf 1.0000000000000001e+175 1.0000000000000001e+175 1.0000000000000001e+175 inf 1e+175 inf 1.0000000000000001e+175 inf 1.0000000000000001e+175 1.0000000000000001e+175 1e+175 inf 1e+175 1e+175 1e+175 inf 1e+175 1e+175 1.0000000000000001e+175 inf 1.0000000000000001e+175 1.0000000000000001e+175 1e+175 0.0 1.0000000000000001e+175 0.0 1.0000000000000001e+175 inf 1.0000000000000001e+175 1.0000000000000001e+175 1e+175 inf 1e+175 1e+175 1.0000000000000001e+175 0.0 1e+175 0.0 For math.prod(), I think a better implementation would be to run normally until an underflow or overflow is detected, then back up a step and switch-over to pairing low and high magnitude values. Since this is fallback code, it would only affect speed to the extent that we test for overflow or underflow at every step. Given how branch prediction works, the extra tests might even be free or at least very cheap. The math module functions usually go the extra mile to be more robust (and often faster) than a n?ive implementation. These are the primary reasons we teach people to prefer sqrt() over x**2, log1p(x) over log(1+x), prod(seq) over reduce(mul, seq, 1.0), log2(x) over log(x, 2), fsum(seq) over sum(seq), and hypot(x,y) over sqrt(x**2 + y**2). In each case, the library function is some combination of more robust, more accurate, more commutative, and/or faster than a user can easily create for themselves. ---------- components: Library (Lib) messages: 374693 nosy: mark.dickinson, pablogsal, rhettinger, tim.peters priority: normal severity: normal status: open title: Avoid overflow/underflow in math.prod() type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 16:03:01 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 Aug 2020 20:03:01 +0000 Subject: [issue41440] os.cpu_count doesn't work on VxWorks RTOS In-Reply-To: <1596092864.05.0.11139024599.issue41440@roundup.psfhosted.org> Message-ID: <1596398581.67.0.313662593357.issue41440@roundup.psfhosted.org> Terry J. Reedy added the comment: Do you know if any core devs have experience with VxWorks? It is not even listed in https://devguide.python.org/experts/#platforms. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 16:05:24 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 02 Aug 2020 20:05:24 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596398724.25.0.94030099274.issue41424@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 16:07:05 2020 From: report at bugs.python.org (=?utf-8?q?Micka=C3=ABl_Schoentgen?=) Date: Sun, 02 Aug 2020 20:07:05 +0000 Subject: [issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError In-Reply-To: <1453545713.56.0.930101536202.issue26185@psf.upfronthosting.co.za> Message-ID: <1596398825.24.0.864325509869.issue26185@roundup.psfhosted.org> Micka?l Schoentgen added the comment: The ticket could be closed, right? The fix was merged quite some time ago. ---------- nosy: +Tiger-222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 16:56:15 2020 From: report at bugs.python.org (Guillaume) Date: Sun, 02 Aug 2020 20:56:15 +0000 Subject: [issue41459] pickle.load raises SystemError on malformed input Message-ID: <1596401775.19.0.63803368162.issue41459@roundup.psfhosted.org> New submission from Guillaume : pickle.load() raises a criptic SystemError with malformed input, whereas I would have expected an UnpicklingError. "SystemError: deallocated bytearray object has exported buffers" Because pickle is not meant for use on untrusted input, this likely would not be considered a servere issue. Reproducing: import pickle f = open("crash-95c0cb965cb66f5eebc778a1d2304eaffb72f1aa", "rb") d = pickle.load(f) ---------- components: Argument Clinic files: crash-95c0cb965cb66f5eebc778a1d2304eaffb72f1aa messages: 374695 nosy: Guillaume, larry priority: normal severity: normal status: open title: pickle.load raises SystemError on malformed input versions: Python 3.8 Added file: https://bugs.python.org/file49358/crash-95c0cb965cb66f5eebc778a1d2304eaffb72f1aa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 17:05:58 2020 From: report at bugs.python.org (Guillaume) Date: Sun, 02 Aug 2020 21:05:58 +0000 Subject: [issue41459] pickle.load raises SystemError on malformed input In-Reply-To: <1596401775.19.0.63803368162.issue41459@roundup.psfhosted.org> Message-ID: <1596402358.86.0.80896247865.issue41459@roundup.psfhosted.org> Guillaume added the comment: Updated Components. I believe pickle fit in the Library category. Note this was discovered with python 3.8.5 ---------- components: +Library (Lib) -Argument Clinic _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 17:08:53 2020 From: report at bugs.python.org (Larry Hastings) Date: Sun, 02 Aug 2020 21:08:53 +0000 Subject: [issue41459] pickle.load raises SystemError on malformed input In-Reply-To: <1596401775.19.0.63803368162.issue41459@roundup.psfhosted.org> Message-ID: <1596402533.84.0.0997675904087.issue41459@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 17:21:02 2020 From: report at bugs.python.org (Ned Deily) Date: Sun, 02 Aug 2020 21:21:02 +0000 Subject: [issue26185] zipfile.ZipInfo slots can raise unexpected AttributeError In-Reply-To: <1453545713.56.0.930101536202.issue26185@psf.upfronthosting.co.za> Message-ID: <1596403262.07.0.300630549983.issue26185@roundup.psfhosted.org> Ned Deily added the comment: Fixed in 3.9.0 ---------- nosy: +ned.deily resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 17:40:36 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 02 Aug 2020 21:40:36 +0000 Subject: [issue41390] Errors and warnings on generate bytecode files In-Reply-To: <1595644759.87.0.69067267227.issue41390@roundup.psfhosted.org> Message-ID: <1596404436.85.0.19207344296.issue41390@roundup.psfhosted.org> Guido van Rossum added the comment: You're going to have to ignore that status or skip the offending files. ---------- nosy: +gvanrossum resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 18:24:07 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 02 Aug 2020 22:24:07 +0000 Subject: [issue41459] pickle.load raises SystemError on malformed input In-Reply-To: <1596401775.19.0.63803368162.issue41459@roundup.psfhosted.org> Message-ID: <1596407047.42.0.810392334179.issue41459@roundup.psfhosted.org> Eric V. Smith added the comment: As a rule, we don't put a lot of effort into handling malformed pickle input. Is this causing some practical problem? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 18:33:01 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 02 Aug 2020 22:33:01 +0000 Subject: [issue40979] typing module docs: keep text, add subsections In-Reply-To: <1592164571.1.0.235029301981.issue40979@roundup.psfhosted.org> Message-ID: <1596407581.91.0.774565414822.issue40979@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset ab72fdeb82c3ab045b480cd4bb4f928c12653ecb by Luciano Ramalho in branch 'master': bpo-40979: refactored typing.rst; (mostly) same content, new sub-sections and ordering (#21574) https://github.com/python/cpython/commit/ab72fdeb82c3ab045b480cd4bb4f928c12653ecb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 18:34:02 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 02 Aug 2020 22:34:02 +0000 Subject: [issue40979] typing module docs: keep text, add subsections In-Reply-To: <1592164571.1.0.235029301981.issue40979@roundup.psfhosted.org> Message-ID: <1596407642.51.0.951188961243.issue40979@roundup.psfhosted.org> Guido van Rossum added the comment: Thank you so much for your hard work and flexibility! The chapter is in much better shape now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 19:11:53 2020 From: report at bugs.python.org (Luciano Ramalho) Date: Sun, 02 Aug 2020 23:11:53 +0000 Subject: [issue40978] Document that typing.SupportsXXX protocols are runtime checkable In-Reply-To: <1592163787.83.0.523481527574.issue40978@roundup.psfhosted.org> Message-ID: <1596409913.57.0.946000539482.issue40978@roundup.psfhosted.org> Luciano Ramalho added the comment: The merged PR that fixed https://bugs.python.org/issue40979 also fixes this issue. It is now documented that these protocols are runtime checkable, with caveats. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 20:11:34 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 00:11:34 +0000 Subject: [issue40978] Document that typing.SupportsXXX protocols are runtime checkable In-Reply-To: <1592163787.83.0.523481527574.issue40978@roundup.psfhosted.org> Message-ID: <1596413494.96.0.259366830826.issue40978@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks, I was looking for this. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 20:18:34 2020 From: report at bugs.python.org (Howard A. Landman) Date: Mon, 03 Aug 2020 00:18:34 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596413914.24.0.314205970425.issue41335@roundup.psfhosted.org> Howard A. Landman added the comment: Made some progress. By running it under gdb and breaking in malloc_printerr(), I got a better stack trace: Breakpoint 1, malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341 5341 malloc.c: No such file or directory. (gdb) bt #0 malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341 #1 0x76d44d50 in _int_free (av=0x76e1f7d4 , p=0x43417c , have_lock=) at malloc.c:4165 #2 0x001b4f40 in list_dealloc (op=0x760ef288) at ../Objects/listobject.c:324 #3 0x001be784 in frame_dealloc ( f=Frame 0x765fcc30, for file /home/pi/src/QTD/src/tdc7201/tdc7201/__init__.py, line 719, in read_regs24 (i=40, reg=28)) at ../Objects/frameobject.c:470 #4 function_code_fastcall (globals=, nargs=, args=, co=) at ../Objects/call.c:291 #5 _PyFunction_FastCallKeywords (func=, stack=, nargs=, kwnames=) at ../Objects/call.c:408 #6 0x0011f984 in call_function (kwnames=0x0, oparg=, pp_stack=0x7effed40) at ../Python/ceval.c:4554 #7 _PyEval_EvalFrameDefault (f=, throwflag=) at ../Python/ceval.c:3110 #8 0x0011d63c in PyEval_EvalFrameEx (throwflag=0, f=Frame 0x760e8960, for file /home/pi/src/QTD/src/tdc7201/tdc7201/__init__.py, line 962, in measure (self=, reg1=[130, 66, 0, 7, 255, 255, 6, 64, 0, 1, 65535, 1600, Breakpoint 1, malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341 5341 malloc.c: No such file or directory. (gdb) bt #0 malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341 #1 0x76d44d50 in _int_free (av=0x76e1f7d4 , p=0x43417c , have_lock=) at malloc.c:4165 #2 0x001b4f40 in list_dealloc (op=0x760ef288) at ../Objects/listobject.c:324 #3 0x001be784 in frame_dealloc ( f=Frame 0x765fcc30, for file /home/pi/src/QTD/src/tdc7201/tdc7201/__init__.py, line 719, in read_regs24 (i=40, reg=28)) at ../Objects/frameobject.c:470 #4 function_code_fastcall (globals=, nargs=, args=, co=) at ../Objects/call.c:291 #5 _PyFunction_FastCallKeywords (func=, stack=, nargs=, kwnames=) at ../Objects/call.c:408 #6 0x0011f984 in call_function (kwnames=0x0, oparg=, pp_stack=0x7effed40) at ../Python/ceval.c:4554 #7 _PyEval_EvalFrameDefault (f=, throwflag=) at ../Python/ceval.c:3110 #8 0x0011d63c in PyEval_EvalFrameEx (throwflag=0, f=Frame 0x760e8960, for file /home/pi/src/QTD/src/tdc7201/tdc7201/__init__.py, line 962, in measure (self=, reg1=[130, 66, 0, 7, 255, 255, 6, 64, 0, 1, 65535, 1600, 1, None, None, None, 1284, 322, 2371, 0, 0, 0, 0, 0, 0, 0, 0, 2322, 23172, None], chip_select=1, sclk=23, miso=21, mosi=19, cs1=24, cs2=26, enable=12, osc_enable=16, trig1=7, int1=37, trig2=None, int2=None, start=18, stop=22, meas_mode=2, cal_pers=10, cal_count=, norm_lsb=, tof1=, tof2=, tof3=0, tof4=0, tof5=0) at remote 0x76191750>, simulate=True, error_prefix='59835 ', log_file=<_io.TextIOWrapper at remote 0x761df4b0>, cf1=130, timeout=, n_stop=3, threshold=, pulse=2)) at ../Python/ceval.c:3930 1, None, None, None, 1284, 322, 2371, 0, 0, 0, 0, 0, 0, 0, 0, 2322, 23172, None], chip_select=1, sclk=23, miso=21, mosi=19, cs1=24, cs2=26, enable=12, osc_enable=16, trig1=7, int1=37, trig2=None, int2=None, start=18, stop=22, meas_mode=2, cal_pers=10, cal_count=, norm_lsb=, tof1=, tof2=, tof3=0, tof4=0, tof5=0) at remote 0x76191750>, simulate=True, error_prefix='59835 ', log_file=<_io.TextIOWrapper at remote 0x761df4b0>, cf1=130, timeout=, n_stop=3, threshold=, pulse=2)) at ../Python/ceval.c:3930 ... read_regs24 (i=40, reg=28) performs an SPI read of 13 24-bit registers (so 39 bytes); the corresponding Python code is: def read_regs24(self): """Read all 24-bit chip registers, using auto-increment feature.""" result24 = self._spi.xfer([self.MINREG24|self._AI, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) #print("AI read 24-bits =", result24) #print("length =", len(result24)) i = 1 for reg in range(self.MINREG24, self.MAXREG24+1): # Data comes in MSB first. self.reg1[reg] = (result24[i] << 16) | (result24[i+1] << 8) | result24[i+2] i += 3 The zero padding is necessary to make sure that enough SPI clock cycles are sent for the data bytes to get clocked back in. The _AI flag turns on auto-increment, so each byte is from the next address. So it looks like the bug is either in the spidev library, or in Python deallocation of this frame. I'll try pulling the sent data list outside the method, since it is always the same; that will avoid the list alloc/dealloc, and may even slightly speed up the program. If that fixes the problem, it's in Python; if it doesn't, it's in spidev. Probably. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 20:31:54 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 00:31:54 +0000 Subject: [issue41398] cgi module, parse_multipart fails In-Reply-To: <1595757503.98.0.375306375596.issue41398@roundup.psfhosted.org> Message-ID: <1596414714.72.0.260730065209.issue41398@roundup.psfhosted.org> Guido van Rossum added the comment: So per the stackoverflow explanation you shouldn?t do that? Should we close this? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 20:47:31 2020 From: report at bugs.python.org (Roundup Robot) Date: Mon, 03 Aug 2020 00:47:31 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596415651.77.0.721511377886.issue41425@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +20849 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 20:53:52 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 00:53:52 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596416032.71.0.520727316162.issue41449@roundup.psfhosted.org> Guido van Rossum added the comment: Maybe you?ll get some explanation or pointers on python-list. Or were you volunteering to write something? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 20:57:01 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 00:57:01 +0000 Subject: [issue41447] Resource Tracker in Multiprocessing Shared Memory not working correctly In-Reply-To: <1596129575.64.0.828449737414.issue41447@roundup.psfhosted.org> Message-ID: <1596416221.04.0.331561528984.issue41447@roundup.psfhosted.org> Guido van Rossum added the comment: Looks like a duplicate of https://bugs.python.org/issue38119 ---------- nosy: +gvanrossum resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 21:40:32 2020 From: report at bugs.python.org (Nathan Maynes) Date: Mon, 03 Aug 2020 01:40:32 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596418831.99.0.814186058713.issue41424@roundup.psfhosted.org> Change by Nathan Maynes : ---------- keywords: +patch pull_requests: +20850 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 22:13:34 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Aug 2020 02:13:34 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596420814.21.0.394412349292.issue41424@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20853 pull_request: https://github.com/python/cpython/pull/21709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 22:13:26 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Aug 2020 02:13:26 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596420806.78.0.780824140356.issue41424@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20852 pull_request: https://github.com/python/cpython/pull/21708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 22:13:10 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Aug 2020 02:13:10 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596420790.36.0.0147189819702.issue41424@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset ecaf949cc487887883c14dff7a96e09ac9404994 by Nathan M in branch 'master': bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707) https://github.com/python/cpython/commit/ecaf949cc487887883c14dff7a96e09ac9404994 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 22:19:52 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Aug 2020 02:19:52 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596421192.9.0.199706929417.issue41424@roundup.psfhosted.org> miss-islington added the comment: New changeset 905c7de6e4bbccf8c3dfa593fa287aecac497472 by Miss Islington (bot) in branch '3.9': bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707) https://github.com/python/cpython/commit/905c7de6e4bbccf8c3dfa593fa287aecac497472 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 23:19:06 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Aug 2020 03:19:06 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596424746.49.0.798901121946.issue41424@roundup.psfhosted.org> miss-islington added the comment: New changeset 45d37cbb04279a52c63dd180aacda7d35e02a0ef by Miss Islington (bot) in branch '3.8': bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707) https://github.com/python/cpython/commit/45d37cbb04279a52c63dd180aacda7d35e02a0ef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 2 23:19:45 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Aug 2020 03:19:45 +0000 Subject: [issue41424] [tkinter] Grammatical error in "Packer" docs In-Reply-To: <1595962807.42.0.795060125481.issue41424@roundup.psfhosted.org> Message-ID: <1596424785.24.0.130067192969.issue41424@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: -patch resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:03:56 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Aug 2020 04:03:56 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596427436.25.0.466924164646.issue41425@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset c36dbac588e1d99975f285a874bb20e9f5040af4 by Ankit Chandawala in branch 'master': bpo-41425: Make tkinter doc example runnable (GH-21706) https://github.com/python/cpython/commit/c36dbac588e1d99975f285a874bb20e9f5040af4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:08:14 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Aug 2020 04:08:14 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596427694.34.0.133450057351.issue41425@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20854 pull_request: https://github.com/python/cpython/pull/21710 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:08:22 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 03 Aug 2020 04:08:22 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596427702.33.0.0071150257995.issue41425@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20855 pull_request: https://github.com/python/cpython/pull/21711 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:18:09 2020 From: report at bugs.python.org (=?utf-8?b?5p2O5Yaw?=) Date: Mon, 03 Aug 2020 04:18:09 +0000 Subject: [issue41460] Translation Error in in Functional Programming HOWTO page Message-ID: <1596428289.44.0.783644077267.issue41460@roundup.psfhosted.org> New submission from ?? : There seems a translation error in Python Documentation in Functional Programming HOWTO page. The page's English version's url is https://docs.python.org/3/howto/functional.html And the Japanese version's url is https://docs.python.org/ja/3/howto/functional.html. In English version, there is a paragraph: "In declarative languages, you write a specification that describes the problem to be solved, and the language implementation figures out how to perform the computation efficiently. SQL is the declarative language you?re most likely to be familiar with; a SQL query describes the data set you want to retrieve, and the SQL engine decides whether to scan tables or use indexes, which subclauses should be performed first, etc." The corresponding Japanses translation is this: "??? ???????????????????????????????????????????????????????????SQL ????????????????????; SQL ??????????????????????????????????????????????????????????????????????? SQL ?????????" In the above paragraph, I think the translator translate the word "subclauses" to "??????", which is wrong. In Japanese, ?? means sub and ???? means close, so it is just "subclose", not "subclause". That is all. Thank you. ---------- messages: 374713 nosy: mydairyyao priority: normal severity: normal status: open title: Translation Error in in Functional Programming HOWTO page type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:21:48 2020 From: report at bugs.python.org (Anatoli Babenia) Date: Mon, 03 Aug 2020 04:21:48 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596428508.43.0.172805485402.issue41449@roundup.psfhosted.org> Anatoli Babenia added the comment: Not sure I can volunteer - need to find a sustenance ASAP. But given that nothing moved in this direction over the past 6 months, another week spent not writing this stuff won't change anything. In any case it would start with the following problem - "Logs don't show up if running in Kubernetes" - https://github.com/bottlepy/bottle/issues/1130 I've encountered it a 3 days session on adding CI to my favourite cheat sheet server https://github.com/chubin/cheat.sh/pull/224/commits/10bfaab38cc649d765637bf4af4791266d21a3f7 and I am still not sure I am right. That's why I want to read something about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:23:37 2020 From: report at bugs.python.org (Hiroshi Miura) Date: Mon, 03 Aug 2020 04:23:37 +0000 Subject: [issue41210] Docs: More description of reason about LZMA1 data handling with FORMAT_ALONE In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org> Message-ID: <1596428617.39.0.00308153626186.issue41210@roundup.psfhosted.org> Hiroshi Miura added the comment: Here is a draft of additional text Usage of :const:`FILTER_LZMA1` with :const:`FORMAT_RAW` is not recommended. Because it may produce a wrong output in a certain condition, decompressing a combination of :const:`FILTER_LZMA1` and BCJ filters in :const:`FORMAT_RAW`. It is because LZMA1 format sometimes lacks End of Stream (EOS) mark that lead BCJ filters can not be flushed. I've tried to write without a description of liblzma implementation, but only a nature of API and file format specification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:25:06 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 04:25:06 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596428706.42.0.605578772084.issue41449@roundup.psfhosted.org> Guido van Rossum added the comment: I don't think that waiting another six months is going to make this happen either. Maybe you can petition realpython.com to publish something about this. Honestly it sounds like this ties too many different topics together to easily fit in the library docs: in order to make a large number of different use cases easy, how I/O works under the hood in Python is truly complex. So I'm going to close this rather than have it add to our issue count. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:25:12 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Aug 2020 04:25:12 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596428712.59.0.864061086312.issue41425@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 4bc8445c392e22fb926eeea50d3e943b6241affa by Miss Islington (bot) in branch '3.8': bpo-41425: Make tkinter doc example runnable (GH-21706) https://github.com/python/cpython/commit/4bc8445c392e22fb926eeea50d3e943b6241affa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:25:35 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Aug 2020 04:25:35 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596428735.69.0.8029637657.issue41425@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 3c4fc864ce931db90214c54d742062a80dbef7c4 by Miss Islington (bot) in branch '3.9': bpo-41425: Make tkinter doc example runnable (GH-21706) https://github.com/python/cpython/commit/3c4fc864ce931db90214c54d742062a80dbef7c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:26:17 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 03 Aug 2020 04:26:17 +0000 Subject: [issue41425] [tkinter] "Coupling Widget Variables" example missing code In-Reply-To: <1595963290.36.0.00195793356515.issue41425@roundup.psfhosted.org> Message-ID: <1596428777.75.0.692156018324.issue41425@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: -patch resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:26:37 2020 From: report at bugs.python.org (Hiroshi Miura) Date: Mon, 03 Aug 2020 04:26:37 +0000 Subject: [issue41210] Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW In-Reply-To: <1593913885.93.0.828443713776.issue41210@roundup.psfhosted.org> Message-ID: <1596428797.81.0.564257494587.issue41210@roundup.psfhosted.org> Change by Hiroshi Miura : ---------- title: Docs: More description of reason about LZMA1 data handling with FORMAT_ALONE -> Docs: More description(warning) about LZMA1 + BCJ with FORMAT_RAW _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:29:35 2020 From: report at bugs.python.org (Anatoli Babenia) Date: Mon, 03 Aug 2020 04:29:35 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596428975.08.0.75046859165.issue41449@roundup.psfhosted.org> Anatoli Babenia added the comment: To avoid too much outside reference, the commit message I am unsure of is this. > Run Python 3 in unbuffered mode to see lines in `docker logs` as soon as they appear. When Python 3 is not attached to a terminal, it turns on the buffering, like when `docker` runs in a background. I am not sure. 1. How Python detects it is attached to terminal or not. 2. That it is Python that turns on stdout buffering. 3. What happens to stdout with child processes when they run with docker in different modes - foreground, background (-d), interactive (-i), with tty (-t) and without tty. ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:33:06 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 04:33:06 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596429186.2.0.477411368714.issue41449@roundup.psfhosted.org> Guido van Rossum added the comment: I don't know anything about Docker, so I can't help you there. Please don't reopen the issue again. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:48:13 2020 From: report at bugs.python.org (Anatoli Babenia) Date: Mon, 03 Aug 2020 04:48:13 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596430093.7.0.160153821708.issue41449@roundup.psfhosted.org> Anatoli Babenia added the comment: I didn't reopen the issue explicitly. Just pressed the submit button again when the notification about edited bug appeared. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:49:46 2020 From: report at bugs.python.org (Anatoli Babenia) Date: Mon, 03 Aug 2020 04:49:46 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596430186.7.0.54395732933.issue41449@roundup.psfhosted.org> Anatoli Babenia added the comment: The point is that without a clear description of buffering in Python 3, it is impossible to understand what goes when Python is wrapped by Docker, supervisord, redirected to file etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 00:52:47 2020 From: report at bugs.python.org (Brian Vandenberg) Date: Mon, 03 Aug 2020 04:52:47 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596430367.02.0.670659023138.issue29269@roundup.psfhosted.org> Brian Vandenberg added the comment: Solaris will be around for at least another 10-15 years. The least you could do is look into it and offer some speculations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 01:50:20 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 03 Aug 2020 05:50:20 +0000 Subject: [issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C) In-Reply-To: <1594314108.83.0.615817711225.issue41260@roundup.psfhosted.org> Message-ID: <1596433820.04.0.374087362479.issue41260@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +20856 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21712 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 01:54:27 2020 From: report at bugs.python.org (Shantanu) Date: Mon, 03 Aug 2020 05:54:27 +0000 Subject: [issue28002] ast.unparse can't roundtrip some f-strings In-Reply-To: <1473268698.62.0.800338957351.issue28002@psf.upfronthosting.co.za> Message-ID: <1596434067.91.0.830673956384.issue28002@roundup.psfhosted.org> Shantanu added the comment: Just bumping this issue, as per dev guide, since https://github.com/python/cpython/pull/19612 has been ready for about two months. Would be grateful for review :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 03:06:46 2020 From: report at bugs.python.org (Michael Felt) Date: Mon, 03 Aug 2020 07:06:46 +0000 Subject: [issue41461] test_pathlib assumes underlying filesystem permits creation with world-write permissions Message-ID: <1596438406.32.0.128608739111.issue41461@roundup.psfhosted.org> New submission from Michael Felt : Two tests in test_pathlib test that the files created have mode o666 (rw-rw-rw). However, on a filesystem (in my case NFS) configured to never permit global write - the test will always fail. Is this something to be concerned about? I can think of a few possible ways to react to an exception such as this, e.g., rather than 'FAIL' outright, try umask(2). ++++++++ ====================================================================== FAIL: test_open_mode (test.test_pathlib.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/prj/python/src/py38-3.8.5/Lib/test/test_pathlib.py", line 2210, in test_open_mode self.assertEqual(stat.S_IMODE(st.st_mode), 0o666) AssertionError: 436 != 438 ====================================================================== FAIL: test_touch_mode (test.test_pathlib.PosixPathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/prj/python/src/py38-3.8.5/Lib/test/test_pathlib.py", line 2223, in test_touch_mode self.assertEqual(stat.S_IMODE(st.st_mode), 0o666) AssertionError: 436 != 438 ---------------------------------------------------------------------- ++++++++ Just to verify it does work when on a 'local' filesystem. cp -rp build /tmp/build mv build build.nfs ln -s /tmp/build build == Tests result: SUCCESS == 1 test OK. Total duration: 7.8 sec Tests result: SUCCESS ---------- components: Tests messages: 374725 nosy: Michael.Felt priority: normal severity: normal status: open title: test_pathlib assumes underlying filesystem permits creation with world-write permissions type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 03:35:24 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 03 Aug 2020 07:35:24 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596440124.61.0.561625297783.issue38628@roundup.psfhosted.org> Ronald Oussoren added the comment: Thanks for the code reference. I'm not a ctypes expert, but do maintain another project using libffi. The comment in stgdict.c is correct, and that code is used for all platforms. However, code to embed arrays into a struct (as described int the comment) is only used for structs with a size smaller than 16 bytes (MAX_STRUCT_SIZE), which AFAIK is not correct. My other project does something similar, but for all struct sizes. That said, I haven't studied the ctypes code in detail yet. As a quick test you could check if increasing MAX_STRUCT_SIZE to (say) 32 fixes this particular example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 04:10:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 03 Aug 2020 08:10:12 +0000 Subject: [issue41435] Allow to retrieve ongoing exception handled by every threads In-Reply-To: <1596037186.46.0.97878619969.issue41435@roundup.psfhosted.org> Message-ID: <1596442212.32.0.0421586912961.issue41435@roundup.psfhosted.org> Serhiy Storchaka added the comment: Would not be more useful to add a method to the Thread or frame object to obtain the topmost handled exception? Then you could iterate all threads or frames and obtain exceptions together with other useful information. Note also that it omits exceptions in generators and coroutines. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 04:38:38 2020 From: report at bugs.python.org (Julien Danjou) Date: Mon, 03 Aug 2020 08:38:38 +0000 Subject: [issue41435] Allow to retrieve ongoing exception handled by every threads In-Reply-To: <1596037186.46.0.97878619969.issue41435@roundup.psfhosted.org> Message-ID: <1596443918.11.0.36059188103.issue41435@roundup.psfhosted.org> Julien Danjou added the comment: Adding to the thread object might be a good idea, but it does not work if you ever start threads with the low-level `_thread` API. It's also a different design from the existing `sys._current_frames`. Adding it on top of a frame is interesting though. I think internally it's more linked to the execution stack in a thread than to a frame, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 04:40:54 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 03 Aug 2020 08:40:54 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596444054.39.0.970632248437.issue38628@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 05:39:54 2020 From: report at bugs.python.org (E. Paine) Date: Mon, 03 Aug 2020 09:39:54 +0000 Subject: [issue41075] IDLE: Better support history navigation In-Reply-To: <1592824587.6.0.226335506835.issue41075@roundup.psfhosted.org> Message-ID: <1596447594.94.0.807620661351.issue41075@roundup.psfhosted.org> E. Paine added the comment: > but not with binding to modifier-up/down. I cannot reproduce. I have tested on both Windows and Linux and found I could successfully change to (and use) the modifier-up/down bindings both through the Keys page of the configdialog and by editing the keys def. There was no traceback on either platform. @wyz23x2, can you reproduce this problem? My personal preference for the new bindings, when tested, was alt-up/down as it is most similar to the existing bindings. Also, control-up/down is used in other apps for moving the cursor multiple lines at a time and shift-up/down (at least in my mind) seems like a weird/random choice. Terry, I don't know what you have in mind, but I think these bindings should be in addition to the existing ones rather than instead of (I also tested this and found it to work correctly). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 05:48:25 2020 From: report at bugs.python.org (Tony Reix) Date: Mon, 03 Aug 2020 09:48:25 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596448105.23.0.214850016631.issue38628@roundup.psfhosted.org> Tony Reix added the comment: After more investigations, we (Damien and I) think that there are several issues in Python 3.8.5 : 1) Documentation. a) AFAIK, the only place in the Python ctypes documentation where it talks about how arrays in a structure are managed appears at: https://docs.python.org/3/library/ctypes.html#arrays b) the size of the structure in the example given here is much greater than in our case. c) The documentation does NOT talk that a structure <= 16 bytes and a structure greater than 16 bytes are managed differently. That's a bug in the documentation vs the code. 2) Tests Looking at tests, there are NO test about our case. 3) There is a bug in Python About the issue here, we see with gdb that Python provides libffi with a description saying that our case is passed as pointers. However, Python does NOT provides libffi with pointers for the array c_n, but with values. 4) libffi obeys Python directives given in description, thinking that it deals with 2 pointers, and thus it pushes only 2 values in registers R3 and R4. ===================================================== Bug in Python: ----------------------------------------------------- 1) gdb (gdb) b ffi_call Breakpoint 1 at 0x9000000016fab80: file ../src/powerpc/ffi_darwin.c, line 919. (gdb) run Starting program: /home2/freeware/bin/python3 /tmp/Pb_damien2.py Thread 2 hit Breakpoint 1, ffi_call (cif=0xfffffffffffd108, fn=@0x9001000a0082640: 0x9000000001b0d60 , rvalue=0xfffffffffffd1d0, avalue=0xfffffffffffd1c0) (gdb) p *(ffi_cif *)$r3 $9 = {abi = FFI_AIX, nargs = 2, arg_types = 0xfffffffffffd1b0, rtype = 0xa00000000435cb8, bytes = 144, flags = 8} (gdb) x/2xg 0xfffffffffffd1b0 0xfffffffffffd1b0: 0x0a0000000043ca48 0x08001000a0002a10 (gdb) p *(ffi_type *)0x0a0000000043ca48 $11 = {size = 16, alignment = 8, type = 13, elements = 0xa0000000012eed0} <= 13==FFI_TYPE_STRUCT size == 16 on AIX!!! == 24 on Linux (gdb) p *(ffi_type *)0x08001000a0002a10 $12 = {size = 8, alignment = 8, type = 14, elements = 0x0} <= FFI_TYPE_POINTER (gdb) x/3xg *(long *)$r6 0xa00000000436050: 0x0a00000000152200 0x0000000000000064 0xa00000000436060: 0x0000000000000007 <= 7 is present in avalue[2] (gdb) x/s 0x0a00000000152200 0xa00000000152200: "abcdef" ----------------------------------------------------- 2) prints in libffi: AIX : aix_adjust_aggregate_sizes() TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size:24 s->type:13 : FFI_TYPE_STRUCT TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() FFI_TYPE_STRUCT Before s->size:24 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size: 8 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() After ALIGN s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c: ffi_call: FFI_AIX TONY: libffi: cif->abi: 1 -(long)cif->bytes : -144 cif->flags : 8 ecif.rvalue : fffffffffffd200 fn: 9001000a0227760 FFI_FN(ffi_prep_args) : 9001000a050a108 s element : char pointer: a00000000153d40 abcdef c_n element 0: a Long: 100 0X64 = 100 instead of a pointer c_n element 1: a Long: 0 libffi obeys description given by Python and pushes to R4 only what it thinks is a pointer (100 instead), and nothing in R5 ==================================================================== Summary: - Python documentation is uncomplete vs the code - Python code gives libffi a description about pointers but Python code provides libffi with values. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 05:53:19 2020 From: report at bugs.python.org (Allan Chandler) Date: Mon, 03 Aug 2020 09:53:19 +0000 Subject: [issue41450] OSError is not documented in ssl library, but still can be thrown In-Reply-To: <1596206187.31.0.0863049661733.issue41450@roundup.psfhosted.org> Message-ID: <1596448399.58.0.109131183502.issue41450@roundup.psfhosted.org> Allan Chandler added the comment: If you look through the source for PyExc, you'll find items for (over and above OsError) ValueError, NotImplementedError, TypeError, OverflowError, AttributeError, MemoryError, UnicodeEncodeError, and RuntimeWarning. I don't think ANY of those are documented so are we going to fix them all? Or should we just list them as possibilities in the doco (or, even more vaguely, state that exceptions other than the documented SSL ones are also possible)? ---------- nosy: +paxdiablo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 05:53:47 2020 From: report at bugs.python.org (Peixing Xin) Date: Mon, 03 Aug 2020 09:53:47 +0000 Subject: [issue41462] os.set_blocking() raises OSError on VxWorks RTOS Message-ID: <1596448427.12.0.91446561871.issue41462@roundup.psfhosted.org> New submission from Peixing Xin : os.set_blocking() always raise OSError exception on VxWorks RTOS. See below for details. [vxWorks *]# python3 -m unittest -v test.test_os.BlockingTests.test_blocking Launching process 'python3' ... Process 'python3' (process Id = 0x405808010) launched. test_blocking (test.test_os.BlockingTests) ... ERROR ====================================================================== ERROR: test_blocking (test.test_os.BlockingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.8/test/test_os.py", line 3640, in test_blocking os.set_blocking(fd, False) OSError: [Errno 35] not supported ---------- components: Library (Lib) messages: 374732 nosy: pxinwr priority: normal severity: normal status: open title: os.set_blocking() raises OSError on VxWorks RTOS type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 06:07:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 10:07:01 +0000 Subject: [issue39017] [CVE-2019-20907] Infinite loop in the tarfile module In-Reply-To: <1575994796.67.0.46582695163.issue39017@roundup.psfhosted.org> Message-ID: <1596449221.36.0.381987139739.issue39017@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Infinite loop in the tarfile module -> [CVE-2019-20907] Infinite loop in the tarfile module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 06:10:13 2020 From: report at bugs.python.org (Peixing Xin) Date: Mon, 03 Aug 2020 10:10:13 +0000 Subject: [issue41462] os.set_blocking() raises OSError on VxWorks RTOS In-Reply-To: <1596448427.12.0.91446561871.issue41462@roundup.psfhosted.org> Message-ID: <1596449413.27.0.164536431345.issue41462@roundup.psfhosted.org> Change by Peixing Xin : ---------- keywords: +patch pull_requests: +20857 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21713 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 06:17:45 2020 From: report at bugs.python.org (E. Paine) Date: Mon, 03 Aug 2020 10:17:45 +0000 Subject: [issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10 In-Reply-To: <1594840353.83.0.567403527611.issue41306@roundup.psfhosted.org> Message-ID: <1596449865.03.0.871085014528.issue41306@roundup.psfhosted.org> E. Paine added the comment: +1 this issue. I have encountered this problem lots when testing patches and almost always just end up deleting the test_from method to get test_tk to pass. I am not sure of a solution, though, as we *need* to keep test compatibility with Tk 8.6.8 while (preferably) being able to recognise when the value is wrong for the given version. I hope to take a more in-depth look at the problem and possible solutions (I want to avoid, if possible, either checking the Tk version or allowing both 14.9 & 15.0 values to pass the test). ---------- components: +Tkinter nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 06:38:31 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 03 Aug 2020 10:38:31 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596451111.52.0.895438250772.issue41458@roundup.psfhosted.org> Mark Dickinson added the comment: This message from Tim, starting "I'd like to divorce `prod()` from floating-point complications", seems relevant here: https://bugs.python.org/issue35606#msg333090 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 07:00:15 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 03 Aug 2020 11:00:15 +0000 Subject: [issue41463] Avoid duplicating jump information from opcode.py in compile.c Message-ID: <1596452415.91.0.969194719265.issue41463@roundup.psfhosted.org> New submission from Mark Shannon : opcode.py declares which jumps are relative and which are absolute. We duplicate that information in compile.c We should generate lookup tables in opcodes.h and to repeating that information in compile.c ---------- messages: 374735 nosy: Mark.Shannon priority: normal severity: normal status: open title: Avoid duplicating jump information from opcode.py in compile.c type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 08:02:12 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 03 Aug 2020 12:02:12 +0000 Subject: [issue41463] Avoid duplicating jump information from opcode.py in compile.c In-Reply-To: <1596452415.91.0.969194719265.issue41463@roundup.psfhosted.org> Message-ID: <1596456132.72.0.436883868631.issue41463@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +20858 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 09:01:45 2020 From: report at bugs.python.org (E. Paine) Date: Mon, 03 Aug 2020 13:01:45 +0000 Subject: [issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10 In-Reply-To: <1594840353.83.0.567403527611.issue41306@roundup.psfhosted.org> Message-ID: <1596459705.89.0.538991716516.issue41306@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch pull_requests: +20859 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21715 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 12:21:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 16:21:41 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1596471701.17.0.698296510517.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: https://github.com/sphinx-doc/sphinx/pull/7905 has been merged and will be part of the next Sphinx 3.2 release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 12:40:49 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 03 Aug 2020 16:40:49 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596472849.79.0.501950836284.issue41458@roundup.psfhosted.org> Vedran ?a?i? added the comment: Yes, fprod would be nice [though if you just want to avoid over/underflows, much easier solution is to first determine the sign, then sum the logarithms of absolute values, and exponentiate that]. But I agree with Tim that it should be a separate function. For the same reason that sum is not fsum. (The reason prod is in math is bureaucratic, not ontologic.) ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 12:41:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 16:41:31 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596472891.85.0.463222178287.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a7f5d93bb6906d0f999248b47295d3a59b130f4d by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21449) https://github.com/python/cpython/commit/a7f5d93bb6906d0f999248b47295d3a59b130f4d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 12:47:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 16:47:45 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596473265.53.0.749400193788.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bb0424b122e3d222a558bd4177ce37befd3e0347 by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21451) https://github.com/python/cpython/commit/bb0424b122e3d222a558bd4177ce37befd3e0347 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 12:49:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 16:49:22 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596473362.53.0.817962126572.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4660597b51b3d14ce6269d0ed865ab7e22c6ae1f by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21448) https://github.com/python/cpython/commit/4660597b51b3d14ce6269d0ed865ab7e22c6ae1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 12:56:53 2020 From: report at bugs.python.org (E. Paine) Date: Mon, 03 Aug 2020 16:56:53 +0000 Subject: [issue41306] test_tk test_widgets.ScaleTest fails with Tk 8.6.10 In-Reply-To: <1594840353.83.0.567403527611.issue41306@roundup.psfhosted.org> Message-ID: <1596473813.08.0.682057666182.issue41306@roundup.psfhosted.org> E. Paine added the comment: For reference, I have opened https://core.tcl-lang.org/tk/tktview?name=81c3ef93148d17ff280d9a0b4c4edfce453b972f to report this to the Tk team and ask if this change in behaviour is intended. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:01:32 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Aug 2020 17:01:32 +0000 Subject: [issue41464] Increase Code Coverage for operator.py Message-ID: <1596474092.62.0.0191656863895.issue41464@roundup.psfhosted.org> New submission from Irit Katriel : Lib\operator.py currently missing coverage for not_, index and error cases of length_hint and iconcat. ---------- components: Tests messages: 374742 nosy: iritkatriel priority: normal severity: normal status: open title: Increase Code Coverage for operator.py versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:06:12 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Aug 2020 17:06:12 +0000 Subject: [issue41464] Increase Code Coverage for operator.py In-Reply-To: <1596474092.62.0.0191656863895.issue41464@roundup.psfhosted.org> Message-ID: <1596474372.03.0.663081055243.issue41464@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +20860 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21717 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:10:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 17:10:05 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596474605.86.0.27690727645.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: Recent exmaple on AMD64 Windows10 3.x: https://buildbot.python.org/all/#/builders/129/builds/1498 0:14:19 load avg: 0.10 [418/423/1] test_asyncio failed (env changed) (1 min 10 sec) -- running: test_mmap (4 min 47 sec), test_io (3 min 41 sec) Warning -- Unraisable exception Warning -- Unraisable exception ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:10:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 17:10:18 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596474618.46.0.375755513181.issue38912@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +20861 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21718 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:17:15 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 03 Aug 2020 17:17:15 +0000 Subject: [issue41464] Increase Code Coverage for operator.py In-Reply-To: <1596474092.62.0.0191656863895.issue41464@roundup.psfhosted.org> Message-ID: <1596475035.92.0.293796597572.issue41464@roundup.psfhosted.org> Irit Katriel added the comment: duplicates bpo-39664 ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:27:23 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 03 Aug 2020 17:27:23 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596475643.81.0.0600852032667.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: The existing math.prod() already has a separate code path for floats. The proposal is to add an overflow/underflow check to that existing path so that we don't get nonsense like 0.0, 1e+175, or Inf depending on the data ordering. That doesn't warrant a separate function. FWIW fsum() is a separate function for several reasons, none of which apply to the current proposal: 1) we didn't already have a math.sum(). 2) All inputs types get converted to float. 3) Even in common cases, it is measurably slower that sum(). 4) It has a different signature than sum(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:29:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 17:29:14 +0000 Subject: [issue41208] An exploitable segmentation fault in marshal module In-Reply-To: <1593863789.9.0.238701347914.issue41208@roundup.psfhosted.org> Message-ID: <1596475754.08.0.656613869512.issue41208@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: not a bug -> duplicate superseder: -> Pickle crashes unpickling invalid NEWOBJ_EX opcode _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:36:52 2020 From: report at bugs.python.org (Howard A. Landman) Date: Mon, 03 Aug 2020 17:36:52 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596476212.61.0.871614920728.issue41335@roundup.psfhosted.org> Howard A. Landman added the comment: Getting closer to isolating this. A small program that does nothing but call read_regs24() over and over dies with the same error after about 107.4M iterations. So it seems to be definitely in that method. But that only takes a few hours, not half a day. Going to try to separate the SPI operation from the remaining Python code next. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:42:48 2020 From: report at bugs.python.org (David Edelsohn) Date: Mon, 03 Aug 2020 17:42:48 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596476568.26.0.668702049578.issue38628@roundup.psfhosted.org> David Edelsohn added the comment: The example with memchr() never will be correct because it is invalid to call a function with an argument list that doesn't match the function signature. Your comment mentions that the AIX structure is size 16, but it looks like Python calculates the AIX structure size as 24 bytes. Have you tried increasing the value of MAX_STRUCT_SIZE in stgdict.c to 32 or 64, corresponding to the argument registers available in 32 bit or 64 bit mode? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 13:45:19 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 03 Aug 2020 17:45:19 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596476719.27.0.990291469899.issue41458@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think what Raymond proposes makes sense and it will certainly add value, especially given the mentioned expectations on what an implementation on the stdlib should have. The only think I would like to know is how much code/measured performance impact this will have. I expect this not to be a problem but I think is an important factor to help us decide. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 14:04:39 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 18:04:39 +0000 Subject: [issue41449] An article on Python 3 stdout and stderr output buffering In-Reply-To: <1596190232.56.0.383059757324.issue41449@roundup.psfhosted.org> Message-ID: <1596477879.75.0.660315553173.issue41449@roundup.psfhosted.org> Guido van Rossum added the comment: If you don't even know whether it's Python, Docker or Kubernetes you really need to ask somewhere else. Plenty of user groups around. Python detects tty using the standard UNIX isatty() function. To a tty we always get line buffering. To a file we use a larger buffer. For more details see the source at https://github.com/python/cpython/blob/4660597b51b3d14ce6269d0ed865ab7e22c6ae1f/Python/pylifecycle.c#L1942 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 14:25:44 2020 From: report at bugs.python.org (Guillaume) Date: Mon, 03 Aug 2020 18:25:44 +0000 Subject: [issue41459] pickle.load raises SystemError on malformed input In-Reply-To: <1596401775.19.0.63803368162.issue41459@roundup.psfhosted.org> Message-ID: <1596479144.24.0.895523185265.issue41459@roundup.psfhosted.org> Guillaume added the comment: Hi Eric, I'm not aware of a practical problem caused by this. This was discovered via fuzzing. I reported it because the unexpected error suggest an internal issue within the pickle library. Just before reporting this, I browsed the bug tracker and noticed a similar comment suggesting this kind of pickle issue is of little consequences given pickle is not designed for untrusted input. So I've shifted my focus away from fuzzing pickle. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 14:29:12 2020 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Mon, 03 Aug 2020 18:29:12 +0000 Subject: [issue41465] io.TextIOWrapper.errors not writable Message-ID: <1596479352.95.0.492861771572.issue41465@roundup.psfhosted.org> New submission from Walter D?rwald : PEP 293 states the following: """ For stream readers/writers the errors attribute must be changeable to be able to switch between different error handling methods during the lifetime of the stream reader/writer. This is currently the case for codecs.StreamReader and codecs.StreamWriter and all their subclasses. All core codecs and probably most of the third party codecs (e.g. JapaneseCodecs) derive their stream readers/writers from these classes so this already works, but the attribute errors should be documented as a requirement. """ However for io.TextIOWrapper, the errors attribute can not be changed: Python 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import io >>> s = io.TextIOWrapper(io.BytesIO()) >>> s.errors = 'replace' Traceback (most recent call last): File "", line 1, in AttributeError: attribute 'errors' of '_io.TextIOWrapper' objects is not writable So the errors attribute of io.TextIOWrapper should be made writable. ---------- components: IO messages: 374751 nosy: doerwalter priority: normal severity: normal status: open title: io.TextIOWrapper.errors not writable type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 15:58:25 2020 From: report at bugs.python.org (cotree) Date: Mon, 03 Aug 2020 19:58:25 +0000 Subject: [issue41466] Windows installer: "Add to PATH" should be checked by default Message-ID: <1596484705.61.0.378501501688.issue41466@roundup.psfhosted.org> New submission from cotree : In the Windows installer, "Add Python 3.x to PATH" is unchecked by default: https://docs.python.org/3/_images/win_installer.png If it's unchecked, then "python", "pip", and any other commands from installed packages (like django-admin, etc) will not work, which is quite important functionality. Searching on Google shows that "'python' is not recognized..." is a commonly asked about error. Many users leave that box unchecked because they don't know what PATH is and they tend to stick with the defaults recommended by the installer. On the other hand, I think not wanting Python on your PATH is more of an advanced use case. The people who opt for this are more likely to know what PATH is in the first place, so it's reasonable to ask them to decide to uncheck it. ---------- components: Windows messages: 374752 nosy: cotree, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows installer: "Add to PATH" should be checked by default type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 16:10:34 2020 From: report at bugs.python.org (Magnus Johnsson) Date: Mon, 03 Aug 2020 20:10:34 +0000 Subject: [issue41398] cgi module, parse_multipart fails In-Reply-To: <1595757503.98.0.375306375596.issue41398@roundup.psfhosted.org> Message-ID: <1596485434.29.0.827640416174.issue41398@roundup.psfhosted.org> Magnus Johnsson added the comment: No, of course not. The request is completely valid. Python's cgi library parses it wrong. The 'resolution' that needs to be done is to fix it in python's source. That, and the libraries that depend on it, like twisted, probably needs to move away from using python's cgi library at all, given the age of this bug. As it stands, we have had to patch 16 separate calls, and will be moving away from the twisted-based server over it anyway, since it seems sketchy. Going to have a peek at the source, but I am a bit hesitant to touch things that have that large a userbase. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 16:17:35 2020 From: report at bugs.python.org (Christian Heimes) Date: Mon, 03 Aug 2020 20:17:35 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596485855.61.0.928346293902.issue29269@roundup.psfhosted.org> Christian Heimes added the comment: What do you expect us to do? No Python core dev has access to a Solaris machine. We cannot debug the issue and have to rely on external contributions. We have not declared Solaris as unsupported yet because people are still contributing fixes. If you are looking for wild speculations: I guess Solari' sendfile() is either broken or does not behave like on other platforms. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 16:51:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 20:51:46 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596487906.56.0.766825409898.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 701b63894fdb75b12865b9be6261ce4913da76f5 by Victor Stinner in branch 'master': bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718) https://github.com/python/cpython/commit/701b63894fdb75b12865b9be6261ce4913da76f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 17:14:23 2020 From: report at bugs.python.org (Howard A. Landman) Date: Mon, 03 Aug 2020 21:14:23 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596489263.54.0.830343575979.issue41335@roundup.psfhosted.org> Howard A. Landman added the comment: It appears to be in the spidev library xfer method, when used for reading. Calling that 107.4M times (using the same code as inside my read_regs24() method) causes the free() error. Breakpoint 1, malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341 5341 malloc.c: No such file or directory. (gdb) bt #0 malloc_printerr (str=0x76e028f8 "free(): invalid pointer") at malloc.c:5341 #1 0x76d44d50 in _int_free (av=0x76e1f7d4 , p=0x43417c , have_lock=) at malloc.c:4165 #2 0x001b4f40 in list_dealloc (op=0x766d0f58) at ../Objects/listobject.c:324 #3 0x7669b660 in ?? () from /usr/lib/python3/dist-packages/spidev.cpython-37m-arm-linux-gnueabihf.so Backtrace stopped: previous frame identical to this frame (corrupt stack?) Should I be worried about the "corrupt stack" message? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 17:23:52 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 03 Aug 2020 21:23:52 +0000 Subject: [issue41398] cgi module, parse_multipart fails In-Reply-To: <1595757503.98.0.375306375596.issue41398@roundup.psfhosted.org> Message-ID: <1596489832.14.0.737129085481.issue41398@roundup.psfhosted.org> Guido van Rossum added the comment: Could you submit a PR then? I don't think I've looked at that module in 20 years. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 17:55:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 21:55:21 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596491721.77.0.692937544821.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: More info with my latest change. AMD64 Windows10 3.x: https://buildbot.python.org/all/#/builders/129/builds/1500 0:10:26 load avg: 3.17 [354/423/2] test_asyncio failed (env changed) (1 min 23 sec) -- running: test_capi (1 min 3 sec) Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\asyncio\proactor_events.py", line 115, in __del__ _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) File "D:\buildarea\3.x.bolen-windows10\build\lib\asyncio\proactor_events.py", line 79, in __repr__ info.append(f'fd={self._sock.fileno()}') File "D:\buildarea\3.x.bolen-windows10\build\lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe It seems like the issue comes from SubprocessProactorTests. Using python -m test.bisect_cmd, I isolated one test which causes the issue: + C:\vstinner\python\master\PCbuild\amd64\python_d.exe -m test --matchfile C:\Users\vstinner\AppData\Local\Temp\tmpoe9_zui_ --fail-env-changed test_asyncio -v == CPython 3.10.0a0 (heads/master:701b63894f, Aug 3 2020, 23:38:07) [MSC v.1916 64 bit (AMD64)] == Windows-10-10.0.18362-SP0 little-endian == cwd: C:\vstinner\python\master\build\test_python_7732? == CPU count: 2 == encodings: locale=cp1252, FS=utf-8 0:00:00 Run tests sequentially 0:00:00 [1/1] test_asyncio test_cancel_post_init (test.test_asyncio.test_subprocess.SubprocessProactorTests) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.015s OK C:\vstinner\python\master\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed _warn(f"unclosed {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback C:\vstinner\python\master\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed _warn(f"unclosed {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 115, in __del__ _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 79, in __repr__ info.append(f'fd={self._sock.fileno()}') File "C:\vstinner\python\master\lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 115, in __del__ _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 79, in __repr__ info.append(f'fd={self._sock.fileno()}') File "C:\vstinner\python\master\lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe test_asyncio failed (env changed) == Tests result: ENV CHANGED == ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:01:54 2020 From: report at bugs.python.org (Rishav Kundu) Date: Mon, 03 Aug 2020 22:01:54 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596492114.57.0.97115699186.issue41303@roundup.psfhosted.org> Change by Rishav Kundu : ---------- keywords: +patch nosy: +xrisk nosy_count: 6.0 -> 7.0 pull_requests: +20862 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:02:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:02:23 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596492143.01.0.947508562956.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: When I commented code to hide logs in the tests, I saw another bug. Local patch: diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 177a02cdcc..3095b1d987 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -456,7 +456,8 @@ class SubprocessMixin: # ignore the log: # "Exception during subprocess creation, kill the subprocess" - with test_utils.disable_logger(): + #with test_utils.disable_logger(): + if 1: self.loop.run_until_complete(cancel_make_transport()) test_utils.run_briefly(self.loop) Output: 0:00:05 [ 14] test_asyncio test_cancel_post_init (test.test_asyncio.test_subprocess.SubprocessProactorTests) ... Exception in call back _ProactorReadPipeTransport._loop_reading() handle: )> Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 293, in _loop_reading data = self._data[:length] TypeError: slice indices must be integers or None or have an __index__ method During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 325, in _loop_reading if length > -1: TypeError: '>' not supported between instances of 'bytes' and 'int' Exception in callback _ProactorReadPipeTransport._loop_reading() handle: )> Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 293, in _loop_reading data = self._data[:length] TypeError: slice indices must be integers or None or have an __index__ method During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 325, in _loop_reading if length > -1: TypeError: '>' not supported between instances of 'bytes' and 'int' ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:19:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:19:50 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed Message-ID: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> New submission from STINNER Victor : The proactor event loop of asyncio returns b'' on recv_into() if the socket/pipe is closed: def recv_into(self, conn, buf, flags=0): ... try: ... except BrokenPipeError: return self._result(b'') ... But a socket recv_into() must always return a number: the number of written bytes. Example with socket.socket.recv_into() method: https://docs.python.org/3/library/socket.html#socket.socket.recv_into IMHO zero must be returned here. This bug may be the root cause of bpo-38912 bug. Attached PR fix the issue. ---------- components: asyncio messages: 374760 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: asyncio: recv_into() must not return b'' if the socket/pipe is closed versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:21:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:21:51 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596493311.99.0.986698573818.issue41467@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +20863 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:30:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:30:13 +0000 Subject: [issue31819] Add sock_recv_into to AbstractEventLoop In-Reply-To: <1508434669.81.0.213398074469.issue31819@psf.upfronthosting.co.za> Message-ID: <1596493813.8.0.40110311765.issue31819@roundup.psfhosted.org> STINNER Victor added the comment: Follow-up issue, bpo-41467: asyncio: recv_into() must not return b'' if the socket/pipe is closed. ---------- nosy: -giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:35:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:35:29 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596494129.68.0.12144430654.issue41467@roundup.psfhosted.org> STINNER Victor added the comment: The function was added in 2017 in bpo-31819, PR 4051: commit 525f40d231aba2c004619fc7a5207171ed65b0cb Author: Antoine Pitrou Date: Thu Oct 19 21:46:40 2017 +0200 bpo-31819: Add AbstractEventLoop.sock_recv_into() (#4051) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:37:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:37:06 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596494226.96.0.668981494724.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 293, in _loop_reading data = self._data[:length] TypeError: slice indices must be integers or None or have an __index__ method I created bpo-41467: asyncio: recv_into() must not return b'' if the socket/pipe is closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:44:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:44:45 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596494685.02.0.846687213438.issue41467@roundup.psfhosted.org> STINNER Victor added the comment: > This bug may be the root cause of bpo-38912 bug. Yeah, very likely. This bug makes asyncio inconsistent. A transport is "not closed" and "closed" at the same time... C:\vstinner\python\master\lib\asyncio\proactor_events.py:121: ResourceWarning: unclosed transport <_ProactorReadPipeTransport> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 122, in __del__ self.close() File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 114, in close self._loop.call_soon(self._call_connection_lost, None) File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 746, in call_soon self._check_closed() File "C:\vstinner\python\master\lib\asyncio\base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 18:55:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 22:55:51 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596495351.31.0.258704099234.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: perf_counter documentation says "It does include time elapsed during sleep and is system-wide." where "sleep" here means time.sleep(): https://docs.python.org/dev/library/time.html#time.perf_counter Python clock functions don't provide any warranty regarding to system suspend or system hibernation. See PEP 418 for more details: "The behaviour of clocks after a system suspend is not defined in the documentation of new functions. The behaviour depends on the operating system: see the Monotonic Clocks section below." https://www.python.org/dev/peps/pep-0418/#monotonic-clocks I don't think that using mach_continuous_time() is needed, but the documentation should be clarified. The doc should explain that the behavior during system suspend is not defined (platform specific). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:01:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:01:30 +0000 Subject: [issue41439] test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS) In-Reply-To: <1596089205.38.0.465991237875.issue41439@roundup.psfhosted.org> Message-ID: <1596495690.72.0.0555212679326.issue41439@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_uuid.py and test_ssl.py failure on OSes without os.fork -> test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:03:19 2020 From: report at bugs.python.org (Albert Francis) Date: Mon, 03 Aug 2020 23:03:19 +0000 Subject: [issue41468] Unrecoverable server exiting Message-ID: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> New submission from Albert Francis : How to solve unrecoverable server exiting in IDLE ---------- assignee: terry.reedy components: IDLE messages: 374766 nosy: albertpython, terry.reedy priority: normal severity: normal status: open title: Unrecoverable server exiting type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:04:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:04:49 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596495889.76.0.0429629627968.issue29269@roundup.psfhosted.org> STINNER Victor added the comment: > I am not sure how to get this bug fixed (...) Someone has to write a fix. You may contact Solaris vendor or a company using Solaris who wants to pay a developer to write a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:06:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:06:06 +0000 Subject: [issue41401] Using non-ascii that require UTF-8 breaks AIX testing In-Reply-To: <1595772423.92.0.81107313537.issue41401@roundup.psfhosted.org> Message-ID: <1596495966.68.0.785403300673.issue41401@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:18:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:18:57 +0000 Subject: [issue41330] Inefficient error-handle for CJK encodings In-Reply-To: <1595048019.57.0.348575052072.issue41330@roundup.psfhosted.org> Message-ID: <1596496737.07.0.449100582086.issue41330@roundup.psfhosted.org> STINNER Victor added the comment: Since CJK codecs have been implemented, unicodeobject.c got multiple optimizations: * _PyUnicodeWriter for decoder: API designed with efficiency and PEP 393 (compact string) in mind * _PyBytesWriter for encoders: in short, API to overallocate a buffer * _Py_error_handler enum and "_Py_error_handler _Py_GetErrorHandler(const char *errors)" function to pass an error handler as an integer rather than a string But rewriting CJK codecs with these is a lot of effort, I'm not sure that it's worth it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:30:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:30:07 +0000 Subject: [issue41406] subprocess: Calling Popen.communicate() after Popen.stdout.read() returns an empty string In-Reply-To: <1595838385.02.0.156491511968.issue41406@roundup.psfhosted.org> Message-ID: <1596497407.35.0.0157317903913.issue41406@roundup.psfhosted.org> STINNER Victor added the comment: Calling proc.communicate() after proc.stdout.read() doesn't seem to be supported. What is your use case? Why not just calling communicate()? Why not only using stdout directly? ---------- components: -2to3 (2.x to 3.x conversion tool), IO nosy: +gregory.p.smith title: BufferedReader causes Popen.communicate losing the remaining output. -> subprocess: Calling Popen.communicate() after Popen.stdout.read() returns an empty string versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:30:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:30:50 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596497450.75.0.860049666702.issue38119@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:39:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:39:26 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1596497966.15.0.429900890171.issue41370@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:42:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:42:00 +0000 Subject: [issue35247] test.test_socket.RDSTest.testPeek hangs indefinitely In-Reply-To: <1542212087.25.0.788709270274.issue35247@psf.upfronthosting.co.za> Message-ID: <1596498120.35.0.554885730985.issue35247@roundup.psfhosted.org> STINNER Victor added the comment: I cannot debug this issue on Fedora 32, since RDS sockets are not supported: $ ./python -m test test_socket -m test.test_socket.RDSTest.testPeek -v (...) testPeek (test.test_socket.RDSTest) ... skipped 'RDS sockets required for this test.' (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:45:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:45:13 +0000 Subject: [issue41326] Build failure in blurb-it repo: "Failed building wheel for yarl" In-Reply-To: <1595009891.48.0.976644515939.issue41326@roundup.psfhosted.org> Message-ID: <1596498313.06.0.0116964214184.issue41326@roundup.psfhosted.org> STINNER Victor added the comment: yarl is a third party project, you should report the issue to https://github.com/aio-libs/yarl/ > blurb-it imports aiohttp which imports yarl. It might be a duplicate of https://github.com/aio-libs/yarl/issues/459 Andrew Svetlov wrote "yarl 1.5.0 will be published with generated C files made by Cython 0.29.21" At https://pypi.org/project/yarl/ I can see version 1.5.1. I guess that the issue is now fixed. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 19:46:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 03 Aug 2020 23:46:21 +0000 Subject: [issue41326] Build failure in blurb-it repo: "Failed building wheel for yarl" In-Reply-To: <1595009891.48.0.976644515939.issue41326@roundup.psfhosted.org> Message-ID: <1596498381.73.0.72528360166.issue41326@roundup.psfhosted.org> STINNER Victor added the comment: > I'm not familiar with that part of codebase. If anyone has any insight, it would be appreciated. Thanks. See PEP 623 if you're curious ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:04:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 00:04:12 +0000 Subject: [issue38156] input fucntion raises SystemError after specific input. In-Reply-To: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> Message-ID: <1596499452.25.0.214604159204.issue38156@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 3.0 -> 4.0 pull_requests: +20864 pull_request: https://github.com/python/cpython/pull/21721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:06:53 2020 From: report at bugs.python.org (Eryk Sun) Date: Tue, 04 Aug 2020 00:06:53 +0000 Subject: [issue41466] Windows installer: "Add to PATH" should be checked by default In-Reply-To: <1596484705.61.0.378501501688.issue41466@roundup.psfhosted.org> Message-ID: <1596499613.8.0.319238937309.issue41466@roundup.psfhosted.org> Eryk Sun added the comment: Managing multiple Python installations in PATH is problematic, so by default the installer doesn't modify PATH. Instead, the "py.exe" launcher [1] is made available, which can run any registered installation of Python. Using a launcher fits the Windows environment better, which installs applications into separate subdirectories of "shell:ProgramFiles" or "shell:UserProgramFiles". This is similar to monolithic package installation in Unix into "/opt" or "~/.local/opt" (or "~/opt"). A recent update to the installer extends the message after a successful installation to suggest "[a]t your terminal, type 'py' to launch Python". It also includes a link to the "Using Python on Windows" documentation. Hopefully this will encourage more users to learn about and use the py launcher. [1] https://docs.python.org/3/using/windows.html#launcher ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:06:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 00:06:27 +0000 Subject: [issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API In-Reply-To: <1592255135.39.0.855912884014.issue40989@roundup.psfhosted.org> Message-ID: <1596499587.75.0.746980209845.issue40989@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20865 pull_request: https://github.com/python/cpython/pull/21722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:07:27 2020 From: report at bugs.python.org (Howard A. Landman) Date: Tue, 04 Aug 2020 00:07:27 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596499647.29.0.698416825697.issue41335@roundup.psfhosted.org> Howard A. Landman added the comment: OK, this has been filed against the spidev library: https://github.com/doceme/py-spidev/issues/107 Do you want it closed, or left open until that gets resolved? ---------- resolution: -> third party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:25:00 2020 From: report at bugs.python.org (Ma Lin) Date: Tue, 04 Aug 2020 00:25:00 +0000 Subject: [issue41330] Inefficient error-handle for CJK encodings In-Reply-To: <1595048019.57.0.348575052072.issue41330@roundup.psfhosted.org> Message-ID: <1596500700.46.0.561356139011.issue41330@roundup.psfhosted.org> Ma Lin added the comment: I'm working on issue41265. If nothing happens, I also would like to write a zstd module for stdlib before the end of the year, but I dare not promise this. If anyone wants to work on this issue, very grateful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:26:58 2020 From: report at bugs.python.org (Eryk Sun) Date: Tue, 04 Aug 2020 00:26:58 +0000 Subject: [issue41466] Windows installer: "Add to PATH" should be checked by default In-Reply-To: <1596484705.61.0.378501501688.issue41466@roundup.psfhosted.org> Message-ID: <1596500818.38.0.92024780824.issue41466@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +Installation status: open -> versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:32:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 00:32:34 +0000 Subject: [issue41330] Inefficient error-handle for CJK encodings In-Reply-To: <1595048019.57.0.348575052072.issue41330@roundup.psfhosted.org> Message-ID: <1596501154.3.0.709007747665.issue41330@roundup.psfhosted.org> STINNER Victor added the comment: (off topic) > If nothing happens, I also would like to write a zstd module for stdlib before the end of the year, but I dare not promise this. I suggest you to publish it on PyPI. Once it will be mature, you can propose it on python-ideas. Last time someone proposed a new compression algorithm to the stdlib, it was rejected if I recall correctly. I forgot which one was proposed. Maybe search for "compresslib" on python-ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:38:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 00:38:23 +0000 Subject: [issue38156] input fucntion raises SystemError after specific input. In-Reply-To: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> Message-ID: <1596501503.34.0.13029386254.issue38156@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bde48fd8110cc5f128d5db44810d17811e328a24 by Victor Stinner in branch 'master': bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721) https://github.com/python/cpython/commit/bde48fd8110cc5f128d5db44810d17811e328a24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:38:58 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:38:58 +0000 Subject: [issue38156] input fucntion raises SystemError after specific input. In-Reply-To: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> Message-ID: <1596501538.56.0.316617335714.issue38156@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20866 pull_request: https://github.com/python/cpython/pull/21723 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:40:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 00:40:13 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596501613.99.0.750422633377.issue41467@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 602a971a2af3a685d625c912c400cadd452718b1 by Victor Stinner in branch 'master': bpo-41467: Fix asyncio recv_into() on Windows (GH-21720) https://github.com/python/cpython/commit/602a971a2af3a685d625c912c400cadd452718b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:40:33 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:40:33 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596501633.17.0.347565595572.issue41467@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20867 pull_request: https://github.com/python/cpython/pull/21724 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:40:40 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:40:40 +0000 Subject: [issue38156] input fucntion raises SystemError after specific input. In-Reply-To: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> Message-ID: <1596501640.39.0.732112764673.issue38156@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20868 pull_request: https://github.com/python/cpython/pull/21725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:41:17 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:41:17 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596501677.5.0.409237463433.issue41467@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20869 pull_request: https://github.com/python/cpython/pull/21726 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:57:01 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:57:01 +0000 Subject: [issue38156] input fucntion raises SystemError after specific input. In-Reply-To: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> Message-ID: <1596502621.52.0.0133844140286.issue38156@roundup.psfhosted.org> miss-islington added the comment: New changeset b6724be8047ac2404aab870d35d8f95bb0b7036a by Miss Islington (bot) in branch '3.9': bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721) https://github.com/python/cpython/commit/b6724be8047ac2404aab870d35d8f95bb0b7036a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:58:08 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:58:08 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596502688.94.0.554180259456.issue41467@roundup.psfhosted.org> miss-islington added the comment: New changeset b934d832d1e16bf235c536dcde3006faf29757fc by Miss Islington (bot) in branch '3.8': bpo-41467: Fix asyncio recv_into() on Windows (GH-21720) https://github.com/python/cpython/commit/b934d832d1e16bf235c536dcde3006faf29757fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 20:59:05 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 00:59:05 +0000 Subject: [issue38156] input fucntion raises SystemError after specific input. In-Reply-To: <1568370698.83.0.595206707223.issue38156@roundup.psfhosted.org> Message-ID: <1596502745.57.0.171558084781.issue38156@roundup.psfhosted.org> miss-islington added the comment: New changeset 46e448abbf35c051e5306a4695670d7ec7abc4e9 by Miss Islington (bot) in branch '3.8': bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721) https://github.com/python/cpython/commit/46e448abbf35c051e5306a4695670d7ec7abc4e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 21:00:36 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 04 Aug 2020 01:00:36 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596502836.11.0.666985119933.issue41467@roundup.psfhosted.org> miss-islington added the comment: New changeset 1d16229f3f5b91f2389c7c5c6425c5524c413651 by Miss Islington (bot) in branch '3.9': bpo-41467: Fix asyncio recv_into() on Windows (GH-21720) https://github.com/python/cpython/commit/1d16229f3f5b91f2389c7c5c6425c5524c413651 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 21:55:39 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 04 Aug 2020 01:55:39 +0000 Subject: [issue41406] subprocess: Calling Popen.communicate() after Popen.stdout.read() returns an empty string In-Reply-To: <1595838385.02.0.156491511968.issue41406@roundup.psfhosted.org> Message-ID: <1596506139.71.0.257198242609.issue41406@roundup.psfhosted.org> Gregory P. Smith added the comment: A workaround should be pass bufsize=0. There might be performance consequences. That depends on your read patterns and child process. If this is to be supported and fixed, the selectors used in POpen._communicate on the POSIX side presumably don't bother to look at buffered IO objects buffer. https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1959 manually consuming data from the stdout and stderr buffers, if any, before entering that loop is probably a fix. Higher up the chain, should the https://docs.python.org/3/library/selectors.html be enhanced to support emptying the buffer on buffered IO objects? That sounds complicated; probably even infeasible if in text mode. In general it is understood that poll/select type APIs are meant to be used on unbuffered raw binary file objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:08:31 2020 From: report at bugs.python.org (Inada Naoki) Date: Tue, 04 Aug 2020 02:08:31 +0000 Subject: [issue41431] Optimize dict_merge for copy In-Reply-To: <1595982578.69.0.880267074289.issue41431@roundup.psfhosted.org> Message-ID: <1596506911.88.0.70685630423.issue41431@roundup.psfhosted.org> Inada Naoki added the comment: New changeset db6d9a50cee92c0ded7c5cb87331c5f0b1008698 by Inada Naoki in branch 'master': bpo-41431: Optimize dict_merge for copy (GH-21674) https://github.com/python/cpython/commit/db6d9a50cee92c0ded7c5cb87331c5f0b1008698 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:08:38 2020 From: report at bugs.python.org (Inada Naoki) Date: Tue, 04 Aug 2020 02:08:38 +0000 Subject: [issue41431] Optimize dict_merge for copy In-Reply-To: <1595982578.69.0.880267074289.issue41431@roundup.psfhosted.org> Message-ID: <1596506918.24.0.856955703559.issue41431@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:16:28 2020 From: report at bugs.python.org (Larry Hastings) Date: Tue, 04 Aug 2020 02:16:28 +0000 Subject: [issue29778] [CVE-2020-15523] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath In-Reply-To: <1489121898.66.0.224917416789.issue29778@psf.upfronthosting.co.za> Message-ID: <1596507388.23.0.169715477763.issue29778@roundup.psfhosted.org> Larry Hastings added the comment: New changeset f205f1000a2d7f8b044caf281041b3705f293480 by Steve Dower in branch '3.5': [3.5] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (#21377) https://github.com/python/cpython/commit/f205f1000a2d7f8b044caf281041b3705f293480 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:32:03 2020 From: report at bugs.python.org (Inada Naoki) Date: Tue, 04 Aug 2020 02:32:03 +0000 Subject: [issue41326] Build failure in blurb-it repo: "Failed building wheel for yarl" In-Reply-To: <1595009891.48.0.976644515939.issue41326@roundup.psfhosted.org> Message-ID: <1596508323.34.0.53765693473.issue41326@roundup.psfhosted.org> Inada Naoki added the comment: For the record, deprecation warning is just a waring. Build failure is coming from here: ``` yarl/_quoting.c:1245:23: error: lvalue required as left operand of assignment Py_SIZE(list) = len+1; ``` It is not relating PEP 623, and it has been fixed already. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:33:35 2020 From: report at bugs.python.org (Larry Hastings) Date: Tue, 04 Aug 2020 02:33:35 +0000 Subject: [issue41004] [CVE-2020-14422] Hash collisions in IPv4Interface and IPv6Interface In-Reply-To: <1592399512.32.0.283218763722.issue41004@roundup.psfhosted.org> Message-ID: <1596508415.87.0.0303606102229.issue41004@roundup.psfhosted.org> Larry Hastings added the comment: New changeset 11d258ceafdf60ab3840f9a5700f2d0ad3e2e2d1 by Tapas Kundu in branch '3.5': [3.5] bpo-41004: Resolve hash collisions for IPv4Interface and IPv6Interface (GH-21033) (#21233) https://github.com/python/cpython/commit/11d258ceafdf60ab3840f9a5700f2d0ad3e2e2d1 ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:35:49 2020 From: report at bugs.python.org (Larry Hastings) Date: Tue, 04 Aug 2020 02:35:49 +0000 Subject: [issue41004] [CVE-2020-14422] Hash collisions in IPv4Interface and IPv6Interface In-Reply-To: <1592399512.32.0.283218763722.issue41004@roundup.psfhosted.org> Message-ID: <1596508549.62.0.78890547691.issue41004@roundup.psfhosted.org> Change by Larry Hastings : ---------- assignee: eric.smith -> status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 22:46:30 2020 From: report at bugs.python.org (Jose Gabriel) Date: Tue, 04 Aug 2020 02:46:30 +0000 Subject: [issue41469] Problem with serial communication Message-ID: <1596509190.34.0.229885984319.issue41469@roundup.psfhosted.org> New submission from Jose Gabriel : I was doing a small serial communication system using pyserial. when I done the script on a .py file, it not worked. but when I opened the python console and writed line by line the same code of the .py file, it worked. the .py file: import serial ser = serial.Serial('com5') ser.write('L'.encode()) ser.close() it not worked. on the python console: python>> import serial python>> ser = serial.Serial('com5') python>> ser.write('L'.encode()) python>> ser.close() It worked. PySerial 3.4 ---------- messages: 374788 nosy: JDev priority: normal severity: normal status: open title: Problem with serial communication type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 23:15:04 2020 From: report at bugs.python.org (Peixing Xin) Date: Tue, 04 Aug 2020 03:15:04 +0000 Subject: [issue41439] test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS) In-Reply-To: <1596089205.38.0.465991237875.issue41439@roundup.psfhosted.org> Message-ID: <1596510904.44.0.184132055498.issue41439@roundup.psfhosted.org> Peixing Xin added the comment: Terry, VxWorks has not been officially supported by community. Certainly no builtbot for VxWorks connected yet. I am porting cpython onto VxWorks RTOS now. Several issues you listed are the part of my porting effort. So I think we don't need to backport the fix to previous versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 23:19:24 2020 From: report at bugs.python.org (Brian Vandenberg) Date: Tue, 04 Aug 2020 03:19:24 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596511164.87.0.716348770512.issue29269@roundup.psfhosted.org> Brian Vandenberg added the comment: Christian, you did exactly what I needed. Thank you. I don't have the means to do a git bisect to find where it broke. It wasn't a problem around 3.3 timeframe and I'm not sure when this sendfile stuff was implemented. The man page for sendfile says "The sendfile() function does not modify the current file pointer of in_fd, (...)". In other words the read pointer for the input descriptor won't be advanced. They expect you to use it like this: offset = 0; do { ret = sendfile(in, out, &offset, len); } while( ret < 0 && (errno == EAGAIN || errno == EINTR) ); ... though making that change in posixmodule.c would break this test severely since the send & receive code is running on the same thread. In posixmodule.c I don't see anything that attempts to return the number of bytes successfully sent. Since the input file descriptor won't have its read pointer advanced, the variable "offset" must be set to the correct offset value, otherwise it just keeps reading the first 32k of the file that was generated for the test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 23:34:42 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 04 Aug 2020 03:34:42 +0000 Subject: [issue32623] Resize dict on del/pop In-Reply-To: <1516639058.13.0.467229070634.issue32623@psf.upfronthosting.co.za> Message-ID: <1596512082.85.0.440892720485.issue32623@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 23:51:43 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 Aug 2020 03:51:43 +0000 Subject: [issue36982] Add support for extended color functions in ncurses 6.1 In-Reply-To: <1558406631.2.0.0939623901621.issue36982@roundup.psfhosted.org> Message-ID: <1596513103.79.0.970260625105.issue36982@roundup.psfhosted.org> Ned Deily added the comment: New changeset da4e09fff6b483fe858997da5599c25397107ca1 by Hans Petter Jansson in branch 'master': bpo-36982: Add support for extended color functions in ncurses 6.1 (GH-17536) https://github.com/python/cpython/commit/da4e09fff6b483fe858997da5599c25397107ca1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 3 23:56:55 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 04 Aug 2020 03:56:55 +0000 Subject: [issue41469] Problem with serial communication In-Reply-To: <1596509190.34.0.229885984319.issue41469@roundup.psfhosted.org> Message-ID: <1596513415.56.0.62935134695.issue41469@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This tracker is for issues related to CPython. Please report issues at the relevant repo https://github.com/pyserial/pyserial. Closing it as third party. ---------- nosy: +xtreak resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 00:01:51 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 Aug 2020 04:01:51 +0000 Subject: [issue41460] Translation Error in in Functional Programming HOWTO page In-Reply-To: <1596428289.44.0.783644077267.issue41460@roundup.psfhosted.org> Message-ID: <1596513711.79.0.940034100037.issue41460@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> docs at python components: +Documentation nosy: +cocoatomo, docs at python, mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 00:04:31 2020 From: report at bugs.python.org (Peixing Xin) Date: Tue, 04 Aug 2020 04:04:31 +0000 Subject: [issue41440] os.cpu_count doesn't work on VxWorks RTOS In-Reply-To: <1596092864.05.0.11139024599.issue41440@roundup.psfhosted.org> Message-ID: <1596513871.64.0.173963202348.issue41440@roundup.psfhosted.org> Peixing Xin added the comment: I don't know who have VxWorks experience in core devs. VxWorks has not been officially supported so not listed there. I am from Wind River and Wind River can provide buildbot for VxWorks once it is supported and I also could take the maintainer role. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 00:04:56 2020 From: report at bugs.python.org (Brian Vandenberg) Date: Tue, 04 Aug 2020 04:04:56 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596513896.14.0.030239368519.issue29269@roundup.psfhosted.org> Brian Vandenberg added the comment: I accidentally hit submit too early. I tried changing the code in posixmodule.c to use lseek(), something like the following: offset = lseek( in, 0, SEEK_CUR ); do { ret = sendfile(...); } while( ... ); lseek( in, offset, SEEK_SET ); ... however, in addition to readfile not advancing the file pointer it also doesn't seem to cause an EOF condition. In my first attempt at the above I was doing this after the loop: lseek( in, offset, SEEK_CUR ); ... and it just kept advancing the file pointer well beyond the end of the file and sendfile() had absolutely no qualms about reading beyond the end of the file. I even tried adding a read() after the 2nd lseek to see if I could force an EOF condition but that didn't do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 00:08:01 2020 From: report at bugs.python.org (pmp-p) Date: Tue, 04 Aug 2020 04:08:01 +0000 Subject: [issue41440] os.cpu_count doesn't work on VxWorks RTOS In-Reply-To: <1596092864.05.0.11139024599.issue41440@roundup.psfhosted.org> Message-ID: <1596514081.43.0.682765091716.issue41440@roundup.psfhosted.org> Change by pmp-p : ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 00:20:35 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 04 Aug 2020 04:20:35 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596514835.63.0.0156787212597.issue41335@roundup.psfhosted.org> Change by Ned Deily : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 00:34:20 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Aug 2020 04:34:20 +0000 Subject: [issue32623] Resize dict on del/pop In-Reply-To: <1516639058.13.0.467229070634.issue32623@psf.upfronthosting.co.za> Message-ID: <1596515660.51.0.276634031291.issue32623@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 01:03:29 2020 From: report at bugs.python.org (hai shi) Date: Tue, 04 Aug 2020 05:03:29 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596517409.82.0.367935457029.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20870 pull_request: https://github.com/python/cpython/pull/21727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 03:52:41 2020 From: report at bugs.python.org (Sagnik Mazumder) Date: Tue, 04 Aug 2020 07:52:41 +0000 Subject: [issue41259] Find adverbs is not correct on the documentation In-Reply-To: <1594312922.82.0.0846663616251.issue41259@roundup.psfhosted.org> Message-ID: <1596527561.17.0.764958796045.issue41259@roundup.psfhosted.org> Sagnik Mazumder added the comment: fixed finding adverbs example in re docs ---------- message_count: 5.0 -> 6.0 nosy: +Sagnik Mazumder nosy_count: 6.0 -> 7.0 pull_requests: +20871 pull_request: https://github.com/python/cpython/pull/21728 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 04:42:47 2020 From: report at bugs.python.org (E. Paine) Date: Tue, 04 Aug 2020 08:42:47 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1596530567.03.0.277595011306.issue41468@roundup.psfhosted.org> E. Paine added the comment: To help us to reproduce and understand the issue, please could you give us 1) a more detailed explanation of the problem you are facing and 2) steps to reproduce the issue (maybe providing a minimal code example if that is the cause). Is this a bug with IDLE, though, as you say "solve" (which I interpret to mean you want help with your code) in which case it may be better suited to Stack Overflow? ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 05:38:39 2020 From: report at bugs.python.org (Christian Heimes) Date: Tue, 04 Aug 2020 09:38:39 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596533919.57.0.408050924347.issue41335@roundup.psfhosted.org> Christian Heimes added the comment: Yeah, my bet is on SpiDev_xfer(), https://github.com/doceme/py-spidev/blob/master/spidev_module.c#L458 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 05:39:24 2020 From: report at bugs.python.org (Peter Stokes) Date: Tue, 04 Aug 2020 09:39:24 +0000 Subject: [issue41470] smtplib.SMTP should reset internal 'helo' and 'ehlo' state within 'connect()' Message-ID: <1596533964.11.0.390064699106.issue41470@roundup.psfhosted.org> New submission from Peter Stokes : Attempting to reuse an instance of 'smtplib.SMTP', via invocation of the 'smtplib.SMTP.connect(?)' function, results in an invalid SMTP command sequence being issued to the connected server: ``` import smtplib smtp = smtplib.SMTP() smtp.connect('smtp.gmail.com') smtp.ehlo_or_helo_if_needed() smtp.close() try: smtp.quit() except smtplib.SMTPServerDisconnected: pass smtp.connect('smtp.gmail.com') print(smtp.mail('user at example.com')) ``` results in "(503, b'5.5.1 EHLO/HELO first. ? - gsmtp')" The values stored in 'self.helo_resp' and 'self.ehlo_resp', as considered within 'smtplib.SMTP.ehlo_or_helo_if_needed()' [1], should be reset to a value of 'None' upon successfully establishing a new connection to a server. The correct sentiment is expressed within 'smtplib.SMTP.quit()' [2] but this resetting of state should be performed upon establishing a new connection rather than termination of an old connection. Whilst the simplified example provided is arguably an invalid use of the 'smtplib.SMTP' library the scenario can occur, specifically when the initial connection is unilaterally terminated by the server, which makes the reset logic provided in 'smtplib.SMTP.quit()' inaccessible due to the 'smtplib.SMTPServerDisconnected' exception raised as a consequence of attempting to execute an SMTP 'QUIT' command over a disconnected socket. [1] https://github.com/python/cpython/blob/da51ba442c7bf717872633676207c1ae10e99c99/Lib/smtplib.py#L603 [2] https://github.com/python/cpython/blob/da51ba442c7bf717872633676207c1ae10e99c99/Lib/smtplib.py#L989L990 ---------- components: email messages: 374798 nosy: Dadeos, barry, r.david.murray priority: normal severity: normal status: open title: smtplib.SMTP should reset internal 'helo' and 'ehlo' state within 'connect()' type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 06:29:44 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Aug 2020 10:29:44 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1596536984.53.0.710471670928.issue41468@roundup.psfhosted.org> Terry J. Reedy added the comment: Start IDLE in a Terminal/Command Prompt window with `python -m idlelib`, where 'python` is whatever runs your most recent 3.x python. Then see if an error message shows up after IDLE exits. ---------- versions: +Python 3.10 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 06:34:27 2020 From: report at bugs.python.org (Jens Petersen) Date: Tue, 04 Aug 2020 10:34:27 +0000 Subject: [issue41471] After installing python 3.x on Mac pip doesn't work at all Message-ID: <1596537267.29.0.654374340764.issue41471@roundup.psfhosted.org> New submission from Jens Petersen : Using pip fails with the same error messages independent of version an user. Also su or sudo -H doesn't change anything: How to Reproduce install python 3.x on your Mac and try pip After a quite long search I found that it is a problem with the proxy config. You need to remove all settings in network settings/proxy even those defining which domains shouldn't use a proxy. Proxy settings work fine with everything except python. xcode-select install ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install pyenv pyenv install 3.7.3 pip list --outdated or pip install something Exception xxx-MBP:~ xxx$ pip list --outdated Exception: Traceback (most recent call last): File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 179, in main status = self.run(options, args) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 144, in run packages = self.get_outdated(packages, options) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 152, in get_outdated dist for dist in self.iter_packages_latest_infos(packages, options) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 152, in dist for dist in self.iter_packages_latest_infos(packages, options) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 179, in iter_packages_latest_infos all_candidates = finder.find_all_candidates(dist.key) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 610, in find_all_candidates for page in self._get_pages(url_locations, project_name): File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 743, in _get_pages page = _get_html_page(location, session=self.session) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 229, in _get_html_page resp = _get_html_response(url, session=session) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/index.py", line 177, in _get_html_response "Cache-Control": "max-age=0", File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 546, in get return self.request('GET', url, **kwargs) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_internal/download.py", line 403, in request return super(PipSession, self).request(method, url, *args, **kwargs) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 524, in request prep.url, proxies, stream, verify, cert File "/Users/xxxx.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 700, in merge_environment_settings env_proxies = get_environ_proxies(url, no_proxy=no_proxy) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 761, in get_environ_proxies if should_bypass_proxies(url, no_proxy=no_proxy): File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 745, in should_bypass_proxies bypass = proxy_bypass(parsed.hostname) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/urllib/request.py", line 2610, in proxy_bypass return proxy_bypass_macosx_sysconf(host) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/urllib/request.py", line 2587, in proxy_bypass_macosx_sysconf return _proxy_bypass_macosx_sysconf(host, proxy_settings) File "/Users/xxx/.pyenv/versions/3.7.3/lib/python3.7/urllib/request.py", line 2573, in _proxy_bypass_macosx_sysconf if (hostIP >> mask) == (base >> mask): ValueError: negative shift count ---------- components: macOS messages: 374800 nosy: ned.deily, peteje66, ronaldoussoren priority: normal pull_requests: 20872 severity: normal status: open title: After installing python 3.x on Mac pip doesn't work at all type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 07:01:52 2020 From: report at bugs.python.org (Nathan Maynes) Date: Tue, 04 Aug 2020 11:01:52 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596538912.07.0.139082194173.issue41371@roundup.psfhosted.org> Nathan Maynes added the comment: I'm creating a pull request that implements the suggestion by xtreak. ---------- nosy: +nmaynes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 07:02:17 2020 From: report at bugs.python.org (Erik Bray) Date: Tue, 04 Aug 2020 11:02:17 +0000 Subject: [issue20082] Misbehavior of BufferedRandom.write with raw file in append mode In-Reply-To: <1388187192.84.0.682821163597.issue20082@psf.upfronthosting.co.za> Message-ID: <1596538937.38.0.674785213653.issue20082@roundup.psfhosted.org> Change by Erik Bray : ---------- pull_requests: +20873 pull_request: https://github.com/python/cpython/pull/21729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 07:01:55 2020 From: report at bugs.python.org (Erik Bray) Date: Tue, 04 Aug 2020 11:01:55 +0000 Subject: [issue18876] Problems with files opened in append mode with io module In-Reply-To: <1377796053.23.0.271574141063.issue18876@psf.upfronthosting.co.za> Message-ID: <1596538915.06.0.501675542202.issue18876@roundup.psfhosted.org> Erik Bray added the comment: Indeed, this can be closed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 07:08:50 2020 From: report at bugs.python.org (Nathan Maynes) Date: Tue, 04 Aug 2020 11:08:50 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596539330.45.0.0240609073075.issue41371@roundup.psfhosted.org> Change by Nathan Maynes : ---------- keywords: +patch pull_requests: +20874 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 07:25:03 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 04 Aug 2020 11:25:03 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1596540303.31.0.708518516329.issue41468@roundup.psfhosted.org> Terry J. Reedy added the comment: One should never see this message. As far as I remember, I have seen it only once in the last several years. It is intended to indicate a 'random' non-reproducible glitch in the communication machinery connecting the IDLE GUI process and the user code execution process. The most likely solution is to retry what you were doing. A report should only be made is the error is reproducible. "Unrecoverable, server exiting" is meant to convey this, but the meaning should be explained in the message. So I consider this a doc improvement issue. If you report a repeatable failure, then we can look into that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 08:25:35 2020 From: report at bugs.python.org (Sanket Rathi) Date: Tue, 04 Aug 2020 12:25:35 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596543935.93.0.338392644135.issue38628@roundup.psfhosted.org> Change by Sanket Rathi : ---------- nosy: +sanket _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 08:40:39 2020 From: report at bugs.python.org (Albert Francis) Date: Tue, 04 Aug 2020 12:40:39 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596540303.31.0.708518516329.issue41468@roundup.psfhosted.org> Message-ID: Albert Francis added the comment: Dear Sir, I got the solution. Thanks On Tue, 4 Aug 2020, 16:55 Terry J. Reedy, wrote: > > Terry J. Reedy added the comment: > > One should never see this message. As far as I remember, I have seen it > only once in the last several years. It is intended to indicate a 'random' > non-reproducible glitch in the communication machinery connecting the IDLE > GUI process and the user code execution process. The most likely solution > is to retry what you were doing. A report should only be made is the error > is reproducible. "Unrecoverable, server exiting" is meant to convey this, > but the meaning should be explained in the message. So I consider this a > doc improvement issue. > > If you report a repeatable failure, then we can look into that. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 09:15:06 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 04 Aug 2020 13:15:06 +0000 Subject: [issue41471] After installing python 3.x on Mac pip doesn't work at all In-Reply-To: <1596537267.29.0.654374340764.issue41471@roundup.psfhosted.org> Message-ID: <1596546906.93.0.253583096525.issue41471@roundup.psfhosted.org> Ronald Oussoren added the comment: I don't quite understand what the issue is. * What proxy settings do you have? * Is the problem reproducible without using pip? - By using the requests API to fetch a web page - By using the stdlib http.client API to do the same ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 09:34:03 2020 From: report at bugs.python.org (Marco Trevisan) Date: Tue, 04 Aug 2020 13:34:03 +0000 Subject: [issue41472] webbrowser uses deprecated env variables to detect desktop type Message-ID: <1596548043.48.0.891442274538.issue41472@roundup.psfhosted.org> New submission from Marco Trevisan : Webbrowser uses env variables such as GNOME_DESKTOP_SESSION_ID that have been dropped by GNOME in recent releases ---------- components: Library (Lib) messages: 374806 nosy: Trevinho priority: normal severity: normal status: open title: webbrowser uses deprecated env variables to detect desktop type type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 09:35:01 2020 From: report at bugs.python.org (Marco Trevisan) Date: Tue, 04 Aug 2020 13:35:01 +0000 Subject: [issue41472] webbrowser uses deprecated env variables to detect desktop type In-Reply-To: <1596548043.48.0.891442274538.issue41472@roundup.psfhosted.org> Message-ID: <1596548101.63.0.431580747668.issue41472@roundup.psfhosted.org> Change by Marco Trevisan : ---------- keywords: +patch pull_requests: +20875 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 09:47:46 2020 From: report at bugs.python.org (Howard A. Landman) Date: Tue, 04 Aug 2020 13:47:46 +0000 Subject: [issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3 In-Reply-To: <1595097501.98.0.660179014456.issue41335@roundup.psfhosted.org> Message-ID: <1596548866.08.0.375449562737.issue41335@roundup.psfhosted.org> Howard A. Landman added the comment: As far as we can tell, this is a known Py_DECREF problem with spidev==3.4. Testing on spidev==3.5 has not triggered the bug so far, so it appears to be already fixed. Under 3.4, changing the list to a tuple did not affect the behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:19:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 14:19:27 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x Message-ID: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#builders/1/builds/1194 0:07:05 load avg: 16.74 [421/423/1] test_gdb failed (2 min 29 sec) -- running: test_capi (1 min 28 sec), test_lib2to3 (1 min 22 sec) (...) ====================================================================== FAIL: test_dicts (test.test_gdb.PrettyPrintTests) Verify the pretty-printing of dictionaries ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/test_gdb.py", line 332, in test_dicts self.assertGdbRepr({'foo': 'bar'}, "{'foo': 'bar'}") File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/test_gdb.py", line 308, in assertGdbRepr gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')') File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/test_gdb.py", line 284, in get_gdb_repr self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output)) AssertionError: Unexpected gdb output: 'Breakpoint 1 at 0x5fbc79: file Python/bltinmodule.c, line 1173.\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library "/lib64/libthread_db.so.1".\n' Breakpoint 1 at 0x5fbc79: file Python/bltinmodule.c, line 1173. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Stderr: Couldn't get registers: No such process. Selected thread is running. ====================================================================== FAIL: test_pycfunction (test.test_gdb.PyBtTests) [_testcapi.meth_noargs] Verify that "py-bt" displays invocations of PyCFunction instances ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-rawhide-x86_64/build/Lib/test/test_gdb.py", line 912, in test_pycfunction self.assertIn(f' _______________________________________ From report at bugs.python.org Tue Aug 4 10:23:53 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:23:53 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h Message-ID: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> New submission from Skip Montanaro : When Include/cpython/frameobject.h was created, there was no dependency added to Makefile.pre.in. ---------- components: Build messages: 374809 nosy: skip.montanaro priority: normal severity: normal status: open title: Missing dependency on Include/cpython/frameobject.h type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:25:41 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:25:41 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596551141.09.0.672768124308.issue41474@roundup.psfhosted.org> Change by Skip Montanaro : ---------- keywords: +patch pull_requests: +20877 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:26:29 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:26:29 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596551189.38.0.992497624266.issue41474@roundup.psfhosted.org> Skip Montanaro added the comment: Created a pull request. Hopefully I didn't muff the protocol too badly. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:28:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 14:28:12 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596551292.27.0.760745338307.issue41474@roundup.psfhosted.org> STINNER Victor added the comment: > Created a pull request. Hopefully I didn't muff the protocol too badly. Your PR has 124 commits, that looks strange. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:30:54 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:30:54 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596551454.46.0.471473313209.issue41474@roundup.psfhosted.org> Skip Montanaro added the comment: > Your PR has 124 commits, that looks strange. Funny, it told me just one file had changed (Makefile.pre.in). I was attempting to make a PR against that one change from my fork of master to the main repo. Let me take another crack at it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:35:23 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:35:23 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596551723.79.0.0461650037564.issue41474@roundup.psfhosted.org> Skip Montanaro added the comment: I see what @vstinner is talking about. If you look at those commit messages, they all look to be of the form "Merge remote-tracking branch 'upstream/master'". That is, they are me syncing python/cpython/master to python/smontanaro/master. There is, in fact, just the one file changed, Makefile.pre.in, with the addition of a single dependency. I don't know how to get rid of all those commit messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:36:38 2020 From: report at bugs.python.org (Ram Rachum) Date: Tue, 04 Aug 2020 14:36:38 +0000 Subject: [issue41475] Fix mistake in "What's new in Python 3.7" Message-ID: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> New submission from Ram Rachum : Writing the patch now. ---------- assignee: docs at python components: Documentation messages: 374814 nosy: cool-RR, docs at python priority: normal severity: normal status: open title: Fix mistake in "What's new in Python 3.7" versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:38:35 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:38:35 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551723.79.0.0461650037564.issue41474@roundup.psfhosted.org> Message-ID: Skip Montanaro added the comment: > they all look to be of the form "Merge remote-tracking branch 'upstream/master'". Aside from one where I erroneously committed a change to the wrong branch, then backed it out immediately. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:38:39 2020 From: report at bugs.python.org (Ram Rachum) Date: Tue, 04 Aug 2020 14:38:39 +0000 Subject: [issue41475] Fix mistake in "What's new in Python 3.7" In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596551919.68.0.137665898915.issue41475@roundup.psfhosted.org> Change by Ram Rachum : ---------- keywords: +patch pull_requests: +20878 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:40:24 2020 From: report at bugs.python.org (Ram Rachum) Date: Tue, 04 Aug 2020 14:40:24 +0000 Subject: [issue41475] Fix mistake in "What's new in Python 3.7" In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596552024.82.0.94606487389.issue41475@roundup.psfhosted.org> Change by Ram Rachum : ---------- type: -> crash versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:48:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 14:48:03 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596552483.33.0.317582526763.issue41474@roundup.psfhosted.org> STINNER Victor added the comment: > I don't know how to get rid of all those commit messages. I suggest you to create a local branch per change, rather than using "master". I consider that "origin" is git at github.com:python/cpython.git. Check your remotes with "git remote -v". Example where "master" is your PR 21732. git switch -c frameobject master git switch master git reset --hard origin/master # revert your changes Then fix your frameobject: git switch master git fetch && git merge --ff # ensure that you are up to date git switch frameobject git rebase master Check what you get: git log master.. --pretty=oneline You should see only one commit. Close your PR and create a new one on the "frameobject" branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:58:01 2020 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 04 Aug 2020 14:58:01 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596552483.33.0.317582526763.issue41474@roundup.psfhosted.org> Message-ID: Skip Montanaro added the comment: > > I don't know how to get rid of all those commit messages. > > I suggest you to create a local branch per change, rather than using "master". > > I consider that "origin" is git at github.com:python/cpython.git. Check your remotes with "git remote -v". Hmmm... Seems like a bunch of extra work for a one-line change to a Makefile... There's no easier way to create PRs for these trivial changes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 10:59:30 2020 From: report at bugs.python.org (Thor Whalen) Date: Tue, 04 Aug 2020 14:59:30 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594432702.71.0.688067369701.issue41232@roundup.psfhosted.org> Message-ID: Thor Whalen added the comment: Hi Terry, sorry for the later reply. Is this a bugfix? Well, I'm not sure what you would call a bug. Can't one always redefine a bug to be a feature, and visa versa? I would definitely say that the behavior (seeing one default in the signature, but a different one actually taking effect) is probably not a good one -- as this could lead to very hard to find... bugs. It seems in fact that third party "fix your decorators" packages such as `wrapt` and `boltons.funcutils` agree, since their implementation of `wraps` doesn't have this... "misaligned-by-default feature" that `functools.wraps` does. Unless I'm missing something, my guess of why `functools.wraps` doesn't include what I put in my pull request is that it breaks some tests. But I had a look at the failing test and it seems that it is the test that is "wrong" (i.e. tests for a behavior that really shouldn't be the default). See comment: https://github.com/python/cpython/pull/21379#issuecomment-655661983 The question is: Is there a lot of code out there that depends on this misaligned behavior. My guess is not. On Fri, Jul 10, 2020 at 9:58 PM Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > Is this actually a bugfix? > > ---------- > nosy: +terry.reedy > versions: +Python 3.10 -Python 3.8 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- nosy: +Thor Whalen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:04:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:04:07 +0000 Subject: [issue41476] test_zoneinfo fails if the _lzma module is missing Message-ID: <1596553447.24.0.104799735954.issue41476@roundup.psfhosted.org> New submission from STINNER Victor : Error when _lzma extension is missing: test test_zoneinfo crashed -- Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 272, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 223, in _runtest_inner2 the_module = importlib.import_module(abstest) File "/home/vstinner/python/master/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/vstinner/python/master/Lib/test/test_zoneinfo/__init__.py", line 1, in from .test_zoneinfo import * File "/home/vstinner/python/master/Lib/test/test_zoneinfo/test_zoneinfo.py", line 9, in import lzma File "/home/vstinner/python/master/Lib/lzma.py", line 27, in from _lzma import * ModuleNotFoundError: No module named '_lzma' The minimum fix is to skip test_zoneinfo is lzma is missing. For example, replace "import lzma" with "lzma = support.import_helper.import_module('lzma')". ---------- components: Tests messages: 374819 nosy: p-ganssle, vstinner priority: normal severity: normal status: open title: test_zoneinfo fails if the _lzma module is missing versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:05:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:05:40 +0000 Subject: [issue41477] test_genericalias fails if ctypes is missing Message-ID: <1596553540.81.0.229958329134.issue41477@roundup.psfhosted.org> New submission from STINNER Victor : Error: 0:05:47 load avg: 5.95 [311/423/2] test_genericalias failed -- running: test_multiprocessing_spawn (1 min 59 sec) test test_genericalias crashed -- Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 272, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 223, in _runtest_inner2 the_module = importlib.import_module(abstest) File "/home/vstinner/python/master/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/vstinner/python/master/Lib/test/test_genericalias.py", line 16, in from ctypes import Array, LibraryLoader File "/home/vstinner/python/master/Lib/ctypes/__init__.py", line 8, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' The minimum fix is to skip test_genericalias is ctypes is missing. For example, use "ctypes = support.import_helper.import_module('ctypes')" to import ctypes. See also bpo-41476: test_zoneinfo fails if the _lzma module is missing. ---------- components: Tests messages: 374820 nosy: vstinner priority: normal severity: normal status: open title: test_genericalias fails if ctypes is missing versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:07:30 2020 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 04 Aug 2020 15:07:30 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596553650.09.0.387297141821.issue41371@roundup.psfhosted.org> Paul Ganssle added the comment: I think for now skipping the tests when lzma is missing is the easiest thing, though another option would be to drop the compression on the input test data so that the tests don't depend on lzma. Taking a look at the data files, it looks like we get around 50% compression using either lzma or gzip, but the uncompressed file is only 32k to start with: $ du -b tests/data/* 31054 tests/data/zoneinfo_data.json 15127 tests/data/zoneinfo_data.json.gz 12895 tests/data/zoneinfo_data.json.lz We're also currently using the "fat" binaries that `zic` produces (which includes hard-coded transitions all the way until 2038). The new default for `zic` is to produce "slim" binaries, and the script to update test data does nothing to explicitly request fat binaries. If we were to switch over to "slim" binaries, the result would be more like this: $ du -b tests/data/* 8297 tests/data/zoneinfo_data_slim.json.gz 7750 tests/data/zoneinfo_data_slim.json.lz 15551 tests/data/zoneinfo_data_unc_slim.json So we're still looking at ~2:1 compression for both gzip and lzma, but the overall file size is 50% of what it was to start with. The biggest downside to this is that the way the "slim" binaries work is that once a rule repeats indefinitely, `zic` stops producing explicit transitions for it, and falls back to a simple repeating rule, meaning that the current set of tests would take a different code path. I think we can go with the following course of action (3 or 4 different PRs): 1. Start by skipping the tests when `lzma` is missing. 2. Update the test suite so that it is testing more or less the same thing when the binaries are compiled with `-b slim`. 3. Change `Lib/test/test_zoneinfo/data/update_test_data.py` so that it pulls the raw data from the `tzdata` module on PyPI (which is compiled with `-b slim`) instead of the user's machine. 4. Change `update_test_data.py` to stop using `lzma` and change the tests so that they are able to process the new format of the JSON files. If we ever decide that we really want the compression again, I assume that `gzip` is found more commonly than `lzma` among systems that don't build the whole standard library, so it might be mildly preferable to switch to `gzip`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:07:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:07:32 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596553652.14.0.411435709603.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: > https://buildbot.python.org/all/#builders/1/builds/1194 pythoninfo: sys.version: 3.10.0a0 (heads/master:da4e09fff6, Aug 4 2020, 03:30:43) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] gdb_version: GNU gdb (GDB) Fedora 9.2-2.fc33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:06:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:06:06 +0000 Subject: [issue41476] test_zoneinfo fails if the _lzma module is missing In-Reply-To: <1596553447.24.0.104799735954.issue41476@roundup.psfhosted.org> Message-ID: <1596553566.73.0.0858493731697.issue41476@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-41477: test_genericalias fails if ctypes is missing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:15:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:15:37 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596554137.12.0.838083518502.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: Other failures on a different architecture, aarch64 Fedora Rawhide Clang 3.9: https://buildbot.python.org/all/#/builders/687/builds/152 "gdb_version: GNU gdb (GDB) Fedora 9.2-2.fc33" "Stderr: Unable to fetch general registers.: No such process. Selected thread is running." https://buildbot.python.org/all/#/builders/687/builds/160 "gdb_version: GNU gdb (GDB) Fedora 9.2-2.fc33" "Stderr: Unable to fetch general registers.: No such process. Selected thread is running." See also bpo-40746: "test_gdb failing on 32-bit armv7l when built with GCC -Og (fail on Raspbian on 3.9, regression from 3.8)". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:16:06 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 04 Aug 2020 15:16:06 +0000 Subject: [issue41476] test_zoneinfo fails if the _lzma module is missing In-Reply-To: <1596553447.24.0.104799735954.issue41476@roundup.psfhosted.org> Message-ID: <1596554166.08.0.884731281767.issue41476@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Duplicate of https://bugs.python.org/issue41371 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:08:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:08:14 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596553694.96.0.740489431217.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: I failed to reproduce the issue on an up-to-date Fedora Rawhide with gdb-9.2-2.fc33.x86_64 ("GNU gdb (GDB) Fedora 9.2-2.fc33"). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:32:31 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 04 Aug 2020 15:32:31 +0000 Subject: [issue41466] Windows installer: "Add to PATH" should be checked by default In-Reply-To: <1596484705.61.0.378501501688.issue41466@roundup.psfhosted.org> Message-ID: <1596555151.35.0.246451814534.issue41466@roundup.psfhosted.org> Steve Dower added the comment: As Eryk says, the defaults include the "py" launcher, which is now recommended at the end of installation. Python is also available from the Start menu/screen, and PEP 514 allows other tools to reliably detect and offer Python installs. Modifying PATH at all is an advanced scenario, as it may cause other (unrelated) applications to stop working. Modifying PATH twice makes launching Python unreliable, and attempting to reverse the modification may leave the system in an unreliable state. We won't be changing the default. People who install from the Microsoft Store will get all the shortcuts they expect (assuming they are already Linux experts, otherwise they have no expectations anyway), because we are able to update what appears on PATH more safely. ---------- resolution: -> rejected stage: -> resolved status: -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:52:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:52:07 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596556327.72.0.202392933425.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 604bba1f8fe32479c89b9824b2231cc4480dd110 by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21452) https://github.com/python/cpython/commit/604bba1f8fe32479c89b9824b2231cc4480dd110 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 11:53:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 15:53:16 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596556396.24.0.518647562896.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c7decc27d529c04a4e6b2922e3f3f9419b920f63 by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21727) https://github.com/python/cpython/commit/c7decc27d529c04a4e6b2922e3f3f9419b920f63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:01:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 16:01:56 +0000 Subject: [issue29269] test_socket failing in solaris In-Reply-To: <1484340924.46.0.120687210952.issue29269@psf.upfronthosting.co.za> Message-ID: <1596556916.4.0.994722771477.issue29269@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:02:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 16:02:32 +0000 Subject: [issue32623] Resize dict on del/pop In-Reply-To: <1516639058.13.0.467229070634.issue32623@psf.upfronthosting.co.za> Message-ID: <1596556952.43.0.0748485989642.issue32623@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:03:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 16:03:36 +0000 Subject: [issue41439] test_uuid.py and test_ssl.py failure on OSes without os.fork (VxWorks RTOS) In-Reply-To: <1596089205.38.0.465991237875.issue41439@roundup.psfhosted.org> Message-ID: <1596557016.77.0.912849927201.issue41439@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:04:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 16:04:28 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1596557068.35.0.636188982265.issue31904@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:05:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 16:05:18 +0000 Subject: [issue40891] Use PEP 573 in functools In-Reply-To: <1591468044.26.0.252061125305.issue40891@roundup.psfhosted.org> Message-ID: <1596557118.82.0.513959956218.issue40891@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:06:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 04 Aug 2020 16:06:14 +0000 Subject: [issue12423] signal handler doesn't handle SIGABRT from os.abort In-Reply-To: <1309197130.0.0.320444785748.issue12423@psf.upfronthosting.co.za> Message-ID: <1596557174.37.0.386041002377.issue12423@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:30:20 2020 From: report at bugs.python.org (Mark Shannon) Date: Tue, 04 Aug 2020 16:30:20 +0000 Subject: [issue41463] Avoid duplicating jump information from opcode.py in compile.c In-Reply-To: <1596452415.91.0.969194719265.issue41463@roundup.psfhosted.org> Message-ID: <1596558620.22.0.475788970443.issue41463@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 582aaf19e8b94a70c1f96792197770d604ba0fdf by Mark Shannon in branch 'master': bpo-41463: Generate information about jumps from 'opcode.py' rather than duplicating it in 'compile.c' (GH-21714) https://github.com/python/cpython/commit/582aaf19e8b94a70c1f96792197770d604ba0fdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:47:24 2020 From: report at bugs.python.org (Ilya Kamenshchikov) Date: Tue, 04 Aug 2020 16:47:24 +0000 Subject: [issue41478] Empty representation of AssertionError Message-ID: <1596559644.4.0.529490005495.issue41478@roundup.psfhosted.org> New submission from Ilya Kamenshchikov : I have a high level wrapper where I am catching expection and present it in (more) user-friendly format with a message. try: raise ValueError except Exception as e: print(f"Following happened: {e}") >>> prints "Following happened: " Can an exception print it's class when it has no message? ---------- components: Interpreter Core messages: 374831 nosy: Ilya Kamenshchikov priority: normal severity: normal status: open title: Empty representation of AssertionError type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 12:59:04 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 04 Aug 2020 16:59:04 +0000 Subject: [issue41478] Empty representation of AssertionError In-Reply-To: <1596559644.4.0.529490005495.issue41478@roundup.psfhosted.org> Message-ID: <1596560344.26.0.719911748019.issue41478@roundup.psfhosted.org> R?mi Lapeyre added the comment: Hi, can you not use its repr: >>> try: raise ValueError ... except Exception as e: print(f"Following happened: {e!r}") ... Following happened: ValueError() ? ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 13:31:05 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Aug 2020 17:31:05 +0000 Subject: [issue41475] __future__.annotations set to become default in Python 4.0? In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596562265.93.0.285050992178.issue41475@roundup.psfhosted.org> Raymond Hettinger added the comment: $ python3.9 Python 3.9.0b4 (v3.9.0b4:69dec9c8d2, Jul 2 2020, 18:41:53) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from __future__ import annotations >>> annotations _Feature((3, 7, 0, 'beta', 1), (4, 0, 0, 'alpha', 0), 16777216) ---------- nosy: +lukasz.langa, rhettinger title: Fix mistake in "What's new in Python 3.7" -> __future__.annotations set to become default in Python 4.0? type: crash -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 13:55:49 2020 From: report at bugs.python.org (Nathan Maynes) Date: Tue, 04 Aug 2020 17:55:49 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596563749.99.0.934344671912.issue41371@roundup.psfhosted.org> Change by Nathan Maynes : ---------- pull_requests: +20879 pull_request: https://github.com/python/cpython/pull/21734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:13:07 2020 From: report at bugs.python.org (Tony Reix) Date: Tue, 04 Aug 2020 18:13:07 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596564787.45.0.711751559384.issue38628@roundup.psfhosted.org> Tony Reix added the comment: I do agree that the example with memchr is not correct. About your suggestion, I've done it. With 32. And that works fine. All 3 values are passed by value. # cat Pb-3.8.5.py #!/usr/bin/env python3 from ctypes import * mine = CDLL('./MemchrArgsHack2.so') class MemchrArgsHack2(Structure): _fields_ = [("s", c_char_p), ("c_n", c_ulong * 2)] memchr_args_hack2 = MemchrArgsHack2() memchr_args_hack2.s = b"abcdef" memchr_args_hack2.c_n[0] = ord('d') memchr_args_hack2.c_n[1] = 7 print( "sizeof(MemchrArgsHack2): ", sizeof(MemchrArgsHack2) ) print( CFUNCTYPE(c_char_p, MemchrArgsHack2, c_void_p) (('my_memchr', mine)) (memchr_args_hack2, None) ) # cat MemchrArgsHack2.c #include #include struct MemchrArgsHack2 { char *s; unsigned long c_n[2]; }; extern char *my_memchr(struct MemchrArgsHack2 args) { printf("s element : char pointer: %p %s\n", args.s, args.s); printf("c_n element 0: a Long: %ld\n", args.c_n[0]); printf("c_n element 1: a Long: %ld\n", args.c_n[1]); return(args.s +3); } TONY Modules/_ctypes/stgdict.c: MAX_STRUCT_SIZE=32 sizeof(MemchrArgsHack2): 24 TONY: libffi: src/powerpc/ffi_darwin.c : ffi_prep_cif_machdep() TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size:24 s->type:13 : FFI_TYPE_STRUCT TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() FFI_TYPE_STRUCT Before s->size:24 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size: 8 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size:16 s->type:13 : FFI_TYPE_STRUCT TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() FFI_TYPE_STRUCT Before s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:11 : FFI_TYPE_UINT64 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size: 8 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:11 : FFI_TYPE_UINT64 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() After ALIGN s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size:16 s->size:24 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() After ALIGN s->size:24 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c: ffi_call: FFI_AIX TONY: libffi: cif->abi: 1 -(long)cif->bytes : -144 cif->flags : 8 ecif.rvalue : fffffffffffd210 fn: 9001000a0227760 FFI_FN(ffi_prep_args) : 9001000a050a108 s element : char pointer: a00000000154d40 abcdef c_n element 0: a Long: 100 c_n element 1: a Long: 7 <<<< Correct value appears. b'def' With the regular version (16), I have: sizeof(MemchrArgsHack2): 24 TONY: libffi: src/powerpc/ffi_darwin.c : ffi_prep_cif_machdep() TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size:24 s->type:13 : FFI_TYPE_STRUCT TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() FFI_TYPE_STRUCT Before s->size:24 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size: 8 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() p->size: 8 s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() After ALIGN s->size:16 TONY: libffi: src/powerpc/ffi_darwin.c : aix_adjust_aggregate_sizes() s->size: 8 s->type:14 : FFI_TYPE_POINTER TONY: libffi: src/powerpc/ffi_darwin.c: ffi_call: FFI_AIX TONY: libffi: cif->abi: 1 -(long)cif->bytes : -144 cif->flags : 8 ecif.rvalue : fffffffffffd210 fn: 9001000a0227760 FFI_FN(ffi_prep_args) : 9001000a050a108 s element : char pointer: a00000000154d40 abcdef c_n element 0: a Long: 100 c_n element 1: a Long: 0 <<< Python pushed nothing for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:18:11 2020 From: report at bugs.python.org (Immo Wetzel) Date: Tue, 04 Aug 2020 18:18:11 +0000 Subject: [issue41479] pip install== will install 0.0.0 version in stead of showing alll Message-ID: <1596565091.91.0.157187140221.issue41479@roundup.psfhosted.org> New submission from Immo Wetzel : I do have a pip package with version id 0.0.0 on my own registry. If I try to get the list of available versions like before with pip install package_name== it will install version 0.0.0 of the package package_name thats not right ---------- messages: 374835 nosy: iwetzel priority: normal severity: normal status: open title: pip install== will install 0.0.0 version in stead of showing alll versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:18:57 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 18:18:57 +0000 Subject: [issue41480] python won't save Message-ID: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> New submission from LX Cubing : When I try to run python, it asks me if I want to save it or not. So I clicked yes, like I always do, but nothing happened. It didn't run at all. I keep trying, but still it won't save. ---------- messages: 374836 nosy: leoxie0733 priority: normal severity: normal status: open title: python won't save versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:28:13 2020 From: report at bugs.python.org (David Edelsohn) Date: Tue, 04 Aug 2020 18:28:13 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596565693.65.0.506199672253.issue38628@roundup.psfhosted.org> David Edelsohn added the comment: As mentioned in the stgdict.c comment, this relates back to #22273 and #29565. The passing of arrays/structs is fragile, to use a euphemism. The ctypes behavior conforms to the x64 Linux ABI and x64 libffi, even the comment from #22273, "Structs that are larger than 32 bytes get copied to the stack (see classify_argument in ffi64.c), so we don't have to worry about classifying their elements for register passing. Thus if a new field is added for this in StgDictObject, then PyCArrayType_new should only allocate it for array types that are 32 bytes or less. Using it for larger array types would serve no point. And now we're at the crux of the problem. I don't know what Ronald and others recommend. ctypes is choosing x64 behavior to define an inherently target-dependent and ABI-dependent design decisions. The real solution requires that _ctypes/stgdict.c incorporate target-specific logic, but it's not clear that the Python community wants to go down that path. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:35:49 2020 From: report at bugs.python.org (Immo Wetzel) Date: Tue, 04 Aug 2020 18:35:49 +0000 Subject: [issue41481] pip install will install version 0.0.0 if existing in stead of newer ones Message-ID: <1596566149.36.0.0442903263551.issue41481@roundup.psfhosted.org> New submission from Immo Wetzel : if a version 0.0.0 is existing in repo/index ... pip will install this version and not the newer ones. ---------- components: Installation messages: 374838 nosy: iwetzel priority: normal severity: normal status: open title: pip install will install version 0.0.0 if existing in stead of newer ones type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:54:18 2020 From: report at bugs.python.org (Ram Rachum) Date: Tue, 04 Aug 2020 18:54:18 +0000 Subject: [issue41475] __future__.annotations set to become default in Python 4.0? In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596567258.28.0.967962206608.issue41475@roundup.psfhosted.org> Ram Rachum added the comment: If you'd like me to patch that too, let me know. Also, I'll need a decision on whether it should be on a separate PR and if so, to which versions it should be backported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 14:56:25 2020 From: report at bugs.python.org (Rishav Kundu) Date: Tue, 04 Aug 2020 18:56:25 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596567385.57.0.0763532953716.issue41303@roundup.psfhosted.org> Rishav Kundu added the comment: Wouldn?t using mach_continuous_time (and its equivalents on other platforms) wherever possible be preferable? Or would a different API that distinguishes between clocks that track during suspend versus those that not be a better idea? Given that at least macOS and Linux offer both variants (not sure about Windows) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 15:54:05 2020 From: report at bugs.python.org (Eric Frederich) Date: Tue, 04 Aug 2020 19:54:05 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network Message-ID: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> New submission from Eric Frederich : The __init__ method for IPv4Network has a typo where it says all three of '192.0.2.0/24', '192.0.2.0/255.255.255.0' and '192.0.0.2/0.0.0.255' should be equal. ---------- assignee: docs at python components: Documentation messages: 374841 nosy: docs at python, eric.frederich priority: normal severity: normal status: open title: docstring errors in ipaddress.IPv4Network type: enhancement versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 15:58:31 2020 From: report at bugs.python.org (Roundup Robot) Date: Tue, 04 Aug 2020 19:58:31 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596571111.78.0.916642274928.issue41482@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +20880 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 15:58:40 2020 From: report at bugs.python.org (Nathan Maynes) Date: Tue, 04 Aug 2020 19:58:40 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596571120.64.0.364011881882.issue41371@roundup.psfhosted.org> Nathan Maynes added the comment: Im still trying to get the hang of the PR workflow so my apologies in advance. I closed the first PR by accident. I made the mistake of including a commit for another issue as well as the commit for this issue. When trying to clean up, I reverted back too far and Github closed the PR. I have submitted another PR that imports the lzma library as follows: from test.support.import_helper import import_module lzma = import_module('lzma') Let me know if something still does not look right. I'll have some time this evening to work it out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 16:55:23 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 04 Aug 2020 20:55:23 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596574523.56.0.106601463154.issue41480@roundup.psfhosted.org> Vedran ?a?i? added the comment: What exactly do you type/click and where? ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 17:49:51 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 21:49:51 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596577791.32.0.155201155771.issue41480@roundup.psfhosted.org> LX Cubing added the comment: Okay, so in the first picture, you see the * up there in the title right? That means that it needs to be saved. ---------- Added file: https://bugs.python.org/file49359/Annotation 2020-08-04 144455.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 17:57:02 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 21:57:02 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596578222.5.0.437341176939.issue41480@roundup.psfhosted.org> LX Cubing added the comment: So then, I click on the run button, which shows four more buttons: Run Module Run... Customized Check Module Python Shell So I click on the Run Module button, and this thing pops up that says Source Must Be Saved OK to Save? Okay Cancel So I clicked Okay, and it doesn't run at all. ---------- Added file: https://bugs.python.org/file49360/Annotation 2020-08-04 144527.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 17:57:39 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 21:57:39 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596578259.7.0.626904325748.issue41480@roundup.psfhosted.org> Change by LX Cubing : Added file: https://bugs.python.org/file49361/Annotation 2020-08-04 144709.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 17:58:05 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 21:58:05 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596578285.33.0.989330015851.issue41480@roundup.psfhosted.org> Change by LX Cubing : Added file: https://bugs.python.org/file49362/Annotation 2020-08-04 144726.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 17:58:33 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 21:58:33 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596578313.77.0.944229907919.issue41480@roundup.psfhosted.org> Change by LX Cubing : Added file: https://bugs.python.org/file49363/Annotation 2020-08-04 144803.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 17:59:41 2020 From: report at bugs.python.org (LX Cubing) Date: Tue, 04 Aug 2020 21:59:41 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596578381.04.0.693518485238.issue41480@roundup.psfhosted.org> LX Cubing added the comment: And it still shows the * there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 18:55:01 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 04 Aug 2020 22:55:01 +0000 Subject: [issue41481] pip install will install version 0.0.0 if existing in stead of newer ones In-Reply-To: <1596566149.36.0.0442903263551.issue41481@roundup.psfhosted.org> Message-ID: <1596581701.86.0.730057035213.issue41481@roundup.psfhosted.org> Steven D'Aprano added the comment: This is a bug tracker for issues with the Python language, interpreter and standard library. For third party applications like pip, please report bugs to their maintainers. https://github.com/pypa/pip/issues ---------- nosy: +steven.daprano resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 18:55:28 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 04 Aug 2020 22:55:28 +0000 Subject: [issue41479] pip install== will install 0.0.0 version in stead of showing alll In-Reply-To: <1596565091.91.0.157187140221.issue41479@roundup.psfhosted.org> Message-ID: <1596581728.14.0.757205358408.issue41479@roundup.psfhosted.org> Steven D'Aprano added the comment: This is a bug tracker for issues with the Python language, interpreter and standard library. For third party applications like pip, please report bugs to their maintainers. https://github.com/pypa/pip/issues ---------- nosy: +steven.daprano resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 18:57:38 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 04 Aug 2020 22:57:38 +0000 Subject: [issue41475] __future__.annotations set to become default in Python 4.0? In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596581858.77.0.0680952709773.issue41475@roundup.psfhosted.org> Raymond Hettinger added the comment: Keep it focused one place ? there's no benefit to multiple tracker entries and/or multiple PRs. Do look to see all the places that would be need to be updated. Also, let ?ukasz reply ? this was his PEP. Also, I'm not sure that we're backporting anything to 3.7 at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 20:09:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 00:09:54 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596586194.7.0.924682763936.issue41467@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 Aug 4 20:10:19 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 00:10:19 +0000 Subject: [issue31819] Add sock_recv_into to AbstractEventLoop In-Reply-To: <1508434669.81.0.213398074469.issue31819@psf.upfronthosting.co.za> Message-ID: <1596586219.63.0.225826438922.issue31819@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +giampaolo.rodola _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 20:14:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 00:14:01 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596586441.33.0.993645905497.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: > I created bpo-41467: asyncio: recv_into() must not return b'' if the socket/pipe is closed. This was a real asyncio bug, specific to Windows, and it's now fixed. But the initial bug report was on Unix (Linux?) and is different: > Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 20:17:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 00:17:51 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1596586671.38.0.615807081593.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: Another error? aarch64 RHEL8 LTO + PGO 3.x: https://buildbot.python.org/all/#/builders/618/builds/835 1 test altered the execution environment: test_asyncio 0:01:55 load avg: 7.00 [329/423/1] test_asyncio failed (env changed) (1 min 25 sec) -- running: test_peg_generator (1 min) Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/sslproto.py", line 321, in __del__ self.close() File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/sslproto.py", line 316, in close self._ssl_protocol._start_shutdown() File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/sslproto.py", line 590, in _start_shutdown self._abort() File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/sslproto.py", line 731, in _abort self._transport.abort() File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/selector_events.py", line 678, in abort self._force_close(None) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/selector_events.py", line 729, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/base_events.py", line 746, in call_soon self._check_closed() File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-aarch64.lto-pgo/build/Lib/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed (...) The error occurred in _SSLProtocolTransport.__del__() on self.close(). The previous line is: _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) But I cannot see the warning in tests. Maybe the bug occurred in a test which hides logs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 20:29:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 00:29:37 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596587377.43.0.697227308654.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: > Or would a different API that distinguishes between clocks that track during suspend versus those that not be a better idea? Given that at least macOS and Linux offer both variants (not sure about Windows) I don't think that all platforms provide a clock for Python time.perf_counter() which include suspend. So I'm not sure that it's useful to only change the behavior on macOS, and only depending on the macOS version (and macOS target version). Maybe a new clock is needed, clock which has a well defined behavior for system suspend, on any platform. Such clock may not be available on all platforms. FYI on Python 3.3, time.monotonic() was not available on all platforms. It became available on all platforms on Python 3.5. https://docs.python.org/dev/library/time.html#time.monotonic ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 20:42:30 2020 From: report at bugs.python.org (Rishav Kundu) Date: Wed, 05 Aug 2020 00:42:30 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596588150.81.0.339072949591.issue41303@roundup.psfhosted.org> Rishav Kundu added the comment: > Maybe a new clock is needed, clock which has a well defined behavior for system suspend, on any platform. I?d like to work on this, if possible. Linux and macOS support seems to be straightforward. I will have to look into other platforms. What would be the protocol exactly? Should I float a discussion on the ideas mailing list? Open a new bpo? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 20:46:26 2020 From: report at bugs.python.org (Joshua Bronson) Date: Wed, 05 Aug 2020 00:46:26 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596588386.46.0.38776280338.issue41303@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 21:08:07 2020 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 05 Aug 2020 01:08:07 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596589687.6.0.156396477796.issue41303@roundup.psfhosted.org> Nathaniel Smith added the comment: I made a record of my investigations here: https://github.com/python-trio/trio/issues/1586 One reason we might care about this is that asyncio ought to be using a clock that stops ticking while suspended. (On which note: Please don't switch macOS to use clock_gettime(CLOCK_MONOTONIC); that would be a breaking change for us!) At least Linux, macOS, FreeBSD, and Windows all have a way to access a monotonic clock that stops ticking while the system is suspended. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 21:49:18 2020 From: report at bugs.python.org (Inada Naoki) Date: Wed, 05 Aug 2020 01:49:18 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1596592158.49.0.210256896322.issue36346@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 270b4ad4df795783d417ba15080da8f95e598689 by Inada Naoki in branch 'master': bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479) https://github.com/python/cpython/commit/270b4ad4df795783d417ba15080da8f95e598689 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 21:49:27 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 01:49:27 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1596592167.78.0.375978680433.issue36346@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20885 pull_request: https://github.com/python/cpython/pull/21739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 21:49:17 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 01:49:17 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1596592157.51.0.63780028531.issue36346@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20884 pull_request: https://github.com/python/cpython/pull/21738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 21:56:14 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 01:56:14 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1596592574.67.0.989611170365.issue36346@roundup.psfhosted.org> miss-islington added the comment: New changeset ea680631b478f091a171dc802d861f5014f58c8f by Miss Islington (bot) in branch '3.9': bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479) https://github.com/python/cpython/commit/ea680631b478f091a171dc802d861f5014f58c8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 4 21:57:13 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 01:57:13 +0000 Subject: [issue36346] Prepare for removing the legacy Unicode C API In-Reply-To: <1552918981.83.0.901300276481.issue36346@roundup.psfhosted.org> Message-ID: <1596592633.83.0.499391931502.issue36346@roundup.psfhosted.org> miss-islington added the comment: New changeset f0e030cacb940f061e0b09efbffc2fd984b95259 by Miss Islington (bot) in branch '3.8': bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479) https://github.com/python/cpython/commit/f0e030cacb940f061e0b09efbffc2fd984b95259 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 01:37:12 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 05 Aug 2020 05:37:12 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596605832.96.0.916115032177.issue41480@roundup.psfhosted.org> Vedran ?a?i? added the comment: Thanks for a very precise report. Have you tried to manually save your file (File > Save As)? Also, how did the file get that name (PPTests0.1.py)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 01:43:20 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 05 Aug 2020 05:43:20 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596606200.27.0.522322943962.issue41480@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 02:06:13 2020 From: report at bugs.python.org (Kostis Anagnostopoulos) Date: Wed, 05 Aug 2020 06:06:13 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined Message-ID: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> New submission from Kostis Anagnostopoulos : The `logging.handlers.MemoryHandler.flush()` method acquire the lock even if target has not been set, and the method is a noop: ``` def flush(self): # (Docstring skipped) self.acquire() try: if self.target: for record in self.buffer: self.target.handle(record) self.buffer..clear() finally: self.release() ``` An optimized version would re-arrrange the nesting to avoid the locking: ``` def flush(self): # (Docstring skipped) if self.target: self.acquire() try: for record in self.buffer: self.target.handle(record) self.buffer.clear() finally: self.release() ``` - There is no use-case, beyond the expected performance gain. - Without having searched, i would deem highly improbable the existence of code in the std-library or 3rdp code that depends on the current noop-locking when `flush()` is called. ---------- components: Library (Lib) messages: 374859 nosy: ankostis, penlect, vinay.sajip priority: normal severity: normal status: open title: Do not acquire lock in MemoryHandler.flush() if no target defined type: performance versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 03:33:25 2020 From: report at bugs.python.org (=?utf-8?q?Admir_Ljubijanki=C4=87?=) Date: Wed, 05 Aug 2020 07:33:25 +0000 Subject: [issue41484] Overriding dictionary value under wrong key. Message-ID: <1596612805.37.0.383723382681.issue41484@roundup.psfhosted.org> New submission from Admir Ljubijanki? : I'm writing a function that combines two dictionaries called "baseProducts" and "variantProducts". The logic behind is simple, I loop trough variantProducts, create a string that will be used as a key for that combined product. Add all values of baseProduct under that key, and add all fitting variants to this new nested dictionary under key "variants". And return the new dict once all variants are grouped correctly. The code looks something like this: def combineProductsByColor(baseProducts, variantProducts): retDict = {} for key, variant in variantProducts.items(): productKey = variant['parent'] + '_' + variant['color'] if productKey not in retDict: retDict[productKey] = baseProducts[variant['parent']] retDict[productKey]['variants'] = {} retDict[productKey]['variants'][key] = variant return retDict Now with my test data, baseProducts only contains one item in it. While variantProducts contain 4 items. When the first two loops happen it creates a new key, and adds the first and second variant under that key correctly (this was tested using ms code debugger) but when it looks at the 3rd item, it creates a new key, and adds the variant to that key, but it also overrides all the variants in the previous key, even if the variable productKey is the new key. And when the 4th item gets processed it again gets added to both. So to make sure that I'm not getting some wrong key somehow. I also tried to implement it like this: def combineProductsByColor(baseProducts, variantProducts): retDict = {} keys = list(variantProducts.keys()) for k in keys: productKey = variantProducts[k]['parent'] + '_' + variantProducts[k]['color'] if productKey not in retDict: retDict[productKey] = baseProducts[variantProducts[k]['parent']] retDict[productKey]['variants'] = {} retDict[productKey]['variants'][k] = variantProducts[k] return retDict But the result was identical. Again following the whole procedure with ms code debugger. I've also tried making the productKey simpler, but the problem still remains. Now I do have an idea how to implement this in a different way, but I don't see and understand why the code I provided doesn't work. Because when the new key gets generated, its not the same as the old, but it still can change values under the old key. Here is what the data looks like before and after processing it. baseProducts: { '2321963000004': { 'code': 'P20-0002', 'name': '?enske hla?e', 'regular_price': '22,99', 'vat': '22,00', 'attrib': { 'material': '97% bomba?, 3% elastan, 20% viskoza, 5% elastan' }, 'categories': ['01', '0101', '010104'] } } variantProducts: { '2321963991029': { 'parent': '2321963000004', 'color': '99', 'size': '102', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None }, '2321963991036': { 'parent': '2321963000004', 'color': '99', 'size': '103', 'title': None, 'name': None, 'regular_price': '25,99', 'vat': '22,00', 'attrib': None, 'categories': None }, '2321963981029': { 'parent': '2321963000004', 'color': '98', 'size': '102', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None }, '2321963981036': { 'parent': '2321963000004', 'color': '98', 'size': '103', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None } } And last combined data: { '2321963000004_99': { 'code': 'P20-0002', 'name': '?enske hla?e', 'regular_price': '22,99', 'vat': '22,00', 'attrib': { 'material': '97% bomba?, 3% elastan, 20% viskoza, 5% elastan' }, 'categories': ['01', '0101', '010104'], 'variants': { '2321963981029': { 'parent': '2321963000004', 'color': '98', 'size': '102', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None }, '2321963981036': { 'parent': '2321963000004', 'color': '98', 'size': '103', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None } } }, '2321963000004_98': { 'code': 'P20-0002', 'name': '?enske hla?e', 'regular_price': '22,99', 'vat': '22,00', 'attrib': { 'material': '97% bomba?, 3% elastan, 20% viskoza, 5% elastan' }, 'categories': ['01', '0101', '010104'], 'variants': { '2321963981029': { 'parent': '2321963000004', 'color': '98', 'size': '102', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None }, '2321963981036': { 'parent': '2321963000004', 'color': '98', 'size': '103', 'title': None, 'name': None, 'regular_price': None, 'vat': None, 'attrib': None, 'categories': None } } } } ---------- components: macOS messages: 374860 nosy: admir, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Overriding dictionary value under wrong key. type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 03:46:26 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Aug 2020 07:46:26 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596613586.61.0.892517778775.issue38628@roundup.psfhosted.org> Ronald Oussoren added the comment: As I mentioned earlier the code in sgtdict.c seems dodgy, the libffi representation for an array in a dict should be the same regardless of the size of the dictionary. That said, I haven't studied the ctypes code yet and am not sure if my analysis is correct. In the end we'll need some unit tests that demonstrate the issue as well as a patch that fixes it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 04:34:13 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Aug 2020 08:34:13 +0000 Subject: [issue41484] Overriding dictionary value under wrong key. In-Reply-To: <1596612805.37.0.383723382681.issue41484@roundup.psfhosted.org> Message-ID: <1596616453.07.0.382991503768.issue41484@roundup.psfhosted.org> Ronald Oussoren added the comment: This is expected behaviour. the assessment to retProduct[productKey] is not a copy. If those variants have the same parent and a different color you'll end up with a baseProduct where 'variants' refers to the same variant dict (and the second color seen will overwrite the value of 'variants') ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 04:37:44 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Aug 2020 08:37:44 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1596616664.31.0.623951635079.issue38628@roundup.psfhosted.org> Ronald Oussoren added the comment: Relevant libffi documentation: https://github.com/libffi/libffi/blob/4661ba7928b49588aec9e6976673208c8cbf0295/doc/libffi.texi#L505 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:05:28 2020 From: report at bugs.python.org (Eric Wieser) Date: Wed, 05 Aug 2020 09:05:28 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip Message-ID: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> New submission from Eric Wieser : Python distinguishes signed zeros by their repr: # floats >>> 0.0 0.0 >>> -0.0 -0.0 # complex >>> complex(0.0, 0.0) # A 0j >>> complex(0.0, -0.0) # B -0j >>> complex(-0.0, 0.0) # C (-0+0j) >>> complex(-0.0, -0.0) # D (-0+0j) However, only one of these `complex` reprs round-trips: >>> 0j # ok 0j >>> -0j # doesn't round-trip (-0-0j) >>> (-0+0j) # doesn't round-trip 0j >>> (-0-0j) 0j ---------- components: Interpreter Core messages: 374864 nosy: Eric Wieser priority: normal severity: normal status: open title: Repr of complex number with signed zero does not roundtrip versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:07:30 2020 From: report at bugs.python.org (Eric Wieser) Date: Wed, 05 Aug 2020 09:07:30 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596618450.15.0.339855100807.issue41485@roundup.psfhosted.org> Eric Wieser added the comment: This was reported and closed in https://bugs.python.org/issue17336, but it seems to me that this is easy to avoid - have `__repr__` return `complex(...)` for values which do not round-trip. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:11:16 2020 From: report at bugs.python.org (E. Paine) Date: Wed, 05 Aug 2020 09:11:16 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596618676.37.0.475033519383.issue41480@roundup.psfhosted.org> E. Paine added the comment: Sorry for this issue, IDLE 3.8.5 has a known (and now resolved) issue with saving if the file was empty when opened (see #41373). If this is not your problem, please do come back and say so, but otherwise this issue should be closed as a duplicate. ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:12:11 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Wed, 05 Aug 2020 09:12:11 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596618731.29.0.568347126032.issue41485@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:55:44 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 09:55:44 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module Message-ID: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> New submission from Ma Lin : ? bz2/lzma module's current growth algorithm bz2/lzma module's initial output buffer size is 8KB [1][2], and they are using this output buffer growth algorithm [3][4]: newsize = size + (size >> 3) + 6 [1] https://github.com/python/cpython/blob/v3.9.0b4/Modules/_bz2module.c#L109 [2] https://github.com/python/cpython/blob/v3.9.0b4/Modules/_lzmamodule.c#L124 [3] https://github.com/python/cpython/blob/v3.9.0b4/Modules/_lzmamodule.c#L133 [4] https://github.com/python/cpython/blob/v3.9.0b4/Modules/_bz2module.c#L121 For many case, the output buffer is resized too many times. You may paste this code to REPL to see the growth step: size = 8*1024 for i in range(1, 120): print('Step %d ' % i, format(size, ','), 'bytes') size = size + (size >> 3) + 6 Step 1 8,192 bytes Step 2 9,222 bytes Step 3 10,380 bytes Step 4 11,683 bytes Step 5 13,149 bytes Step 6 14,798 bytes ... ? zlib module's current growth algorithm zlib module's initial output buffer size is 16KB [5], in each growth the buffer size doubles [6]. [5] https://github.com/python/cpython/blob/v3.9.0b4/Modules/zlibmodule.c#L32 [6] https://github.com/python/cpython/blob/v3.9.0b4/Modules/zlibmodule.c#L174 This algorithm has a higher risk of running out of memory: ... Step 14 256 MB Step 15 512 MB Step 16 1 GB Step 17 2 GB Step 18 4 GB Step 19 8 GB Step 20 16 GB Step 21 32 GB Step 22 64 GB ... ? Add _BlocksOutputBuffer for bz2/lzma/zlib module Proposed PR uses a list of bytes object to represent output buffer. It can eliminate the overhead of resizing (bz2/lzma), and prevent excessive memory footprint (zlib). I only tested decompression, because the result is more obvious than compression. For special data benchmark (all data consists of b'a'), see these attached pictures, _BlocksOutputBuffer has linear performance: (Benchmark by attached file benchmark.py) 0to2GB_step30MB.png (Decompress from 0 to 2GB, 30MB step) 0to200MB_step2MB.png (Decompress from 0 to 200MB, 2MB step) 0to20MB_step64KB.png (Decompress from 0 to 20MB, 64KB step) After switching to _BlocksOutputBuffer, the code of bz2/lzma is more concise, the code of zlib is basically translated statement by statement, IMO it's safe and easy for review. ? Real data benchmark For real data, the weight of resizing output buffer is not big, so the performance improvement is not as big as above pictures: (Benchmark by attached file benchmark_real.py) ----------------- bz2 ----------------- linux-2.6.39.4.tar.bz2 input size: 76,097,195, output size: 449,638,400 best of 5: [baseline_raw] 12.954 sec -> [patched_raw] 11.600 sec, 1.12x faster (-10%) firefox-79.0.linux-i686.tar.bz2 input size: 74,109,706, output size: 228,055,040 best of 5: [baseline_raw] 8.511 sec -> [patched_raw] 7.829 sec, 1.09x faster (-8%) ffmpeg-4.3.1.tar.bz2 input size: 11,301,038, output size: 74,567,680 best of 5: [baseline_raw] 1.915 sec -> [patched_raw] 1.671 sec, 1.15x faster (-13%) gimp-2.10.20.tar.bz2 input size: 33,108,938, output size: 214,179,840 best of 5: [baseline_raw] 5.794 sec -> [patched_raw] 4.964 sec, 1.17x faster (-14%) sde-external-8.56.0-2020-07-05-lin.tar.bz2 input size: 26,746,086, output size: 92,129,280 best of 5: [baseline_raw] 3.153 sec -> [patched_raw] 2.835 sec, 1.11x faster (-10%) ----------------- lzma ----------------- linux-5.7.10.tar.xz input size: 112,722,840, output size: 966,062,080 best of 5: [baseline_raw] 9.813 sec -> [patched_raw] 7.434 sec, 1.32x faster (-24%) linux-2.6.39.4.tar.xz input size: 63,243,812, output size: 449,638,400 best of 5: [baseline_raw] 5.256 sec -> [patched_raw] 4.200 sec, 1.25x faster (-20%) gcc-9.3.0.tar.xz input size: 70,533,868, output size: 618,608,640 best of 5: [baseline_raw] 6.398 sec -> [patched_raw] 4.878 sec, 1.31x faster (-24%) Python-3.8.5.tar.xz input size: 18,019,640, output size: 87,531,520 best of 5: [baseline_raw] 1.315 sec -> [patched_raw] 1.098 sec, 1.20x faster (-16%) firefox-79.0.source.tar.xz input size: 333,220,776, output size: 2,240,573,440 best of 5: [baseline_raw] 25.339 sec -> [patched_raw] 19.661 sec, 1.29x faster (-22%) ----------------- zlib ----------------- linux-5.7.10.tar.gz input size: 175,493,557, output size: 966,062,080 best of 5: [baseline_raw] 2.360 sec -> [patched_raw] 2.401 sec, 1.02x slower (+2%) linux-2.6.39.4.tar.gz input size: 96,011,459, output size: 449,638,400 best of 5: [baseline_raw] 1.215 sec -> [patched_raw] 1.216 sec, 1.00x slower (+0%) gcc-9.3.0.tar.gz input size: 124,140,228, output size: 618,608,640 best of 5: [baseline_raw] 1.668 sec -> [patched_raw] 1.555 sec, 1.07x faster (-7%) Python-3.8.5.tgz input size: 24,149,093, output size: 87,531,520 best of 5: [baseline_raw] 0.263 sec -> [patched_raw] 0.253 sec, 1.04x faster (-4%) openjdk-14.0.2_linux-x64_bin.tar.gz input size: 198,606,190, output size: 335,175,680 best of 5: [baseline_raw] 1.273 sec -> [patched_raw] 1.221 sec, 1.04x faster (-4%) postgresql-10.12-1-linux-x64-binaries.tar.gz input size: 159,090,037, output size: 408,678,400 best of 5: [baseline_raw] 1.415 sec -> [patched_raw] 1.401 sec, 1.01x faster (-1%) -------------- benchmark end -------------- ? Add .readall() function to _compression.DecompressReader class The last commit add .readall() function to _compression.DecompressReader, it optimize the .read(-1) for BZ2File/LZMAFile/GzipFile object. The following description is a bit complicate: 1, BZ2File/LZMAFile/GzipFile object has a `self._buffer` attribute [7]: raw = _compression.DecompressReader(fp, BZ2Decompressor/LZMADecompressor/zlib.decompressobj) self._buffer = io.BufferedReader(raw) [7] https://github.com/python/cpython/blob/v3.9.0b4/Lib/lzma.py#L130-L132 2, When call `.read(-1)` function (read all data) on BZ2File/LZMAFile/GzipFile object, will dispatch to `self._buffer`'s .read(-1) function [8]. [8] https://github.com/python/cpython/blob/v3.9.0b4/Lib/lzma.py#L200 3, `self._buffer` is an io.BufferedReader object, it will dispatch to underlying stream's readall() function [9]. [9] https://github.com/python/cpython/blob/v3.9.0b4/Modules/_io/bufferedio.c#L1538-L1542 4, The underlying stream is a _compression.DecompressReader object, which is a subclass of io.RawIOBase [10]. [10] https://github.com/python/cpython/blob/v3.9.0b4/Lib/_compression.py#L33 5, Then io.RawIOBase's readall() function is called, but it's very inefficient. It only read DEFAULT_BUFFER_SIZE (8KB) data each time. [11] [11] https://github.com/python/cpython/blob/v3.9.0b4/Modules/_io/iobase.c#L968-L969 6, So each time the decompressor will try to decompress 8KB input data to a 8KB output buffer [12]: data = self._decompressor.decompress(8KB_input_buffer, 8KB_output_buffer) [12] https://github.com/python/cpython/blob/v3.9.0b4/Lib/_compression.py#L103 In most cases, the input buffer will not be fully decompressed, this brings unnecessary overhead. After adding the .readall() function to _compression.DecompressReader, the limit of the output buffer size has been removed. This change requires _BlocksOutputBuffer, otherwise, in extreme cases (small input buffer be decompressed to 100MB data), it will be slower due to the overhead of buffer resizing. Benchmark with real data, call .read(-1) on XXXXFile object: (Benchmark by attached file benchmark_real.py) ----------------- BZ2File ----------------- linux-2.6.39.4.tar.bz2 input size: 76,097,195, output size: 449,638,400 best of 5: [baseline_file] 12.371 sec -> [patched_file] 12.035 sec, 1.03x faster (-3%) firefox-79.0.linux-i686.tar.bz2 input size: 74,109,706, output size: 228,055,040 best of 5: [baseline_file] 8.233 sec -> [patched_file] 8.124 sec, 1.01x faster (-1%) ffmpeg-4.3.1.tar.bz2 input size: 11,301,038, output size: 74,567,680 best of 5: [baseline_file] 1.747 sec -> [patched_file] 1.724 sec, 1.01x faster (-1%) gimp-2.10.20.tar.bz2 input size: 33,108,938, output size: 214,179,840 best of 5: [baseline_file] 5.220 sec -> [patched_file] 5.162 sec, 1.01x faster (-1%) sde-external-8.56.0-2020-07-05-lin.tar.bz2 input size: 26,746,086, output size: 92,129,280 best of 5: [baseline_file] 2.935 sec -> [patched_file] 2.899 sec, 1.01x faster (-1%) ----------------- LZMAFile ----------------- linux-5.7.10.tar.xz input size: 112,722,840, output size: 966,062,080 best of 5: [baseline_file] 7.712 sec -> [patched_file] 7.670 sec, 1.01x faster (-1%) linux-2.6.39.4.tar.xz input size: 63,243,812, output size: 449,638,400 best of 5: [baseline_file] 4.342 sec -> [patched_file] 4.274 sec, 1.02x faster (-2%) gcc-9.3.0.tar.xz input size: 70,533,868, output size: 618,608,640 best of 5: [baseline_file] 5.077 sec -> [patched_file] 4.974 sec, 1.02x faster (-2%) Python-3.8.5.tar.xz input size: 18,019,640, output size: 87,531,520 best of 5: [baseline_file] 1.093 sec -> [patched_file] 1.087 sec, 1.01x faster (-1%) firefox-79.0.source.tar.xz input size: 333,220,776, output size: 2,240,573,440 best of 5: [baseline_file] 20.748 sec -> [patched_file] 20.276 sec, 1.02x faster (-2%) ----------------- GzipFile ----------------- linux-5.7.10.tar.gz input size: 175,493,567, output size: 966,062,080 best of 5: [baseline_file] 4.422 sec -> [patched_file] 3.803 sec, 1.16x faster (-14%) linux-2.6.39.4.tar.gz input size: 96,011,469, output size: 449,638,400 best of 5: [baseline_file] 2.119 sec -> [patched_file] 1.863 sec, 1.14x faster (-12%) gcc-9.3.0.tar.gz input size: 124,140,238, output size: 618,608,640 best of 5: [baseline_file] 2.825 sec -> [patched_file] 2.409 sec, 1.17x faster (-15%) Python-3.8.5.tgz input size: 24,149,103, output size: 87,531,520 best of 5: [baseline_file] 0.410 sec -> [patched_file] 0.349 sec, 1.18x faster (-15%) openjdk-14.0.2_linux-x64_bin.tar.gz input size: 198,606,200, output size: 335,175,680 best of 5: [baseline_file] 1.885 sec -> [patched_file] 1.702 sec, 1.11x faster (-10%) postgresql-10.12-1-linux-x64-binaries.tar.gz input size: 159,090,047, output size: 408,678,400 best of 5: [baseline_file] 2.236 sec -> [patched_file] 2.002 sec, 1.12x faster (-10%) -------------- benchmark end -------------- ---------- components: Library (Lib) messages: 374867 nosy: malin priority: normal severity: normal status: open title: Add _BlocksOutputBuffer for bz2/lzma/zlib module type: performance versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:58:27 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 09:58:27 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1596621507.16.0.027359057514.issue41486@roundup.psfhosted.org> Change by Ma Lin : Added file: https://bugs.python.org/file49364/0to2GB_step30MB.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:58:49 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 09:58:49 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1596621529.99.0.28182744052.issue41486@roundup.psfhosted.org> Change by Ma Lin : Added file: https://bugs.python.org/file49365/0to200MB_step2MB.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:59:05 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 09:59:05 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1596621545.37.0.842398362369.issue41486@roundup.psfhosted.org> Change by Ma Lin : Added file: https://bugs.python.org/file49366/0to20MB_step64KB.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:59:34 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 09:59:34 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1596621574.83.0.223753637774.issue41486@roundup.psfhosted.org> Change by Ma Lin : Added file: https://bugs.python.org/file49367/benchmark.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 05:59:54 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 09:59:54 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1596621594.6.0.03932182049.issue41486@roundup.psfhosted.org> Change by Ma Lin : Added file: https://bugs.python.org/file49368/benchmark_real.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 06:02:14 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 10:02:14 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1596621734.13.0.416135140325.issue41486@roundup.psfhosted.org> Change by Ma Lin : ---------- keywords: +patch pull_requests: +20886 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 06:06:39 2020 From: report at bugs.python.org (Ma Lin) Date: Wed, 05 Aug 2020 10:06:39 +0000 Subject: [issue41265] lzma/bz2 module: inefficient buffer growth algorithm In-Reply-To: <1594370733.96.0.701626485898.issue41265@roundup.psfhosted.org> Message-ID: <1596621999.14.0.0880749170642.issue41265@roundup.psfhosted.org> Ma Lin added the comment: A more thorough solution was used, see issue41486. So I close this issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 06:30:35 2020 From: report at bugs.python.org (Shlomi Fish) Date: Wed, 05 Aug 2020 10:30:35 +0000 Subject: [issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) Message-ID: <1596623435.88.0.500860382488.issue41487@roundup.psfhosted.org> New submission from Shlomi Fish : As the pure-Python code below demonstrates, when called as `python3 test.py jitshift` it is much faster than when called as `python3 test.py builtinops` (which takes many seconds/minutes past the 24th iteration). I am using fedora 32 x86-64 on a Cannon lake intel core i5 NUC. Tested with latest cpython3 git master and with /usr/bin/pypy3 The improvement was done in pure-python / userland and may be improved upon further given these or others: https://gmplib.org/ and https://github.com/ridiculousfish/libdivide . ``` #!/usr/bin/env python3 # The Expat License # # Copyright (c) 2020, Shlomi Fish # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import sys OPT = "builtinops" def mytest(p): pint2p = p << p myrange = range(1000) if OPT == "builtinpow": ret = pow(2, (1 << p), pint2p) elif OPT == "builtinops": ret = 2 for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) ret %= pint2p print('after mod', i, (ret % 10 ** 20), flush=True) else: class ShiftMod: """docstring for ShiftMod:d""" def __init__(self, base, shift): self.base = base self.shift = shift self.mask = (1 << shift) - 1 self.n = base << shift def mod(self, inp): if inp < self.n: return inp return ((((inp >> self.shift) % self.base) << self.shift) | (inp & self.mask)) def gen_shift_mod(x): s = 0 for offset in (200000, 20000, 2000, 200, 20, 1): bits_mask = (1 << offset) - 1 while x & bits_mask == 0: s += offset x >>= offset return ShiftMod(x, s) ret = 2 if OPT == "shiftmodpre": m = ShiftMod(p, p) for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) # m = gen_shift_mod(pint2p) ret = m.mod(ret) print('after mod', i, (ret % 10 ** 20), flush=True) elif OPT == "gen_shift_mod": m = gen_shift_mod(pint2p) for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) ret = m.mod(ret) print('after mod', i, (ret % 10 ** 20), flush=True) elif OPT == "jitshift": for i in myrange: print('sq', i, flush=True) ret *= ret print('mod', i, flush=True) ret = gen_shift_mod(pint2p).mod(ret) print('after mod', i, (ret % 10 ** 20), flush=True) return ret % (p*p) // p def main(which): global OPT OPT = which ''' if which == "builtinpow": OPT = 1 elif which == "builtinops": OPT = 0 elif which == "shiftmod": OPT = 2 else: raise Exception("unknown choice") ''' x = mytest(9816593) print(x) return if __name__ == "__main__": main(sys.argv[1]) ``` ---------- components: Interpreter Core files: modtest.py messages: 374869 nosy: shlomif2 priority: normal severity: normal status: open title: Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) type: performance versions: Python 3.10 Added file: https://bugs.python.org/file49369/modtest.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 06:36:54 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Wed, 05 Aug 2020 10:36:54 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596623814.92.0.00423676489947.issue41485@roundup.psfhosted.org> R?mi Lapeyre added the comment: This is a known issue and I have a PR that does this that I could post but it was rejected when it was previously discussed: https://bugs.python.org/issue23229#msg233963 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:06:43 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:06:43 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596625603.51.0.162211118281.issue41485@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:10:32 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:10:32 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596625832.87.0.62528793303.issue41485@roundup.psfhosted.org> Mark Dickinson added the comment: Closing here; to the extent that it's possible, let's keep the discussion in one place (comments can still be posted on closed issues). I'll add a comment on #17336. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Complex number representation round-trip doesn't work with signed zero values _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:12:17 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:12:17 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1596625937.24.0.376550375131.issue17336@roundup.psfhosted.org> Mark Dickinson added the comment: The issue of changing the complex repr came up again in #41485, which has been closed as a duplicate of this issue. See also https://bugs.python.org/issue23229#msg233963, where Guido says: > BTW I don't want repr() of a complex number to use the complex(..., ...) notation -- it's too verbose. FWIW, I'd be +1 on changing the complex repr, but given Guido's opposition we're probably looking at a PEP to make that happen, and I don't have the bandwidth or the energy to push such a PEP through. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:13:18 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 05 Aug 2020 11:13:18 +0000 Subject: [issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) In-Reply-To: <1596623435.88.0.500860382488.issue41487@roundup.psfhosted.org> Message-ID: <1596625998.39.0.775040331769.issue41487@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lemburg, mark.dickinson, rhettinger, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:13:18 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:13:18 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1596625998.12.0.867929823202.issue17336@roundup.psfhosted.org> Mark Dickinson added the comment: Also related: #40269 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:14:17 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:14:17 +0000 Subject: [issue40269] Inconsistent complex behavior with (-1j) In-Reply-To: <1586736208.71.0.129112794549.issue40269@roundup.psfhosted.org> Message-ID: <1596626057.45.0.0785354053999.issue40269@roundup.psfhosted.org> Mark Dickinson added the comment: Updating resolution to "duplicate", in an effort to keep discussion in a single place. ---------- resolution: not a bug -> duplicate superseder: -> Complex number representation round-trip doesn't work with signed zero values _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:21:31 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:21:31 +0000 Subject: [issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) In-Reply-To: <1596623435.88.0.500860382488.issue41487@roundup.psfhosted.org> Message-ID: <1596626491.19.0.117436802239.issue41487@roundup.psfhosted.org> Mark Dickinson added the comment: I'd be opposed to changing Python's `int` implementation in this way: it adds complication to the codebase and potentially also slows down "normal" cases. If a user knows in advance (a) that they're using a divisor that's highly divisble by 2, and (b) that the division or modulo operation is performance critical, then they can take the appropriate steps to optimize their code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:34:20 2020 From: report at bugs.python.org (Eric Wieser) Date: Wed, 05 Aug 2020 11:34:20 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596627260.29.0.37831579434.issue41485@roundup.psfhosted.org> Eric Wieser added the comment: Apologies for not searching the issue tracker effectively until after filing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 07:44:27 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 11:44:27 +0000 Subject: [issue41485] Repr of complex number with signed zero does not roundtrip In-Reply-To: <1596618328.49.0.282649932671.issue41485@roundup.psfhosted.org> Message-ID: <1596627867.71.0.11104732824.issue41485@roundup.psfhosted.org> Mark Dickinson added the comment: [META] @Eric: No apology needed. I find the issue tracker search hard to use well, and in general we don't do a great job of tracking duplicates properly. I'm trying to be better about that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 08:03:26 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 05 Aug 2020 12:03:26 +0000 Subject: [issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) In-Reply-To: <1596623435.88.0.500860382488.issue41487@roundup.psfhosted.org> Message-ID: <1596629006.86.0.230514559692.issue41487@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 08:03:02 2020 From: report at bugs.python.org (Eric Wieser) Date: Wed, 05 Aug 2020 12:03:02 +0000 Subject: [issue17336] Complex number representation round-trip doesn't work with signed zero values In-Reply-To: <1362223684.37.0.0348889498791.issue17336@psf.upfronthosting.co.za> Message-ID: <1596628982.47.0.783430254061.issue17336@roundup.psfhosted.org> Eric Wieser added the comment: > BTW I don't want repr() of a complex number to use the complex(..., ...) A compromise would be to only use this notation if signed zeros are involved. --- Another option would be to use slightly unusual reprs for these complex numbers, which at least round-trip: def check(s, v): c = eval(s) # use string equality, because it's the easiest way to compare signed zeros cs = f"complex({c.real}, {c.imag})" vs = f"complex({v.real}, {v.imag})" assert vs == cs, f' expected {vs} got {cs}' check("-(0+0j)", complex(-0.0, -0.0)) check("(-0.0-0j)", complex(-0.0, 0.0)) # non-intuitive check("-(-0.0-0j)", complex(0.0, -0.0)) # non-intuitive Which I suppose would extend to complex numbers containing just one signed zero check("(-0.0-1j)", complex(-0.0, -1)) check("-(0.0-1j)", complex(-0.0, 1)) check("-(1+0j)", complex(-1, -0.0)) check("-(-1+0j)", complex(1, -0.0)) Only two of these reprs are misleading for users who don't understand what's going on, the rest will just strike users as odd. ---------- nosy: +Eric Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 08:51:16 2020 From: report at bugs.python.org (Dominic Davis-Foster) Date: Wed, 05 Aug 2020 12:51:16 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1596631876.07.0.765024777605.issue41232@roundup.psfhosted.org> Dominic Davis-Foster added the comment: To me your examples seem like a misuse of functools.wraps. IIUC its purpose is to make a wrapper that accepts solely *args and **kwargs appear to be the wrapped function; it doesn't seem to be intended to be used when the wrapper takes arguments of different types or that have different default values. I can't think of a situation where you'd use wraps with a decorator that doesn't take just *args and **kwargs. That's not to say there aren't occasions where you'd want to to that, just that wraps isn't the right tool. ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 09:33:00 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Aug 2020 13:33:00 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596634380.4.0.527637803673.issue40726@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8f4380d2f5839a321475104765221a7394a9d649 by Batuhan Taskaya in branch 'master': bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-20312) https://github.com/python/cpython/commit/8f4380d2f5839a321475104765221a7394a9d649 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 09:33:03 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 13:33:03 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596634383.86.0.622177529977.issue40726@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +20887 pull_request: https://github.com/python/cpython/pull/21741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 09:35:45 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Aug 2020 13:35:45 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596634545.82.0.881415220678.issue40726@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +20888 pull_request: https://github.com/python/cpython/pull/21742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 09:36:45 2020 From: report at bugs.python.org (Thor Whalen) Date: Wed, 05 Aug 2020 13:36:45 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1596631876.07.0.765024777605.issue41232@roundup.psfhosted.org> Message-ID: Thor Whalen added the comment: You are the guardians of the great python, so we can leave it at that if you want. That said for posterity, I'll offer a defense. The same "the tools does what it does, and if you need something else, use another tool" argument could have been applied to vote against adding `__annotations__` etc. back when it was lacking. If there were clear use cases for having signature defaults be different from actual defaults, I'd also agree with the argument. If it were a complicated fix, I'd also agree with you. But it's a simple fix that would help avoiding unintended misalignments. I may be missing something, but the only positive reasons I see for keeping it the way it is are: (1) backcompatibility safety, and (2) not having to change the (in my opinion incorrect) tests. If it is kept as such, I think a documentation warning would go a long way in making users avoid the trap I myself fell into. On Wed, Aug 5, 2020 at 8:51 AM Dominic Davis-Foster wrote: > > Dominic Davis-Foster added the comment: > > To me your examples seem like a misuse of functools.wraps. IIUC its > purpose is to make a wrapper that accepts solely *args and **kwargs appear > to be the wrapped function; it doesn't seem to be intended to be used when > the wrapper takes arguments of different types or that have different > default values. > > I can't think of a situation where you'd use wraps with a decorator that > doesn't take just *args and **kwargs. That's not to say there aren't > occasions where you'd want to to that, just that wraps isn't the right tool. > > ---------- > nosy: +domdfcoding > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 09:52:37 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 13:52:37 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596635557.2.0.550669326848.issue40726@roundup.psfhosted.org> miss-islington added the comment: New changeset a1320989f5350439e0677450f49b36f2c10583d2 by Miss Islington (bot) in branch '3.9': bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-20312) https://github.com/python/cpython/commit/a1320989f5350439e0677450f49b36f2c10583d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:07:10 2020 From: report at bugs.python.org (LX Cubing) Date: Wed, 05 Aug 2020 14:07:10 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596636430.78.0.547517816358.issue41480@roundup.psfhosted.org> Change by LX Cubing : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:23:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 14:23:17 +0000 Subject: [issue40989] [C API] Remove _Py_NewReference() and _Py_ForgetReference() from the public C API In-Reply-To: <1592255135.39.0.855912884014.issue40989@roundup.psfhosted.org> Message-ID: <1596637397.93.0.0236361669882.issue40989@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 15edaecd97a3f8e82895046462342d8ddd8b9f1b by Victor Stinner in branch 'master': bpo-40989: Fix compiler warning in winreg.c (GH-21722) https://github.com/python/cpython/commit/15edaecd97a3f8e82895046462342d8ddd8b9f1b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:25:11 2020 From: report at bugs.python.org (Andre Roberge) Date: Wed, 05 Aug 2020 14:25:11 +0000 Subject: [issue41488] Unusable type hint should not be silently ignored Message-ID: <1596637510.96.0.457695576567.issue41488@roundup.psfhosted.org> New submission from Andre Roberge : The following code is currently consistent with the type hint syntax but contains a line that is completely ignored. >>> d = {} >>> d['a']: int >>> d {} >>> __annotations__ {} >>> '__annotations__' in dir(d) False I believe that type hints that cannot be either attached to an object nor added to any other __annotations__ dict should either generate a SyntaxError or, at the very least, result in a warning. ---------- messages: 374884 nosy: aroberge priority: normal severity: normal status: open title: Unusable type hint should not be silently ignored type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:25:28 2020 From: report at bugs.python.org (YoSTEALTH) Date: Wed, 05 Aug 2020 14:25:28 +0000 Subject: [issue41475] __future__.annotations set to become default in Python 4.0? In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596637528.78.0.296573059154.issue41475@roundup.psfhosted.org> YoSTEALTH added the comment: @rhettinger https://bugs.python.org/issue41314 ---------- nosy: +YoSTEALTH _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:30:57 2020 From: report at bugs.python.org (Ram Rachum) Date: Wed, 05 Aug 2020 14:30:57 +0000 Subject: [issue41475] __future__.annotations set to become default in Python 4.0? In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596637856.99.0.931680081438.issue41475@roundup.psfhosted.org> Ram Rachum added the comment: Thanks for linking that, YoStealth. Unless I'm missing anything, it looks like there's agreement that the right answer is 3.10, and my PR fixes a spot which was omitted in the PR from the previous issues. Agreed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:39:04 2020 From: report at bugs.python.org (YoSTEALTH) Date: Wed, 05 Aug 2020 14:39:04 +0000 Subject: [issue41475] __future__.annotations set to become default in Python 4.0? In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1596638344.77.0.17713681008.issue41475@roundup.psfhosted.org> YoSTEALTH added the comment: @cool-RR since your patch focuses on ``3.7`` there might be a merge issue. There might be other place where ``4.0`` is mentioned though. Its better to let core dev like Raymond make the call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:53:46 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 05 Aug 2020 14:53:46 +0000 Subject: [issue41488] Unusable type hint should not be silently ignored In-Reply-To: <1596637510.96.0.457695576567.issue41488@roundup.psfhosted.org> Message-ID: <1596639226.86.0.0730795136105.issue41488@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 10:59:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 14:59:41 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596639581.5.0.537057298179.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: > (On which note: Please don't switch macOS to use clock_gettime(CLOCK_MONOTONIC); that would be a breaking change for us!) Right, I propose to add new clock(s) since people may rely on the current clock(s) specifications. > At least Linux, macOS, FreeBSD, and Windows all have a way to access a monotonic clock that stops ticking while the system is suspended. Python also tries to support AIX, OpenBSD, Solaris, Android, etc. https://pythondev.readthedocs.io/platforms.html#best-effort-and-unofficial-platforms I'm not sure that all "supported" platforms provide such clock. It's ok if such clock is not available on all platforms. People can fallback on monotonic/perf_counter depending on their need. For example, previously, it was common to write something like: try: from time import monotonic except ImportError: from time import time as monotonic # Python 2 or clock not available ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 11:03:27 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 05 Aug 2020 15:03:27 +0000 Subject: [issue41488] Unusable type hint should not be silently ignored In-Reply-To: <1596637510.96.0.457695576567.issue41488@roundup.psfhosted.org> Message-ID: <1596639807.13.0.490653430348.issue41488@roundup.psfhosted.org> Guido van Rossum added the comment: No, that is up to the static type checker. With PEP 563 nearing completion in Python 3.10 we will in fact be ignoring all annotations silently. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 11:08:09 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Aug 2020 15:08:09 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596640089.81.0.522320475454.issue41303@roundup.psfhosted.org> Ronald Oussoren added the comment: @Nathaniel: I hadn't noticed that CLOCK_MONOTONIC on macOS behaves different from that clock on Linux. Sigh. That means there's little reason to switch to CLOCK_MONOTONIC on macOS, that would just result in different behaviour between Linux and macOS. There is a clock with similar behaviour as the Linux clock: CLOCK_UPTIME_RAW, but switching to that instead of mach_absolute_time would just complicate the code base because we still support macOS 10.9 where clock_gettime is not available. BTW. I'm against using mach_continuous_time, if a change is needed it should be to clock_gettime as that's the more portable API. And given the stated goal of time.perf_counter() a change is IMHO not necessary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 11:22:59 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Aug 2020 15:22:59 +0000 Subject: [issue41480] python won't save In-Reply-To: <1596565137.77.0.746633483379.issue41480@roundup.psfhosted.org> Message-ID: <1596640979.04.0.762661197247.issue41480@roundup.psfhosted.org> Terry J. Reedy added the comment: For anyone who finds this issue, it also affected 3.9.0b4/5. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 12:05:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 05 Aug 2020 16:05:10 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596643510.34.0.922036804551.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: > There is a clock with similar behaviour as the Linux clock: CLOCK_UPTIME_RAW On Linux, CLOCK_UPTIME_RAW is not adjusted by NTP and it should not be used for a clock using *seconds*. NTP ensures that a clock provides seconds and is not slower or faster. On macOS, if you want a clock which is incremented while the system is asleep, CLOCK_MONOTONIC sounds like a better choice. I don't know if time.perf_counter() and CLOCK_MONOTONIC have similar effective resolution on macOS. time.perf_counter() should have a better resolution, but can have a worse accurary, than time.monotonic(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 14:21:15 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 05 Aug 2020 18:21:15 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596651675.6.0.514397297612.issue40726@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +20889 pull_request: https://github.com/python/cpython/pull/21745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 14:37:26 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 18:37:26 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596652646.89.0.0328243697481.issue40726@roundup.psfhosted.org> miss-islington added the comment: New changeset b24c9d2b0656764bef48120d9511faf833bd7ead by Batuhan Taskaya in branch '3.8': [3.8] bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-21745) https://github.com/python/cpython/commit/b24c9d2b0656764bef48120d9511faf833bd7ead ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 14:45:00 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 05 Aug 2020 18:45:00 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596653100.69.0.347686576676.issue41482@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 52f98424a55e14f05dfa7483cc0faf634a61c9ff by Eric L. Frederich in branch 'master': bpo-41482: Fix error in ipaddress.IPv4Network docstring (GH-21736) https://github.com/python/cpython/commit/52f98424a55e14f05dfa7483cc0faf634a61c9ff ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 14:45:13 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 18:45:13 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596653113.39.0.247309292323.issue41482@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20890 pull_request: https://github.com/python/cpython/pull/21746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 14:49:30 2020 From: report at bugs.python.org (David Bolen) Date: Wed, 05 Aug 2020 18:49:30 +0000 Subject: [issue41467] asyncio: recv_into() must not return b'' if the socket/pipe is closed In-Reply-To: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org> Message-ID: <1596653370.87.0.993320359302.issue41467@roundup.psfhosted.org> David Bolen added the comment: Just for the record, this fix also appears to have resolved the issue with the Win10 buildbot from bpo-41273, which was related to the same unraisable exceptions mentioned in bpo-38912. ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 14:57:37 2020 From: report at bugs.python.org (David Bolen) Date: Wed, 05 Aug 2020 18:57:37 +0000 Subject: [issue41273] asyncio: proactor read transport: use recv_into instead of recv In-Reply-To: <1594415336.97.0.770801888844.issue41273@roundup.psfhosted.org> Message-ID: <1596653857.67.0.467326755636.issue41273@roundup.psfhosted.org> David Bolen added the comment: It looks like there was an underlying asyncio.recv_into bug that was the likely root issue here. It's recently been fixed in bpo-41467, and test_asyncio is passing on at least the Win10 buildbot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 15:07:02 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 05 Aug 2020 19:07:02 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596654422.97.0.235570449567.issue41303@roundup.psfhosted.org> Ronald Oussoren added the comment: On macOS CLOCK_UPTIME_RAW is the same as mach_absolute_time (according to the manpage). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 15:11:04 2020 From: report at bugs.python.org (Andrew) Date: Wed, 05 Aug 2020 19:11:04 +0000 Subject: [issue41129] Python extension modules fail to build on Mac 10.15.1 (Catalina) In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596654664.79.0.569998092865.issue41129@roundup.psfhosted.org> Andrew added the comment: So I believe I've found the problem as to why we can't get the extension modules to build in our network area. It seems to be a problem with setup.py's find_file() and is_macosx_sdk_path() functions when the extension modules are building. You can find these functions around line 182 of setup.py. For some background, our network location /mathworks is usually mounted at root, but due to the restrictions on macOS Catalina, it mounts at /System/Volumes/Data and we then add a symlink to the root directory so "/mathworks -> /System/Volumes/Data/mathworks" as to not break old code and scripts. So the real problem is that we cannot find extension module files under /System/Volumes/Data. This problem occurs because in setup.py, when we attempt to find an extension module file with find_file() wherein the file registers as being in the mac sdk path since the path starts with "/System". This is a problem because find_file() then prepends the file with the sdk path which isn't quite right and fails the existence check. For example a source file that actually exists at "/System/Volumes/Data/mathworks/hub/scratch/aflewell/Python-3.8.2/Modules/" find_file() calls os.path.exists() on "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Volumes/Data/mathworks/hub/scratch/aflewell/Python-3.8.2/Modules/" which fails since the path does not exist at or after the "Volumes" part. This causes find_file to think the file does not exist at all, so the compiler ends up trying to compile the file without an absolute path or relative path to it, which fails. This can be fixed by changing is_macosx_sdk_path() so it does not consider /System/Volumes/Data as part of the sdk path: Change from: def is_macosx_sdk_path(path): """ Returns True if 'path' can be located in an OSX SDK """ return ( (path.startswith('/usr/') and not path.startswith('/usr/local')) or (path.startswith('/System/') ) or path.startswith('/Library/') ) to def is_macosx_sdk_path(path): """ Returns True if 'path' can be located in an OSX SDK """ return ( (path.startswith('/usr/') and not path.startswith('/usr/local')) or (path.startswith('/System/') and not path.startswith('/System/Volumes/Data')) or path.startswith('/Library/') ) This change prevents the sdk path from being prepended to the expected path to the file. I'm not sure if this is the right fix, so I'd like your opinion on it. I don'r know much about mac's developer sdk and how it works, but it doesn't seem like anything under /System/Volumes should be included in or locatable in the sdk. Anyways, it would be nice to have an official fix for this in the official python source. Regarding reproduction, you may be able to reproduce by trying to build python under /Systems/Volumes/Data, if not, it may have to do with the mounting of our network filesystem. Thanks for your help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 15:34:48 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 05 Aug 2020 19:34:48 +0000 Subject: [issue40726] ast.Call end_lineno is defined and returns None In-Reply-To: <1590136499.66.0.128776260794.issue40726@roundup.psfhosted.org> Message-ID: <1596656088.92.0.0200314344396.issue40726@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 Wed Aug 5 16:04:25 2020 From: report at bugs.python.org (AbcSxyZ) Date: Wed, 05 Aug 2020 20:04:25 +0000 Subject: [issue41489] HTMLParser : HTMLParser.error creating multiple errors. Message-ID: <1596657865.41.0.326756245182.issue41489@roundup.psfhosted.org> New submission from AbcSxyZ : Coming from deprecated feature. Using python 3.7.3 Related and probably fixed with https://bugs.python.org/issue31844 Just in case. I've got 2 different related problems, the first one creating the second. Using linked file and this class : ``` from html.parser import HTMLParser class LinkParser(HTMLParser): """ DOM parser to retrieve href of all elements """ def parse_links(self, html_content): self.links = [] self.feed(html_content) return self.links def handle_starttag(self, tag, attrs): if tag == "a": attrs = {key.lower():value for key, *value in attrs} urls = attrs.get("href", None) if urls and urls[0]: self.links.append(urls[0]) # def error(self, *args, **kwargs): # pass if __name__ == "__main__": with open("error.txt") as File: LinkParser().parse_links(File.read()) ``` With error method commented, it creates : ``` File "scanner/link.py", line 8, in parse_links self.feed(html_content) File "/usr/lib/python3.7/html/parser.py", line 111, in feed self.goahead(0) File "/usr/lib/python3.7/html/parser.py", line 179, in goahead k = self.parse_html_declaration(i) File "/usr/lib/python3.7/html/parser.py", line 264, in parse_html_declaration return self.parse_marked_section(i) File "/usr/lib/python3.7/_markupbase.py", line 159, in parse_marked_section self.error('unknown status keyword %r in marked section' % rawdata[i+3:j]) File "/usr/lib/python3.7/_markupbase.py", line 34, in error "subclasses of ParserBase must override error()") NotImplementedError: subclasses of ParserBase must override error() ``` If error method do not raise anything, using only pass, it creates : ``` File "/home/simon/Documents/radio-parser/scanner/link.py", line 8, in parse_links self.feed(html_content) File "/usr/lib/python3.7/html/parser.py", line 111, in feed self.goahead(0) File "/usr/lib/python3.7/html/parser.py", line 179, in goahead k = self.parse_html_declaration(i) File "/usr/lib/python3.7/html/parser.py", line 264, in parse_html_declaration return self.parse_marked_section(i) File "/usr/lib/python3.7/_markupbase.py", line 160, in parse_marked_section if not match: UnboundLocalError: local variable 'match' referenced before assignment ``` We see here `match` variable is not created if `self.error` is called, and because error do not raise exception, will create UnboundLocalError : ``` def parse_marked_section(self, i, report=1): rawdata= self.rawdata assert rawdata[i:i+3] == ' ending match= _markedsectionclose.search(rawdata, i+3) elif sectName in {"if", "else", "endif"}: # look for MS Office ]> ending match= _msmarkedsectionclose.search(rawdata, i+3) else: self.error('unknown status keyword %r in marked section' % rawdata[i+3:j]) if not match: return -1 if report: j = match.start(0) self.unknown_decl(rawdata[i+3: j]) return match.end(0) ``` ---------- files: error.txt messages: 374899 nosy: AbcSxyZ priority: normal severity: normal status: open title: HTMLParser : HTMLParser.error creating multiple errors. type: crash versions: Python 3.7 Added file: https://bugs.python.org/file49370/error.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:22:55 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Aug 2020 21:22:55 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1596662575.16.0.621711742821.issue41232@roundup.psfhosted.org> Terry J. Reedy added the comment: Thor, in the future, when you reply by email, snip off the messages you are replying to. When you your message is added to the webpage below the earlier message, the copy become extraneous noise. Quoting the hidden boilerplate on PRs is also useless. For the purpose of this tracker, a bug is a discrepancy between the code and the docs. Since I have hardly used wraps nor read it docs in detail, I have no particular opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:26:19 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 05 Aug 2020 21:26:19 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 Message-ID: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> New submission from Steve Dower : I'm doing the PR now, based on the latest versions available today: https://pypi.org/project/pip/20.2.1/ https://pypi.org/project/setuptools/49.2.1/ If you're a maintainer and there's a reason to not update to to the latest, please let me know asap. All of our subsequent releases should be RC's, so I assume we won't take any changes bigger than targeted fixes before the next full releases. ---------- assignee: steve.dower components: Distutils messages: 374901 nosy: Marcus.Smith, dstufft, eric.araujo, jaraco, lukasz.langa, ncoghlan, paul.moore, pradyunsg, steve.dower priority: normal severity: normal stage: needs patch status: open title: Update bundled pip to 20.2.1 and setuptools to 49.2.1 versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:35:05 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 21:35:05 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596663305.41.0.750513906589.issue41482@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20891 pull_request: https://github.com/python/cpython/pull/21747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:41:04 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Aug 2020 21:41:04 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596663664.66.0.765727980276.issue41482@roundup.psfhosted.org> Terry J. Reedy added the comment: The issue resulting in the addition of a "backport-52f9842-3.9" branch to the main python/cpython repository. I believe that this is a mistake and should be removed, but I don't know how. When miss-islington fails to backport for reasons other than a merge conflict, the problem is likely transient -- perhaps a timing issue or temporary resource unavailable issue that we have no control over. The solution is to delete the backport label, close the label box, reopen the label box, add the label, and reclose. I did this and the auto backport was generated. (The 3.8 backport is ready to approve and merge.) ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:41:46 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Aug 2020 21:41:46 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596663706.37.0.286368488497.issue41482@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- type: enhancement -> behavior versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:42:09 2020 From: report at bugs.python.org (jakirkham) Date: Wed, 05 Aug 2020 21:42:09 +0000 Subject: [issue37293] concurrent.futures.InterpreterPoolExecutor In-Reply-To: <1560604517.31.0.263744065617.issue37293@roundup.psfhosted.org> Message-ID: <1596663729.36.0.713431569859.issue37293@roundup.psfhosted.org> Change by jakirkham : ---------- nosy: +jakirkham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:43:20 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 21:43:20 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596663800.48.0.432239604951.issue41482@roundup.psfhosted.org> miss-islington added the comment: New changeset b5789a7419655f66692fab463320048bd2290e81 by Miss Islington (bot) in branch '3.8': bpo-41482: Fix error in ipaddress.IPv4Network docstring (GH-21736) https://github.com/python/cpython/commit/b5789a7419655f66692fab463320048bd2290e81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:45:05 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Aug 2020 21:45:05 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596663905.18.0.448483841321.issue41482@roundup.psfhosted.org> Terry J. Reedy added the comment: Since this is a trivial typo fix, I approved the backport for auto-merge. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:47:21 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 05 Aug 2020 21:47:21 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596664041.65.0.43464803435.issue41482@roundup.psfhosted.org> Terry J. Reedy added the comment: I was able to delete the spurious branch because it was not protected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 17:53:03 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 05 Aug 2020 21:53:03 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596664383.53.0.857304987948.issue41482@roundup.psfhosted.org> miss-islington added the comment: New changeset b49b88a93a06b656d7f6a64d9d9e4828921d86eb by Miss Islington (bot) in branch '3.9': bpo-41482: Fix error in ipaddress.IPv4Network docstring (GH-21736) https://github.com/python/cpython/commit/b49b88a93a06b656d7f6a64d9d9e4828921d86eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 18:03:53 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 05 Aug 2020 22:03:53 +0000 Subject: [issue41482] docstring errors in ipaddress.IPv4Network In-Reply-To: <1596570845.31.0.932838232512.issue41482@roundup.psfhosted.org> Message-ID: <1596665033.3.0.757845375212.issue41482@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, Terry. That was my fault, trying to cherry pick manually. I'm not sure why the original backport failed, and once I did the manual cherry pick as suggested I got called away for real work. As you say, I should have tried deleting the tag and re-adding it before I pulled out the cherry pick tool. Thank you for cleaning up after me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 18:16:19 2020 From: report at bugs.python.org (Wesley Whetstone) Date: Wed, 05 Aug 2020 22:16:19 +0000 Subject: [issue41491] plistlib can't load macOS BigSur system LaunchAgent Message-ID: <1596665779.04.0.552451730401.issue41491@roundup.psfhosted.org> New submission from Wesley Whetstone : When attempting to load the new LaunchAgent at `/System/Library/LaunchAgents/com.apple.cvmsCompAgent3600_arm64.plist` plistlib Raises a ValueError of File "/opt/salt/lib/python3.7/plistlib.py", line 272, in handle_end_element handler() File "/opt/salt/lib/python3.7/plistlib.py", line 332, in end_integer self.add_object(int(self.get_data())) ValueError: invalid literal for int() with base 10: '0x0100000c' on 0x0100000c Technically this violates the spec at http://www.apple.com/DTDs/PropertyList-1.0.dtd. Figured it was worth reporting. Full Plist is attached. ---------- files: com.apple.cvmsCompAgent_arm64.plist messages: 374908 nosy: jckwhet priority: normal severity: normal status: open title: plistlib can't load macOS BigSur system LaunchAgent Added file: https://bugs.python.org/file49371/com.apple.cvmsCompAgent_arm64.plist _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 18:17:34 2020 From: report at bugs.python.org (Wesley Whetstone) Date: Wed, 05 Aug 2020 22:17:34 +0000 Subject: [issue41491] plistlib can't load macOS BigSur system LaunchAgent In-Reply-To: <1596665779.04.0.552451730401.issue41491@roundup.psfhosted.org> Message-ID: <1596665854.98.0.00309360119257.issue41491@roundup.psfhosted.org> Change by Wesley Whetstone : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 18:17:51 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 05 Aug 2020 22:17:51 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596665871.71.0.589053899677.issue41490@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +20892 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21748 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:12:43 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 05 Aug 2020 23:12:43 +0000 Subject: [issue41491] plistlib can't load macOS BigSur system LaunchAgent In-Reply-To: <1596665779.04.0.552451730401.issue41491@roundup.psfhosted.org> Message-ID: <1596669163.26.0.299984755531.issue41491@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:14:22 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 05 Aug 2020 23:14:22 +0000 Subject: [issue41489] HTMLParser : HTMLParser.error creating multiple errors. In-Reply-To: <1596657865.41.0.326756245182.issue41489@roundup.psfhosted.org> Message-ID: <1596669262.89.0.214040967415.issue41489@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:23:18 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 05 Aug 2020 23:23:18 +0000 Subject: [issue41477] test_genericalias fails if ctypes is missing In-Reply-To: <1596553540.81.0.229958329134.issue41477@roundup.psfhosted.org> Message-ID: <1596669798.82.0.525339527147.issue41477@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:24:46 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 05 Aug 2020 23:24:46 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596669886.47.0.54405531629.issue41490@roundup.psfhosted.org> Steve Dower added the comment: Test failure on Windows. I'll take a look tomorrow. ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_venv.py", line 476, in do_test_with_pip self.run_with_capture(venv.create, self.env_dir, File "D:\a\cpython\cpython\lib\test\test_venv.py", line 76, in run_with_capture func(*args, **kwargs) subprocess.CalledProcessError: Command '['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\tmp3cz40z50\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_venv.py", line 536, in test_with_pip self.do_test_with_pip(False) File "D:\a\cpython\cpython\lib\test\test_venv.py", line 484, in do_test_with_pip self.fail(msg.format(exc, details)) AssertionError: Command '['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\tmp3cz40z50\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. **Subprocess Output** Looking in links: c:\Users\RUNNER~1\AppData\Local\Temp\tmped5jdzqn Processing c:\users\runneradmin\appdata\local\temp\tmped5jdzqn\setuptools-49.2.1-py3-none-any.whl Processing c:\users\runneradmin\appdata\local\temp\tmped5jdzqn\pip-20.2.1-py2.py3-none-any.whl Installing collected packages: setuptools, pip Successfully installed pip-20.2.1 setuptools-49.2.1 Traceback (most recent call last): File "D:\a\cpython\cpython\lib\shutil.py", line 613, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmped5jdzqn\\pip-20.2.1-py2.py3-none-any.whl' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\a\cpython\cpython\lib\tempfile.py", line 802, in onerror _os.unlink(path) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmped5jdzqn\\pip-20.2.1-py2.py3-none-any.whl' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\a\cpython\cpython\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\a\cpython\cpython\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\a\cpython\cpython\lib\ensurepip\__main__.py", line 5, in sys.exit(ensurepip._main()) File "D:\a\cpython\cpython\lib\ensurepip\__init__.py", line 213, in _main return _bootstrap( File "D:\a\cpython\cpython\lib\ensurepip\__init__.py", line 132, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "D:\a\cpython\cpython\lib\tempfile.py", line 827, in __exit__ self.cleanup() File "D:\a\cpython\cpython\lib\tempfile.py", line 831, in cleanup self._rmtree(self.name) File "D:\a\cpython\cpython\lib\tempfile.py", line 813, in _rmtree _shutil.rmtree(name, onerror=onerror) File "D:\a\cpython\cpython\lib\shutil.py", line 737, in rmtree return _rmtree_unsafe(path, onerror) File "D:\a\cpython\cpython\lib\shutil.py", line 615, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "D:\a\cpython\cpython\lib\tempfile.py", line 805, in onerror cls._rmtree(path) File "D:\a\cpython\cpython\lib\tempfile.py", line 813, in _rmtree _shutil.rmtree(name, onerror=onerror) File "D:\a\cpython\cpython\lib\shutil.py", line 737, in rmtree return _rmtree_unsafe(path, onerror) File "D:\a\cpython\cpython\lib\shutil.py", line 596, in _rmtree_unsafe onerror(os.scandir, path, sys.exc_info()) File "D:\a\cpython\cpython\lib\shutil.py", line 593, in _rmtree_unsafe with os.scandir(path) as scandir_it: NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmped5jdzqn\\pip-20.2.1-py2.py3-none-any.whl' ---------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:25:36 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 05 Aug 2020 23:25:36 +0000 Subject: [issue41470] smtplib.SMTP should reset internal 'helo' and 'ehlo' state within 'connect()' In-Reply-To: <1596533964.11.0.390064699106.issue41470@roundup.psfhosted.org> Message-ID: <1596669936.53.0.518995226036.issue41470@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:33:14 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 05 Aug 2020 23:33:14 +0000 Subject: [issue41398] cgi module, parse_multipart fails In-Reply-To: <1595757503.98.0.375306375596.issue41398@roundup.psfhosted.org> Message-ID: <1596670394.16.0.640298980509.issue41398@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:35:01 2020 From: report at bugs.python.org (Steve Dower) Date: Wed, 05 Aug 2020 23:35:01 +0000 Subject: [issue41492] Fix signing description for Windows release builds Message-ID: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> New submission from Steve Dower : At some point, Windows started displaying an authenticated certificate property as the display name in UAC prompts, rather than the file properties. Currently our SigningDescription is set to the build identifier, which is not a nice display name. We should change it to be "Python 3.x.y" (which will involve updating the build YAML files to extract the version number). ---------- assignee: steve.dower components: Windows messages: 374910 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Fix signing description for Windows release builds type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 19:37:06 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 05 Aug 2020 23:37:06 +0000 Subject: [issue41465] io.TextIOWrapper.errors not writable In-Reply-To: <1596479352.95.0.492861771572.issue41465@roundup.psfhosted.org> Message-ID: <1596670626.08.0.722579412237.issue41465@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 20:21:37 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 00:21:37 +0000 Subject: [issue41465] io.TextIOWrapper.errors not writable In-Reply-To: <1596479352.95.0.492861771572.issue41465@roundup.psfhosted.org> Message-ID: <1596673297.56.0.245641682153.issue41465@roundup.psfhosted.org> Jeffrey Kintscher added the comment: I looked at the implementation in Lib/_pyio.py. The only way to change the error handler is by calling TextIOWrapper.reconfigure() and supply the new error handler as the "errors" parameter. For example: >>> import io >>> s = io.TextIOWrapper(io.BytesIO()) >>> print(s.errors) strict >>> s.reconfigure(errors='replace') >>> print(s.errors) replace >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 20:50:49 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 00:50:49 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596675049.29.0.252708759681.issue41458@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 20:52:36 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 00:52:36 +0000 Subject: [issue41450] OSError is not documented in ssl library, but still can be thrown In-Reply-To: <1596206187.31.0.0863049661733.issue41450@roundup.psfhosted.org> Message-ID: <1596675156.47.0.870047070029.issue41450@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 21:13:28 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 01:13:28 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over In-Reply-To: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> Message-ID: <1596676408.46.0.990069207295.issue41456@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 5 22:40:05 2020 From: report at bugs.python.org (huangtaizhuo) Date: Thu, 06 Aug 2020 02:40:05 +0000 Subject: [issue41304] [CVE-2020-15801] python 38 embed ignore python38._pth file on windows In-Reply-To: <1594824077.92.0.734722675541.issue41304@roundup.psfhosted.org> Message-ID: <1596681605.22.0.0733435171493.issue41304@roundup.psfhosted.org> huangtaizhuo added the comment: hi, since the affected system is not clearly stated on the NVD, I'd like to confirm with you that: Does the CVE-2020-15801 vulnerability affect only the Windows OS? thanks a lot! ---------- nosy: +owen.huang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 00:15:43 2020 From: report at bugs.python.org (Ama Aje My Fren) Date: Thu, 06 Aug 2020 04:15:43 +0000 Subject: [issue41411] Improve and consolidate f-strings docs In-Reply-To: <1595867493.01.0.94068638385.issue41411@roundup.psfhosted.org> Message-ID: <1596687343.07.0.200911572997.issue41411@roundup.psfhosted.org> Ama Aje My Fren added the comment: Hi, >The online docs seem updated, so I'm not sure why it's not working. Maybe you could try So it seems that the .. index::[0] directive creates an index[1]. Both f-index and findex are available in it. Search is a bit different. A searchindex[2] is generated once when the html is being created. This is then used, locally, when user does search. Still it is not very good. Multiple word queries[3] and hyphenated words don't appear to work[4] well (I also tested this locally, f-string does not get searchindexed while fstring does. Searching also gives the lexical analysis as one of the pages when searching for fstring.) > What about doing the following: > * keep having stdtypes.rst cover and explain all the built-in types and their features; > * move the "Format String Syntax", "Format Specification Mini-Language", "Format examples" sections from string.rst to stdtypes.rst where they belong; > * integrate f-strings in these sections, and add a new section explaining f-string-specific quirks; > * leave the printf-style string formatting in stdtypes.rst, after the format sections > * use string.rst to document the string module and its objects, hence leaving string.Formatter and string.Template here, where they belong (string.Formatter is self contained enough that doesn't need to be with the other format sections); > * leave the inputoutput.rst and lexical_analysis pages as they are; > * update the introduction.rst page to mention f-string; introduction.rst has a reference to "Formatted string literals" in the "See also:" box[5]. But I can still put an example here. Should we put both str.format() and f-strings, or make this exclusively for f-strings? > * once all this is done, update all links to point to the appropriate sections and cross-link all related sections; Ok. Please can we progress as follows: (Each as sequential and independent PR) 1) f-string added to stdtypes.rst. I have done this in PR 21552. We can complete that one and commit it as the first step. It provides both the f-string and the f-string-specific quacks. 2) Add the same wording of f-string to pydoc. I have been studying how to do this. At this moment help(fstring) and help(f-string) do not work. PS C:\> py -3.9 Python 3.9.0b5 (tags/v3.9.0b5:8ad7d50, Jul 20 2020, 18:35:09) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> help(fstring) Traceback (most recent call last): File "", line 1, in NameError: name 'fstring' is not defined >>> help(f-string) Traceback (most recent call last): File "", line 1, in NameError: name 'f' is not defined >>> 3) Move "Format String Syntax", "Format Specification Mini-Language", "Format examples" sections from string.rst to stdtypes.rst and ensure references all work well. 4) Add additional f-string-quarks as we discuss into stdtypes.rst. [0] https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#index-generating-markup [1] https://docs.python.org/dev/genindex-F.html [2] https://docs.python.org/dev/searchindex.js [3] https://github.com/sphinx-doc/sphinx/issues/1486 [4] https://github.com/sphinx-doc/sphinx/issues/1486#issuecomment-122115215 [5] https://docs.python.org/3.9/tutorial/introduction.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 00:43:35 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 04:43:35 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596689015.41.0.729851851597.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's variant (minimally tested) that has a fast path for the common case (no overflow or underflow), that uses a list instead of a deque, that keeps memory use small (only storing pending values that can't be combined without triggering an overflow or underflow). ---------------------------- from math import fabs, prod, isfinite def product(seq, start=1.0): total = start s = [] # values that would overflow the total s_side = False # true if s_i increase the magnitude of the product for x in seq: old_total = total total *= x underflow = not total and old_total and not x if isfinite(total) and not underflow: continue # fast-path for multiplies that doesn't overflow/underflow total = old_total side = fabs(x) > 1.0 if not s or side == s_side: s.append(x) s_side = side continue t = [x, total] while s and t: # opposite sides: matter and antimatter x = s.pop() * t.pop() side = fabs(x) > 1.0 s.append(x) if side == s_side else t.append(y) if t: s = t s_side = not s_side total = s.pop() return prod(s, start=total) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 01:53:27 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 05:53:27 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596693207.68.0.872348573947.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: Two edits: - s.append(x) if side == s_side else t.append(y) + s.append(x) if side == s_side else t.append(x) - return prod(s, start=total) + for x in s: + total *= x + return total ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 01:53:43 2020 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 06 Aug 2020 05:53:43 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1596693223.14.0.989402056152.issue39871@roundup.psfhosted.org> Change by Zackery Spytz : ---------- pull_requests: +20893 pull_request: https://github.com/python/cpython/pull/21749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 03:10:23 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 07:10:23 +0000 Subject: [issue26791] shutil.move fails to move symlink (Invalid cross-device link) In-Reply-To: <1460912297.17.0.227992133358.issue26791@psf.upfronthosting.co.za> Message-ID: <1596697823.61.0.946573401673.issue26791@roundup.psfhosted.org> Jeffrey Kintscher added the comment: SilentGhost's analysis is correct. The provided example code causes the error because it is trying to move the symlink into its target when the target is a directory. Any cross-device moving issues are unrelated to this example code. Here is the relevant code in the master branch: if os.path.isdir(dst): if _samefile(src, dst): # We might be on a case insensitive filesystem, # perform the rename anyway. os.rename(src, dst) return shutil._samefile() considers the example link and its target to be the same. When _samefile() returns False, this code gets executed: real_dst = os.path.join(dst, _basename(src)) if os.path.exists(real_dst): raise Error("Destination path '%s' already exists" % real_dst) try: os.rename(src, real_dst) except OSError: if os.path.islink(src): linkto = os.readlink(src) os.symlink(linkto, real_dst) os.unlink(src) A simple fix is to check whether src is a symlink when _samefile() returns True. The "Destination path...already exists" error isn't a problem for our symlink case because the shell mv command also returns an error. $ ls -l /tmp/tmpdir/ total 0 lrwxr-xr-x 1 jeff staff 11 Aug 5 23:36 test_dir -> /tmp/tmpdir $ mv test_dir /tmp/tmpdir mv: test_dir and /tmp/tmpdir/test_dir are identical I will generate a pull request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 03:19:49 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 06 Aug 2020 07:19:49 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over In-Reply-To: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> Message-ID: <1596698389.51.0.378565281993.issue41456@roundup.psfhosted.org> Ronald Oussoren added the comment: This is expected behaviour. Run_in_executor uses a concurrent.futures.ThreadPoolExecutor to manage the worker threads. Those threads will get reused when more work is scheduled, and will exit when the runloop is shut down. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 03:23:04 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 06 Aug 2020 07:23:04 +0000 Subject: [issue41491] plistlib can't load macOS BigSur system LaunchAgent In-Reply-To: <1596665779.04.0.552451730401.issue41491@roundup.psfhosted.org> Message-ID: <1596698584.91.0.769776900623.issue41491@roundup.psfhosted.org> Ronald Oussoren added the comment: Please also report this at apple using the feedback assistent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 03:27:56 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 07:27:56 +0000 Subject: [issue26791] shutil.move fails to move symlink (Invalid cross-device link) In-Reply-To: <1460912297.17.0.227992133358.issue26791@psf.upfronthosting.co.za> Message-ID: <1596698876.39.0.892424019194.issue26791@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:04:27 2020 From: report at bugs.python.org (Inada Naoki) Date: Thu, 06 Aug 2020 09:04:27 +0000 Subject: [issue41493] Refactoring dictresize to accept only new keysize Message-ID: <1596704667.77.0.860143007378.issue41493@roundup.psfhosted.org> New submission from Inada Naoki : dictresize accept `minsize` and calculate `newsize` which is `newsize >= minsize`. Some caller pass the exact dk_size so calculating `newsize` is not necessary. Split calculating `newsize` from `minused` into new function. Additonally, use _Py_bit_length for the calculation when possible. ---------- components: Interpreter Core messages: 374919 nosy: inada.naoki priority: normal severity: normal status: open title: Refactoring dictresize to accept only new keysize versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:14:31 2020 From: report at bugs.python.org (Inada Naoki) Date: Thu, 06 Aug 2020 09:14:31 +0000 Subject: [issue41493] Refactoring dictresize to accept only new keysize In-Reply-To: <1596704667.77.0.860143007378.issue41493@roundup.psfhosted.org> Message-ID: <1596705271.49.0.417894249094.issue41493@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +20894 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:15:32 2020 From: report at bugs.python.org (KevinGuo) Date: Thu, 06 Aug 2020 09:15:32 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over In-Reply-To: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> Message-ID: <1596705332.19.0.0532601126773.issue41456@roundup.psfhosted.org> KevinGuo added the comment: OK, thanks for your reply ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:15:37 2020 From: report at bugs.python.org (KevinGuo) Date: Thu, 06 Aug 2020 09:15:37 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over In-Reply-To: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> Message-ID: <1596705337.34.0.758760487688.issue41456@roundup.psfhosted.org> Change by KevinGuo : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:33:39 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 06 Aug 2020 09:33:39 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596706419.87.0.755241240691.issue41458@roundup.psfhosted.org> Vedran ?a?i? added the comment: > s.append(x) if side == s_side else t.append(x) To me, (s if side == s_side else t).append(x) seems much better. Not only more is factored, but .append is viewed as a procedure (returning None, changing its object), and if-expression is really used for its value, not the side-effect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:44:42 2020 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Thu, 06 Aug 2020 09:44:42 +0000 Subject: [issue41465] io.TextIOWrapper.errors not writable In-Reply-To: <1596479352.95.0.492861771572.issue41465@roundup.psfhosted.org> Message-ID: <1596707082.68.0.703767389581.issue41465@roundup.psfhosted.org> Walter D?rwald added the comment: I guess that is good enough. "Being changeable" does not necessarily mean mean "being changeable via attribute assignment". Thanks for your research. Closing the issue as "not a bug". ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:45:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 09:45:37 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596707137.05.0.511103967122.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: > On macOS CLOCK_UPTIME_RAW is the same as mach_absolute_time (according to the manpage). https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time says: "mach_absolute_time: Returns current value of a clock that increments monotonically in tick units (starting at an arbitrary point), this clock does not increment while the system is asleep." "Discussion: Prefer to use the equivalent clock_gettime_nsec_np(CLOCK_UPTIME_RAW) in nanoseconds." where clock_gettime_nsec_np() is: "As a non-portable extension, the clock_gettime_nsec_np() function will return the clock value in 64-bit nanoseconds." It doesn't say anything about NTP, whereas CLOCK_MONOTONIC_RAW seems to a clock which is not adjusted by NTP: """ CLOCK_MONOTONIC_RAW clock that increments monotonically, tracking the time since an arbitrary point like CLOCK_MONOTONIC. How- ever, this clock is unaffected by frequency or time adjustments. It should not be compared to other system time sources. """ So right, it sounds like mach_absolute_time() returns *seconds*. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:48:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 09:48:07 +0000 Subject: [issue41273] asyncio: proactor read transport: use recv_into instead of recv In-Reply-To: <1594415336.97.0.770801888844.issue41273@roundup.psfhosted.org> Message-ID: <1596707287.81.0.271262822069.issue41273@roundup.psfhosted.org> STINNER Victor added the comment: Tony: "asyncio: proactor read transport: use recv_into instead of recv" seems to be implemented, but PR 21446 "bpo-41279: Add StreamReaderBufferedProtocol" is a new feature. I suggest to open a new issue for this feature, and close this one. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 05:51:48 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 06 Aug 2020 09:51:48 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596707508.82.0.435562980147.issue41303@roundup.psfhosted.org> Ronald Oussoren added the comment: mach_absolute_time returns time in ticks, there's a separate API that returns the resolution of this clock (which is already used). The manpage explicitly says that mach_absolute_time and CLOCK_UPTIME_RAW are the same clock: CLOCK_UPTIME_RAW clock that increments monotonically, in the same manner as CLOCK_MONOTONIC_RAW, but that does not increment while the system is asleep. The returned value is identical to the result of mach_absolute_time() after the appropriate mach_timebase conversion is applied. Switching from mach_absolute_time to CLOCK_UPTIME_RAW would therefore bring us no improvements, and would complicate the code base because clock_gettime is only available starting from macOS 10.12. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:10:23 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 06 Aug 2020 11:10:23 +0000 Subject: [issue41494] Add window resizing support [ SIGWINCH ] to Lib/pty Message-ID: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> New submission from Soumendra Ganguly : This was tested using Python 3.7 after commenting out the sys.audit lines. https://docs.python.org/3/library/pty.html presents us with an example usage of pty.spawn. This example mimics script(1). However, the script(1) from util-linux has fantastic signal handing that pty.spawn does not directly provide. In fact, Lib/pty.py says "Bugs: No signal handling. Doesn't set slave termios and window size." xterm(1) on Debian 10 GNU/Linux was used to test the pty.spawn example mentioned above; upon resizing the xterm(1) window, the output of programs such as ls(1) became scattered and hard to visually parse. This patch does not modify any of the functions that are already present in Lib/pty. Instead, it exposes a new function called "wspawn" [ pty.wspawn ]. This is like pty.spawn + the following differences. 1. Window size is set at the beginning. 2. A SIGWINCH handler is registered. The old handler is saved and restored later. 3. If the above two steps fail, then cleanup is done, and an exception is raised, so that the programmer can catch the exception and use pty.spawn instead. 4. Unlike pty.spawn, this does not depend on OSError to break out of the parent mainloop. Instead, the main loop calls select with an adjustable timeout, so that waitpid with WNOHANG can be called periodically to check if the spawned child process has undergone an alteration of state. 5. While the return value is same as that of pty.spawn, this accepts an extra optional "timeout" argument for the select call. The aforementioned pty.spawn example now works well with window resizing if pty.wspawn is used in place of pty.spawn. Signed-off-by: Soumendra Ganguly ---------- components: Library (Lib) files: pty.diff keywords: patch messages: 374926 nosy: soumendra priority: normal severity: normal status: open title: Add window resizing support [ SIGWINCH ] to Lib/pty type: enhancement versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49372/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:13:38 2020 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 Aug 2020 11:13:38 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596712418.98.0.589571995229.issue41458@roundup.psfhosted.org> Mark Dickinson added the comment: If we want to do this (and I'm still not convinced that we do), I think there's a simpler way: use `frexp` to decompose each float into a fraction and an exponent, multiply the fractions (which barring zeros will all be in [0.5, 1.0)), and keep track of the accumulated exponents separately. Then combine everything at the end. There's a possibility of the accumulated product of the fractions underflowing, but only every 1000 floats or so, so it's enough to check every 500 floats (say) whether the product is smaller than 2**-500 or not, and scale by 2**1000 (adjusting the exponent correspondingly) if not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:19:29 2020 From: report at bugs.python.org (hai shi) Date: Thu, 06 Aug 2020 11:19:29 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596712769.94.0.00242762132515.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20895 pull_request: https://github.com/python/cpython/pull/21743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:24:43 2020 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 Aug 2020 11:24:43 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596713083.06.0.785395116095.issue41458@roundup.psfhosted.org> Mark Dickinson added the comment: Here's code to illustrate the idea. It doesn't yet handle zeros, infinities or nans; that support would need to be added. import math def fprod(numbers): # Product of numbers, avoiding intermediate underflow and overflow. # Does not handle zeros, infinities or nans # Running product is acc_m * 2**acc_e acc_m, acc_e = float.fromhex("1p1000"), -1000 count = 0 for number in numbers: m, e = math.frexp(number) acc_m *= m acc_e += e if count == 1000: if acc_m < 1.0: acc_m = math.ldexp(acc_m, 1000) acc_e -= 1000 count = 0 return math.ldexp(acc_m, acc_e) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:35:13 2020 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 06 Aug 2020 11:35:13 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596713713.26.0.867782324309.issue41458@roundup.psfhosted.org> Mark Dickinson added the comment: Whoops. There's a missing `count += 1` in there, of course. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:51:32 2020 From: report at bugs.python.org (john mathew) Date: Thu, 06 Aug 2020 11:51:32 +0000 Subject: [issue37625] Class variable is still accessible after class instance has been overwritten out In-Reply-To: <1563486914.84.0.86753245558.issue37625@roundup.psfhosted.org> Message-ID: <1596714692.09.0.492998074421.issue37625@roundup.psfhosted.org> john mathew added the comment: I am Grateful that you shared this informational post. Your website has everything that I have been looking for so long. Your knowledge about this topic is quite impressive. I am amazed by the content you shared on this website. I am John Mathew a technical advisor, for more information visit my websites. http://tplinklogins.com http://linksysextendersetups.com http://tplinkloginn.com http://tplinkextendersetupp.com ---------- nosy: +john745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:51:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 11:51:33 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596714693.38.0.370893924669.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 79bb2c93f2d81702fdf1f93720369e18a76b7d1a by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21743) https://github.com/python/cpython/commit/79bb2c93f2d81702fdf1f93720369e18a76b7d1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:54:27 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 06 Aug 2020 11:54:27 +0000 Subject: [issue37625] Class variable is still accessible after class instance has been overwritten out In-Reply-To: <1563486914.84.0.86753245558.issue37625@roundup.psfhosted.org> Message-ID: <1596714867.98.0.45558758362.issue37625@roundup.psfhosted.org> Change by Eric V. Smith : ---------- Removed message: https://bugs.python.org/msg374930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 07:58:56 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 06 Aug 2020 11:58:56 +0000 Subject: [issue41494] Add window resizing support [ SIGWINCH ] to Lib/pty In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1596715136.32.0.137523275848.issue41494@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- pull_requests: +20896 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21752 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 08:05:45 2020 From: report at bugs.python.org (john mathew) Date: Thu, 06 Aug 2020 12:05:45 +0000 Subject: [issue41495] Technical advise Message-ID: <1596715545.04.0.835435955151.issue41495@roundup.psfhosted.org> New submission from john mathew : We provide Technical Help to our users by a diagnosis of their computer and other devices. And if there is an issue to be solved, we give out the solution. This helps the user to avoid any existing issues. http://tplinklogins.com http://linksysextendersetups.com http://tplinkloginn.com http://tplinkextendersetupp.com ---------- messages: 374932 nosy: john745 priority: normal severity: normal status: open title: Technical advise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 08:08:22 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 06 Aug 2020 12:08:22 +0000 Subject: [issue41495] Technical advise Message-ID: <1596715702.58.0.103612026476.issue41495@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- Removed message: https://bugs.python.org/msg374932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 08:09:07 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 06 Aug 2020 12:09:07 +0000 Subject: [issue41495] SPAM Message-ID: <1596715747.78.0.523266144527.issue41495@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed title: Technical advise -> SPAM _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 08:47:49 2020 From: report at bugs.python.org (Dominik V.) Date: Thu, 06 Aug 2020 12:47:49 +0000 Subject: [issue41496] Create public API for typing._eval_type Message-ID: <1596718069.87.0.65884086877.issue41496@roundup.psfhosted.org> New submission from Dominik V. : In this [python-ideas thread](https://mail.python.org/archives/list/python-ideas at python.org/thread/T6K4DWENPM7LYXSDVYQYDVFEVBMA5K3L/) it was suggested to create a public API for `typing._eval_type` in order to be able to create custom versions of `get_type_hints`. Specifically a version that allows to specify an upper boundary in the MRO when retrieving type hints for a class object. The public API should use `None` as defaults for `globalns` and `localns` and not expose the `recursive_guard` parameter. ---------- messages: 374933 nosy: Dominik V. priority: normal severity: normal status: open title: Create public API for typing._eval_type type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 08:51:33 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 06 Aug 2020 12:51:33 +0000 Subject: [issue41496] Create public API for typing._eval_type In-Reply-To: <1596718069.87.0.65884086877.issue41496@roundup.psfhosted.org> Message-ID: <1596718293.16.0.22734244566.issue41496@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 09:08:43 2020 From: report at bugs.python.org (Ilya Kamenshchikov) Date: Thu, 06 Aug 2020 13:08:43 +0000 Subject: [issue41478] Empty representation of AssertionError In-Reply-To: <1596560344.26.0.719911748019.issue41478@roundup.psfhosted.org> Message-ID: Ilya Kamenshchikov added the comment: That's a solution, except you must know ahead of time this issue exists. Best Regards, -- Ilya Kamen On Tue, Aug 4, 2020 at 6:59 PM R?mi Lapeyre wrote: > > R?mi Lapeyre added the comment: > > Hi, can you not use its repr: > > > >>> try: raise ValueError > ... except Exception as e: print(f"Following happened: {e!r}") > ... > Following happened: ValueError() > > ? > > ---------- > nosy: +remi.lapeyre > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 09:15:45 2020 From: report at bugs.python.org (=?utf-8?b?VsOhY2xhdiBEdm/FmcOhaw==?=) Date: Thu, 06 Aug 2020 13:15:45 +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: <1596719745.53.0.469000447674.issue22107@roundup.psfhosted.org> Change by V?clav Dvo??k : ---------- nosy: +V?clav Dvo??k _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 09:50:58 2020 From: report at bugs.python.org (nooB) Date: Thu, 06 Aug 2020 13:50:58 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596721858.95.0.319388131764.issue41303@roundup.psfhosted.org> nooB added the comment: > perf_counter documentation says "It does include time elapsed during sleep and is system-wide." where "sleep" here means time.sleep() Apologies for misinterpreting the documentation. A clock function that includes system suspend time can be useful. Consider this as a feature request. I noticed that on both Linux and Mac OS, the functions time.monotonic and time.perf_counter are exactly same. They do not count time elapsed during suspend. --- CODE ----- import time for clock in "monotonic", "perf_counter": print(f"{clock}: {time.get_clock_info(clock)}") --- MAC OUTPUT ---- monotonic: namespace(adjustable=False, implementation='mach_absolute_time()', monotonic=True, resolution=1e-09) perf_counter: namespace(adjustable=False, implementation='mach_absolute_time()', monotonic=True, resolution=1e-09) --- LINUX OUTPUT -- monotonic: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) perf_counter: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) -------------- In Windows, perf_counter uses "QueryPerformanceCounter()" which includes "the time when the machine was in a sleep state such as standby, hibernate, or connected standby" refer: https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps I learnt that "mach_continuous_time()" in Mac OS, "clock_gettime(CLOCK_BOOTTIME)" in Linux and "QueryPerformanceCounter()" in Windows all include system suspend time. It would be nice if perf_counter can be tweaked to provide similar behaviour across platforms. If it is not recommended, the mentioned functions can be exposed as a separate clock function. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 10:29:11 2020 From: report at bugs.python.org (Dominik V.) Date: Thu, 06 Aug 2020 14:29:11 +0000 Subject: [issue41496] Create public API for typing._eval_type In-Reply-To: <1596718069.87.0.65884086877.issue41496@roundup.psfhosted.org> Message-ID: <1596724151.62.0.113810914007.issue41496@roundup.psfhosted.org> Change by Dominik V. : ---------- keywords: +patch pull_requests: +20898 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 11:41:25 2020 From: report at bugs.python.org (Rishav Kundu) Date: Thu, 06 Aug 2020 15:41:25 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596728485.97.0.507022449222.issue41303@roundup.psfhosted.org> Rishav Kundu added the comment: While I agree that the behavior of perf_counter should be consistent across macOS/Linux and Windows wrt system suspend, you can already access those clocks by using time.clock_gettime [1] with appropriate clock IDs (CLOCK_MONOTONIC_RAW on macOS and CLOCK_BOOTTIME on Linux) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 11:42:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 15:42:11 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596728531.44.0.31262589542.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: > While I agree that the behavior of perf_counter should be consistent across macOS/Linux and Windows wrt system suspend, perf_counter behavior during system suspend is undefined. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 11:42:42 2020 From: report at bugs.python.org (Rishav Kundu) Date: Thu, 06 Aug 2020 15:42:42 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596728562.22.0.580287984126.issue41303@roundup.psfhosted.org> Rishav Kundu added the comment: [1]: https://docs.python.org/3.8/library/time.html#time.clock_gettime [2]: https://developer.apple.com/documentation/kernel/1646199-mach_continuous_time effectively uses CLOCK_MONOTONIC_RAW on macOS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 11:52:24 2020 From: report at bugs.python.org (Damian Barabonkov) Date: Thu, 06 Aug 2020 15:52:24 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596729144.98.0.699407910065.issue38119@roundup.psfhosted.org> Damian Barabonkov added the comment: As per Guido's comment (https://github.com/python/cpython/pull/21516#issuecomment-668110711), I'm going to use this space to discuss ways to go forward with resource tracking and SharedMemory. Taking inspiration from Vinay (https://bugs.python.org/issue37754#msg351445), I think the simplest and best way forward is to use a small section of the shared memory at the start as a reference counter. Every time a process latches onto a shared memory block, it does and atomic increment to the reference counter. And if it detaches, it does an atomic decrement. This atomic operations are available in C via hardware specific instructions. This would require modifying the Python C code posixshmem.c. It should not be a difficult change. This would then change the SharedMemory API such that a call to `close()` could check the reference count at the end, and aromatically unlink if it reaches 0. Basically, the purpose of the explicit `unlink()` call is dissolved. I think this would also play nice with the current implementation of the `resource_tracker`. A small change would need to take place such that it calls `close()` instead of `unlink()` as the clean up function. Nonetheless, it would keep track if all attachments of shared memory call `close()` at the end, which they should, and issue a warning if they do not. It would do this with the current code, no need to change anything. ---------- nosy: +damian.barabonkov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 11:57:26 2020 From: report at bugs.python.org (Rishav Kundu) Date: Thu, 06 Aug 2020 15:57:26 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596729446.29.0.776980760516.issue41303@roundup.psfhosted.org> Rishav Kundu added the comment: > perf_counter behavior during system suspend is undefined Does the same apply for time.monotonic? I would argue that the difference in behavior between Linux/macOS and Windows is unreasonable; given that time.monotonic exists for measuring time intervals (which are not necessarily required to be of short duration ??unlike perf_counter). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:01:47 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Thu, 06 Aug 2020 16:01:47 +0000 Subject: [issue41478] Empty representation of AssertionError In-Reply-To: <1596559644.4.0.529490005495.issue41478@roundup.psfhosted.org> Message-ID: <1596729707.47.0.48935010012.issue41478@roundup.psfhosted.org> R?mi Lapeyre added the comment: > That's a solution, except you must know ahead of time this issue exists. If we changed str(e) to make it the same as repr(e), there would be no way to get only the message. str(e) returns the message so if the message given was empty (or no message was given) you get an empty string. This cannot be changed without breaking a lot of code. ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:05:12 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Aug 2020 16:05:12 +0000 Subject: [issue41492] Fix signing description for Windows release builds In-Reply-To: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> Message-ID: <1596729912.75.0.244260751112.issue41492@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +20899 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:10:28 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Aug 2020 16:10:28 +0000 Subject: [issue41304] [CVE-2020-15801] python 38 embed ignore python38._pth file on windows In-Reply-To: <1594824077.92.0.734722675541.issue41304@roundup.psfhosted.org> Message-ID: <1596730228.24.0.328037062983.issue41304@roundup.psfhosted.org> Steve Dower added the comment: Yes, it only affects Windows OS. On all other platforms, the python38._pth file is _always_ ignored. We have not implemented this support for those platforms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:25:35 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 06 Aug 2020 16:25:35 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596731135.21.0.836143478309.issue41458@roundup.psfhosted.org> Tim Peters added the comment: I'm skeptical of the need for - and wisdom of - this. Where does it come up? I can't think of any context where this would have been useful, or of any other language or package that does something like this. Long chains of mults are unusual outside of integer combinatorics to begin with. Closest I can recall came up in the Spambayes project. There we needed to compute the sum of the logs of a potentially large number of probabilities. But log (lack of!) speed proved to be a bottleneck, so I changed it to compute the log of the product of the probabilities. That product was all but certain to underflow to 0.0. But "for real" - no rearrangement of terms would have made any difference to that. Instead, akin to what Mark spelled out, every now & again frexp() was used to push the product bits back into [0.5, 1.0), and the power-of-2 exponent was tracked apart from that. fsum() is primarily aimed at a very different problem: improving the low-order bits. How to explain what this change to prod() would do? It may or may not stop spurious overflows or underflows, and the result depends on the order of the multiplicands. But in what way? If we can't/won't define what it does, how can other implementations of Python reproduce CPython's result? While I don't (yet?) see a real need for it, one thing that could work: compute the product left to right. Full speed - no checks at all. If the result is a 0, a NaN, or an infinity (which is bound to be rare in real life), do it again left to right with the frexp() approach. Then it can be explained: the result is what you'd get from left-to-right multiplication if the hardware had an unbounded exponent field, suffering overflow/underflow at the end only if the true exponent has magnitude too large for the hardware. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:36:04 2020 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 06 Aug 2020 16:36:04 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596731764.69.0.415485028126.issue38119@roundup.psfhosted.org> Guido van Rossum added the comment: I recommend bringing this new proposal up on python-dev or python-ideas, to get more eyeballs on the ideas before attempting implementation. One immediate worry I have is that if the reference counter is maintained in the shared memory segment, every process has to participate, and if a process crashes (segfaults) the shared refcount will be forever wrong and the segment will leak. Distributed GC is hard! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:36:29 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 06 Aug 2020 16:36:29 +0000 Subject: [issue41492] Fix signing description for Windows release builds In-Reply-To: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> Message-ID: <1596731789.29.0.87205454784.issue41492@roundup.psfhosted.org> Steve Dower added the comment: New changeset 777b611c8c5676b80898a429f71d28e59bddc49d by Steve Dower in branch 'master': bpo-41492: Fixes the description appearing in UAC prompts on Windows (GH-21754) https://github.com/python/cpython/commit/777b611c8c5676b80898a429f71d28e59bddc49d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:36:55 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Aug 2020 16:36:55 +0000 Subject: [issue41492] Fix signing description for Windows release builds In-Reply-To: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> Message-ID: <1596731815.78.0.769278020325.issue41492@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20901 pull_request: https://github.com/python/cpython/pull/21756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:36:47 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Aug 2020 16:36:47 +0000 Subject: [issue41492] Fix signing description for Windows release builds In-Reply-To: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> Message-ID: <1596731807.89.0.369602776135.issue41492@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20900 pull_request: https://github.com/python/cpython/pull/21755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:48:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 16:48:26 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596732506.15.0.858315177434.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: I looked at the aarch64 failure on Fedora Rawhide using GCC and the master branch. When I run "./python -m test -v test_gdb -m test_pycfunction" multiple times, I get a different error at each run, and sometimes the test pass, whereas nothing changes between the runs. * gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1) [gcc-10.2.1-1.fc33.aarch64] * GNU gdb (GDB) Fedora 9.2-2.fc33 [gdb-9.2-2.fc33.aarch64] When gdb fails to rebuild the stack file, it logs the message: "opening file=(...)/_testcapi.cpython-310d-aarch64-linux-gnu.so [0]; direct_opencount=1". It seems to be an issue in gdb, not in Python. I modified test_gdb.py to get subprocess arguments and output (out/err). == Logs of a success == args=('gdb', '--batch', '-nx', '-iex', 'add-auto-load-safe-path /home/vstinner/python/master/python-gdb.py', '--eval-command=set breakpoint pending yes', '--eval-command=break meth_fastcall', '--eval-command=set print address off', '--eva l-command=run', '--eval-command=set print entry-values no', '--eval-command=bt', '--eval-command=py-bt', '--args', '/home/vstinner/python/master/python', '-S', '-c', '\nimport _testcapi\ndef foo():\n _testcapi.meth_fastcall()\ndef bar( ):\n foo()\nbar()\n') --out-- Breakpoint 1 (meth_fastcall) pending. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1, meth_fastcall (self=, args=, nargs=0) at /home/vstinner/python/master/Modules/_testcapimodule.c:5255 5255 { #0 meth_fastcall (self=, args=, nargs=0) at /home/vstinner/python/master/Modules/_testcapimodule.c:5255 #1 cfunction_vectorcall_FASTCALL (func=, args=, nargsf=, kwnames=) at Objects/methodobject.c:424 #2 _PyObject_VectorcallTstate (tstate=, callable=, args=, nargsf=9223372036854775808, kwnames=0x0) at ./Include/cpython/abstract.h:114 #3 PyObject_Vectorcall (kwnames=0x0, nargsf=9223372036854775808, args=, callable=) at ./Include/cpython/abstract.h:123 #4 call_function (tstate=, pp_stack=, oparg=0, kwnames=0x0) at Python/ceval.c:5121 #5 _PyEval_EvalFrameDefault (tstate=, f=Frame 0x883070, for file , line 4, in foo (), throwflag=) at Python/ceval.c:3516 #6 _PyEval_EvalFrame (throwflag=0, f=Frame 0x883070, for file , line 4, in foo (), tstate=) at ./Include/internal/pycore_ceval.h:40 #7 function_code_fastcall (tstate=, co=, args=, nargs=0, globals=) at Objects/call.c:329 #8 _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:366 #9 _PyObject_VectorcallTstate (tstate=, callable=, args=, nargsf=9223372036854775808, kwnames=0x0) at ./Include/cpython/abstract.h:114 #10 PyObject_Vectorcall (kwnames=0x0, nargsf=9223372036854775808, args=, callable=) at ./Include/cpython/abstract.h:123 #11 call_function (tstate=, pp_stack=, oparg=0, kwnames=0x0) at Python/ceval.c:5121 #12 _PyEval_EvalFrameDefault (tstate=, f=Frame 0xffffea67f050, for file , line 6, in bar (), throwflag=) at Python/ceval.c:3547 #13 _PyEval_EvalFrame (throwflag=0, f=Frame 0xffffea67f050, for file , line 6, in bar (), tstate=) at ./Include/internal/pycore_ceval.h:40 #14 function_code_fastcall (tstate=, co=, args=, nargs=0, globals=) at Objects/call.c:329 #15 _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:366 #16 _PyObject_VectorcallTstate (tstate=, callable=, args=, nargsf=9223372036854775808, kwnames=0x0) at ./Include/cpython/abstract.h:114 #17 PyObject_Vectorcall (kwnames=0x0, nargsf=9223372036854775808, args=, callable=) at ./Include/cpython/abstract.h:123 #18 call_function (tstate=, pp_stack=, oparg=0, kwnames=0x0) at Python/ceval.c:5121 #19 _PyEval_EvalFrameDefault (tstate=, f=Frame 0xffffea6c15c0, for file , line 7, in (), throwflag=) at Python/ceval.c:3547 (...) --out--done --err-- Function "meth_fastcall" not defined. --err--done == Logs of a failure == args=('gdb', '--batch', '-nx', '-iex', 'add-auto-load-safe-path /home/vstinner/python/master/python-gdb.py', '--eval-command=set breakpoint pending yes', '--eval-command=break meth_fastcall', '--eval-command=set print address off', '--eva l-command=run', '--eval-command=set print entry-values no', '--eval-command=bt', '--eval-command=py-bt', '--args', '/home/vstinner/python/master/python', '-S', '-c', '\nimport _testcapi\ndef foo():\n _testcapi.meth_fastcall()\ndef bar( ):\n foo()\nbar()\n') --out-- Breakpoint 1 (meth_fastcall) pending. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGTRAP, Trace/breakpoint trap. ?? () from /home/vstinner/python/master/build/lib.linux-aarch64-3.10-pydebug/_testcapi.cpython-310d-aarch64-linux-gnu.so #0 ?? () from /home/vstinner/python/master/build/lib.linux-aarch64-3.10-pydebug/_testcapi.cpython-310d-aarch64-linux-gnu.so #1 ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) Unable to locate python frame --out--done --err-- Function "meth_fastcall" not defined. 1056556: opening file=/home/vstinner/python/master/build/lib.linux-aarch64-3.10-pydebug/_testcapi.cpython-310d-aarch64-linux-gnu.so [0]; direct_opencount=1 1056556: --err--done ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:53:07 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Aug 2020 16:53:07 +0000 Subject: [issue41492] Fix signing description for Windows release builds In-Reply-To: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> Message-ID: <1596732787.67.0.285266264828.issue41492@roundup.psfhosted.org> miss-islington added the comment: New changeset 713ba03276c4ddc33c9debc51b03164ea18eead6 by Miss Islington (bot) in branch '3.8': bpo-41492: Fixes the description appearing in UAC prompts on Windows (GH-21754) https://github.com/python/cpython/commit/713ba03276c4ddc33c9debc51b03164ea18eead6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 12:54:56 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Aug 2020 16:54:56 +0000 Subject: [issue41492] Fix signing description for Windows release builds In-Reply-To: <1596670501.61.0.28435008733.issue41492@roundup.psfhosted.org> Message-ID: <1596732896.29.0.0702103675698.issue41492@roundup.psfhosted.org> miss-islington added the comment: New changeset 1437bb06a9cfbf7dd2d2aa14f6a784bb020bdb84 by Miss Islington (bot) in branch '3.9': bpo-41492: Fixes the description appearing in UAC prompts on Windows (GH-21754) https://github.com/python/cpython/commit/1437bb06a9cfbf7dd2d2aa14f6a784bb020bdb84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 13:00:05 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 17:00:05 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596733205.18.0.754109828041.issue41458@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49373/sum_and_prod.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 13:08:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 17:08:14 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596733694.05.0.804889037072.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: More logs on the AArch64 issue. It seems like *sometimes*, gdb fails to parse debug symbols of _testcapi.cpython-310d-aarch64-linux-gnu.so, whereas most of the time, "bt" shows symbols as expected. stdout+stderr when the bug happens. ####################################################### Function "meth_fastcall" not defined. Breakpoint 1 (meth_fastcall) pending. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". 1069559: opening file=/home/vstinner/python/master/build/lib.linux-aarch64-3.10-pydebug/_testcapi.cpython-310d-aarch64-linux-gnu.so [0]; direct_opencount=1 1069559: Program received signal SIGTRAP, Trace/breakpoint trap. ?? () from /home/vstinner/python/master/build/lib.linux-aarch64-3.10-pydebug/_testcapi.cpython-310d-aarch64-linux-gnu.so #0 ?? () from /home/vstinner/python/master/build/lib.linux-aarch64-3.10-pydebug/_testcapi.cpython-310d-aarch64-linux-gnu.so #1 ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) Unable to locate python frame ####################################################### Extract of a successful run: ####################################################### Function "meth_fastcall" not defined. Breakpoint 1 (meth_fastcall) pending. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1, meth_fastcall (self=, args=, nargs=0) at /home/vstinner/python/master/Modules/_testcapimodule.c:5255 5255 { #0 meth_fastcall (self=, args=, nargs=0) at /home/vstinner/python/master/Modules/_testcapimodule.c:5255 #1 cfunction_vectorcall_FASTCALL (func=, args=, nargsf=, kwnames=) at Objects/methodobject.c:424 #2 _PyObject_VectorcallTstate (tstate=, callable=, args=, nargsf=9223372036854775808, kwnames=0x0) at ./Include/cpython/abstract.h:114 ####################################################### I can reproduce the issue with command "./script.sh" using the following files. script.sh: --- $ cat script.sh OUT=$(mktemp) while true; do gdb --batch -x cmds -args ./python -S x.py < /dev/null 2>&1 | tee $OUT grep -q -F ' _______________________________________ From report at bugs.python.org Thu Aug 6 13:27:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 06 Aug 2020 17:27:06 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596734826.26.0.0125747671613.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: I reported https://bugzilla.redhat.com/show_bug.cgi?id=1866884 to gdb: "Arch64: sometimes, gdb fails to load symbols of a dynamic library with a pending breakpoint". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 13:38:36 2020 From: report at bugs.python.org (Vinay Sharma) Date: Thu, 06 Aug 2020 17:38:36 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596735516.53.0.0914515422801.issue38119@roundup.psfhosted.org> Vinay Sharma added the comment: That's a valid point Guido. But, I guess this can be easily handled by resource tracker. At this current moment resource tracker unlinks shared memory if the process which created it dies without unliking it. Therefore, resource tracker handles cleaning up resources which the respective processes couldn't or didn't do. So, instead of unlinking the shared memory segment, resource tracker can instead decrement the reference count, if the process failed to do so, and if the reference count becomes 0, then unlink the shared memory segment. This approach will ensure that even if the respective processes died unexpectedly, there are no leaks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:12:26 2020 From: report at bugs.python.org (Olivier Dony) Date: Thu, 06 Aug 2020 18:12:26 +0000 Subject: [issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not In-Reply-To: <1548161762.46.0.975813554813.issue35805@roundup.psfhosted.org> Message-ID: <1596737546.73.0.18799542934.issue35805@roundup.psfhosted.org> Olivier Dony added the comment: With regard to msg349895, is there any chance this fix could be considered for backport? I imagine you could view it as a new feature, but it seems to be the only official fix we have for the fact that Python 3 generates invalid SMTP messages. And that's not a minor problem because many popular MTAs (GMail, Outlook, etc.) will rewrite non-RFC-conformant Message IDs, causing the original ID to be lost and missing in subsequent replies. This breaks an important mechanism to support email threads. To this day, several Linux distributions still ship 3.6 or 3.7, even in their latest LTS, and users and vendors are stuck with supporting those for a while. Thanks! ---------- nosy: +odo2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:13:34 2020 From: report at bugs.python.org (Olivier Dony) Date: Thu, 06 Aug 2020 18:13:34 +0000 Subject: [issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not In-Reply-To: <1548161762.46.0.975813554813.issue35805@roundup.psfhosted.org> Message-ID: <1596737614.87.0.137193062064.issue35805@roundup.psfhosted.org> Olivier Dony added the comment: Further, under Python 3.8 the issue is not fully solved, as other identification headers are still being folded in a non-RFC-conformant manner (see OP for RFC references). This was indicated on the original PR by the author: https://github.com/python/cpython/pull/13397#issuecomment-493618544 It is less severe of a problem than for Message-ID, but still means that MTA/MUA may fail to recognize the threading structure because identifiers are lost. Is it better to open a new issue for this? # Example on 3.8.2: the `In-Reply-To` header is RFC2047-folded. Python 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email.message >>> import email.policy >>> msg = email.message.EmailMessage(policy=email.policy.SMTP) >>> msg['Message-Id'] = '<929227342217024.1596730490.324691772460938-example-30661-some.reference at test-123.example.com>' >>> msg['In-Reply-To'] = '<92922734221723.1596730568.324691772460444-another-30661-parent.reference at test-123.example.com>' >>> print(msg.as_string()) Message-Id: <929227342217024.1596730490.324691772460938-example-30661-some.reference at test-123.example.com> In-Reply-To: =?utf-8?q?=3C92922734221723=2E1596730568=2E324691772460444-anot?= =?utf-8?q?her-30661-parent=2Ereference=40test-123=2Eexample=2Ecom=3E?= ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:18:30 2020 From: report at bugs.python.org (Damian Barabonkov) Date: Thu, 06 Aug 2020 18:18:30 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596737910.62.0.819606281652.issue38119@roundup.psfhosted.org> Damian Barabonkov added the comment: Unless the resource_tracker also dies along with the process. In which case, I'm not sure what there is there to do. I believe the resource_tracker actually spawns a process alongside the process that uses it. So if the parent process seg-faults, the resource_tracker should still be alive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:19:28 2020 From: report at bugs.python.org (Olivier Dony) Date: Thu, 06 Aug 2020 18:19:28 +0000 Subject: [issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not In-Reply-To: <1548161762.46.0.975813554813.issue35805@roundup.psfhosted.org> Message-ID: <1596737968.73.0.475104922226.issue35805@roundup.psfhosted.org> Olivier Dony added the comment: Somehow the message identifiers in the code sample got messed up in previous comment, here's the actual code, for what it's worth ;-) https://gist.github.com/odony/0323eab303dad2077c1277076ecc3733 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:24:36 2020 From: report at bugs.python.org (Vinay Sharma) Date: Thu, 06 Aug 2020 18:24:36 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596738276.16.0.321713740606.issue38119@roundup.psfhosted.org> Vinay Sharma added the comment: Well, the chances of resource tracker dying abruptly are very less because it's thoroughly tested, and there are mechanisms to re-spawn resource_tracker process if you see the code. There is a function called `def ensure_running`. Resource tracker is still alive even if the process for which it was created dies. It also handles cleaning shared semaphores. So, I guess this is something we can rely on for cleaning up things, because at the end of the day that's what it was made for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:26:24 2020 From: report at bugs.python.org (Ilya Kamenshchikov) Date: Thu, 06 Aug 2020 18:26:24 +0000 Subject: [issue41478] Empty representation of AssertionError In-Reply-To: <1596729707.47.0.48935010012.issue41478@roundup.psfhosted.org> Message-ID: Ilya Kamenshchikov added the comment: Changing behavior and it's impact on existing code is, without a doubt, a big deal here. Maybe it's a reason not to do anything about it. Just to understand guiding design principle, what is expected from __str__ in more general case? I thought about it as "user-friendly string representation", therefore expected an Exception without a message to identify itself by it's class. Best Regards, -- Ilya Kamen On Thu, Aug 6, 2020 at 6:05 PM R?mi Lapeyre wrote: > > R?mi Lapeyre added the comment: > > > That's a solution, except you must know ahead of time this issue exists. > > If we changed str(e) to make it the same as repr(e), there would be no way > to get only the message. str(e) returns the message so if the message given > was empty (or no message was given) you get an empty string. This cannot be > changed without breaking a lot of code. > > ---------- > versions: +Python 3.10, Python 3.9 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 14:32:27 2020 From: report at bugs.python.org (Damian Barabonkov) Date: Thu, 06 Aug 2020 18:32:27 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596738747.6.0.764338187261.issue38119@roundup.psfhosted.org> Damian Barabonkov added the comment: Agreed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:13:13 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 19:13:13 +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: <1596741193.09.0.782934324703.issue22107@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: -Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:16:51 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 19:16:51 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over In-Reply-To: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> Message-ID: <1596741411.43.0.459953310078.issue41456@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: -Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:27:23 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 19:27:23 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596742043.37.0.915533303081.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: [Uncle Timmy] > I'm skeptical of the need for - and wisdom of - this. Granted, the need is not common. On the other hand, if we can do it cheaply, why wouldn't we? Unnecessary overflow or underflow is never a desirable outcome. Currently, users do not have an easy and fast way to avoid that outcome. This comes up a lot when I use or teach how to apply Hypothesis to test floating point code. That tool makes you acutely aware of how much your functions have to be constrained to assure a useful output. And if you aren't satisfied with those constraints, it can be hard to fix unless you have robust primitives. Presumably that is why numpy uses pairwise summation instead of straight addition for example. To me, this is in the same category fixing the overflow error in bisect or using scaling in hypot() to avoid overflow or underflow. The core idea is to make the primitives as robust as possible if it can be done with only a minor performance impact. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:45:13 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 19:45:13 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596743113.36.0.739606821535.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, the occasions where this mattered all involved a mix of multiplications and divisions that mostly cancel out. The quadratic formula example is typical: product([4.0, a, c, 1.0/b, 1.0/b]. Or a floating point implementation of comb(): product([1000, 999, 998, 997, 1/4, 1/3, 1/2, 1/1]) Or terms in series expansions where both the numerator and denominator have many factors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:52:45 2020 From: report at bugs.python.org (JIanqiu Tao) Date: Thu, 06 Aug 2020 19:52:45 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis Message-ID: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> New submission from JIanqiu Tao : A potential UnicodeDecodeError could be raised when run "python -m dis" on non-utf8 encoding environment. Assume there is a file named "a.py", and contains "print('?')", then save with UTF8 encoding. Run "python -m dis ./a.py", on non-UTF8 encoding environment, for example a Windows PC which default language is Chinese. A UnicodeDecodeError raised. Traceback (most recent call last): File "C:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Program Files\Python38\lib\dis.py", line 553, in _test() File "C:\Program Files\Python38\lib\dis.py", line 548, in _test source = infile.read() UnicodeDecodeError: 'gbk' codec can't decode byte 0xb5 in position 9: illegal multibyte sequence That because Windows' default encoding is decided by language. Chinese use cp936(GB2312) as default encoding and can't handle UTF8 encoding. It just need to read in "rb" mode instead of "r". ---------- components: Library (Lib) messages: 374961 nosy: zkonge priority: normal severity: normal status: open title: Potential UnicodeDecodeError in dis type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:54:15 2020 From: report at bugs.python.org (JIanqiu Tao) Date: Thu, 06 Aug 2020 19:54:15 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596743655.84.0.338014638387.issue41497@roundup.psfhosted.org> Change by JIanqiu Tao : ---------- keywords: +patch pull_requests: +20902 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 15:58:28 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 19:58:28 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596743908.44.0.615597353287.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: I attached a file with latest (and more tested) recipe. The underflow test was fixed: "not total and old_total and x". Also, the final call to math.prod() was in-lined so that I could time it with PyPy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 16:20:07 2020 From: report at bugs.python.org (Roman Yurchak) Date: Thu, 06 Aug 2020 20:20:07 +0000 Subject: [issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set Message-ID: <1596745207.18.0.893678923913.issue41498@roundup.psfhosted.org> New submission from Roman Yurchak : The `_Py_Sigset_Converter` function is conditionally defined in https://github.com/python/cpython/blob/777b611c8c5676b80898a429f71d28e59bddc49d/Modules/posixmodule.h#L27 if `ifdef HAVE_SIGSET_T` However this function is called unconditionally in https://github.com/python/cpython/blob/777b611c8c5676b80898a429f71d28e59bddc49d/Modules/clinic/signalmodule.c.h#L385 (there are 4 such occurrences), which leads to a compilation error when `HAVE_SIGSET_T` is not set. This is regression in 3.8+ as far as I can tell due to changes in https://github.com/python/cpython/pull/6720 I imagine the solution could be to always define this function but raise an exception if it is called when HAVE_SIGSET_T` is undefined, as done in the following patch: https://github.com/iodide-project/pyodide/blob/fc5495ffdb54a11fd588dc60ba6b8777f90c3724/cpython/patches/0006-fix-Py_Sigset_Converter.patch Would this be acceptable, or is there a better way of handling it? Thanks! ---------- messages: 374963 nosy: Roman Yurchak, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 16:21:06 2020 From: report at bugs.python.org (Roman Yurchak) Date: Thu, 06 Aug 2020 20:21:06 +0000 Subject: [issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set In-Reply-To: <1596745207.18.0.893678923913.issue41498@roundup.psfhosted.org> Message-ID: <1596745266.25.0.0338168365192.issue41498@roundup.psfhosted.org> Change by Roman Yurchak : ---------- type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 16:34:35 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 06 Aug 2020 20:34:35 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596746075.09.0.598990244288.issue41458@roundup.psfhosted.org> Tim Peters added the comment: See "wisdom" earlier ;-) It's ad hoc trickery that seemingly can't be explained without showing the precise implementation in use today. As already mentioned, frexp() trickery _can_ be explained: exactly what you'd get if left-to-right HW multiplication were performed with an unbounded exponent, over- and under-flowing if and only if the infinite precision exponent at the end "doesn't fit". It completely eliminates spurious over-/under-flow. If someone wants that, it would be suitable for an fprod() function (which, like fsum(), makes strong guarantees at real cost). Precisely which cases does this other thing protect against? Is there any way to characterize them beyond "well, try it and see"? If there's an actual problem here, doesn't it deserve to be fixed? Just making it "less common" in some unquantifiable, unexplainable way seems unprincipled, and _possibly_ even harmful (e.g., by making it harder to provoke the underlying still-there problem without white box adversarial testing). > Presumably that is why numpy uses pairwise summation instead of > straight addition for example. Loss of precision in fp summation is an extremely common real-life problem with real-life consequences. That's why you can find dozens of papers, over the decades, on schemes to improve that. Adding a vector of a million floats is common; multiplying a vector of even a hundred floats is rare. Similarly, scaled hypot implementations have been re-invented dozens of times. Etc. When there's "a real" problem in fp life, it's hard _not_ to find mounds of prior art trying to address it. You can find a few pieces on avoiding spurious under-/over-flow when chaining multiplies and divides, primarily older papers talking about 32-bit float formats with very limited dynamic range. The common advice: rearrange the handful of inputs in the source code by hand, based on your application knowledge of their likely magnitudes, to make left-to-right evaluation "safe". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 16:46:49 2020 From: report at bugs.python.org (JIanqiu Tao) Date: Thu, 06 Aug 2020 20:46:49 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596746809.06.0.143306561244.issue41497@roundup.psfhosted.org> JIanqiu Tao added the comment: I searched the whole Lib folder and find a lot of code uses "open(filename, 'r')" without handling default encoding. Should we open another issue for these problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 18:09:55 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Aug 2020 22:09:55 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596751795.57.0.885430538355.issue41371@roundup.psfhosted.org> miss-islington added the comment: New changeset 5f0769a7529fcbc28190864f098f192053a10747 by Nathan M in branch 'master': bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734) https://github.com/python/cpython/commit/5f0769a7529fcbc28190864f098f192053a10747 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 18:09:56 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 06 Aug 2020 22:09:56 +0000 Subject: [issue41371] test_zoneinfo fails when lzma module is unavailable In-Reply-To: <1595449050.37.0.742582022147.issue41371@roundup.psfhosted.org> Message-ID: <1596751796.74.0.726121492493.issue41371@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20903 pull_request: https://github.com/python/cpython/pull/21758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 19:02:44 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 23:02:44 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596754964.27.0.869376635422.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: The algorithm stops all spurious overflows and underflows. If favorable cancellations exist, it finds them. Algorithm in Words ------------------ For every x in the sequence, multiply onto the total if possible. If x and "total" can't be combined without overflow/underflow, then x is given a "side" depending on |x| > 1.0. This indicates whether multiplying by x would increase the magnitude or decrease it. Note that "total" has the same side as "x". If one would increased magnitude and the other would decreased it, then our "total *= x" would have succeeded. The list "s" has the other pending multiplies. Each of them are on the same side ? either they all increase the magnitude or they all decrease it. The direction is stored in the "s_side" variable. If "x" is on the same side as everything else in "s", we just append it. No cancels are possible. If "x" and "t" are on the opposite side of the elements in "s", then we multiply the big/little pairs to get favorable cancellations. Any t_i will successfully combine with any s_i. At the end of the loop, "total" and "s" are both on the same side and no further favorable cancellations are possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 19:23:56 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 06 Aug 2020 23:23:56 +0000 Subject: [issue26791] shutil.move fails to move symlink (Invalid cross-device link) In-Reply-To: <1460912297.17.0.227992133358.issue26791@psf.upfronthosting.co.za> Message-ID: <1596756236.88.0.0804601803959.issue26791@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- keywords: +patch pull_requests: +20904 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 19:43:34 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 06 Aug 2020 23:43:34 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596757414.44.0.810999634936.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: Variable name correction: - If "x" and "t" are on the opposite side + If "x" and "total" are on the opposite side Extreme points will successfully combine: >>> float_info.max * float_info.min 3.9999999999999996 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 19:57:47 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 06 Aug 2020 23:57:47 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596758267.52.0.553168586251.issue41458@roundup.psfhosted.org> Tim Peters added the comment: Cool! So looks like you could also address an accuracy (not out-of-range) thing the frexp() method also does as well as possible: loosen the definition of "underflow" to include losing bits to subnormal products. For example, with the inputs >>> xs = [1e-200, 1e-121, 1e308] >>> product(xs) 9.98012604599318e-14 >>> _.hex() '0x1.c17704f58189cp-44' >>> math.prod(xs) # same thing 9.98012604599318e-14 >>> prod2(xs) # a tiny implementation of the frexp() method 1e-13 >>> _.hex() '0x1.c25c268497682p-44' product/math.prod get only a handful of the leading result bits right, because >>> 1e-200 * 1e-121 1e-321 >>> _.hex() '0x0.00000000000cap-1022' loses all but a handful of the trailing bits due to being in the subnormal range. Changing the order can repair that: >>> 1e-200 * 1e308 * 1e-121 1e-13 IOW, so far as "underflow" goes, we _start_ losing bits when the product becomes subnormal, well before it reaches 0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 17:32:41 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 06 Aug 2020 21:32:41 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596749561.08.0.5525972818.issue41458@roundup.psfhosted.org> Tim Peters added the comment: I may well have misread the code, believing it can still allow spurious over/underflows. On second reading of the current file, I don't know - it's more complicated than I thought. If it does guarantee to prevent them, then I shift from -1 to (probably ) -0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 22:53:51 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 02:53:51 +0000 Subject: [issue41419] Path.mkdir and os.mkdir don't respect setgid if its parent is g-s In-Reply-To: <1595948087.76.0.888842556227.issue41419@roundup.psfhosted.org> Message-ID: <1596768831.46.0.483269892313.issue41419@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 6 23:01:38 2020 From: report at bugs.python.org (Caleb Donovick) Date: Fri, 07 Aug 2020 03:01:38 +0000 Subject: [issue41232] Python `functools.wraps` doesn't deal with defaults correctly In-Reply-To: <1594159222.49.0.432639092165.issue41232@roundup.psfhosted.org> Message-ID: <1596769298.57.0.995455256036.issue41232@roundup.psfhosted.org> Change by Caleb Donovick : ---------- nosy: +donovick _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 00:50:12 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 04:50:12 +0000 Subject: [issue41238] Python 3 shelve.DbfilenameShelf is generating 164 times larger files than Python 2.7 when storing dicts In-Reply-To: <1594193566.99.0.171960738347.issue41238@roundup.psfhosted.org> Message-ID: <1596775812.88.0.946895693576.issue41238@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:09:12 2020 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 Aug 2020 05:09:12 +0000 Subject: [issue41493] Refactoring dictresize to accept only new keysize In-Reply-To: <1596704667.77.0.860143007378.issue41493@roundup.psfhosted.org> Message-ID: <1596776952.46.0.229475196382.issue41493@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 Aug 7 01:08:59 2020 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 Aug 2020 05:08:59 +0000 Subject: [issue41493] Refactoring dictresize to accept only new keysize In-Reply-To: <1596704667.77.0.860143007378.issue41493@roundup.psfhosted.org> Message-ID: <1596776939.05.0.534947936431.issue41493@roundup.psfhosted.org> Inada Naoki added the comment: New changeset d9323a8c6e07071a59dc4c910661db33236c01b2 by Inada Naoki in branch 'master': bpo-41493: Refactoring dictresize (GH-21751) https://github.com/python/cpython/commit/d9323a8c6e07071a59dc4c910661db33236c01b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:14:18 2020 From: report at bugs.python.org (Eryk Sun) Date: Fri, 07 Aug 2020 05:14:18 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596777258.03.0.539658695793.issue41303@roundup.psfhosted.org> Eryk Sun added the comment: > Does the same apply for time.monotonic? I would argue that the > difference in behavior between Linux/macOS and Windows is > unreasonable; given that time.monotonic exists for measuring time > intervals For time.monotonic in Windows, Python could switch to using QueryUnbiasedInterruptTime [1], which excludes periods in which the system is suspended or hibernated. In Windows 10, QueryUnbiasedInterruptTimePrecise [2] can be used, which directly reads the counter in the hardware timer instead of the value at the last timer interrupt. For time.time in Windows, Python 3.10 should switch to using GetSystemTimePreciseAsFileTime [3] instead of GetSystemTimeAsFileTime. For time.perf_counter in Windows, QueryPerformanceCounter remains the best option since it uses the invariant TSC in the CPU if available. --- Note that, unlike GetTickCount64, the resolution for QueryUnbiasedInterruptTime isn't lpTimeIncrement from GetSystemTimeAdjustment [4]. lpTimeIncrement is the initial default and upper bound for the interrupt period, which can be adjusted down with timeBeginPeriod or the undocumented system call NtSetTimerResolution. The former can lower the interrupt period from the default of about 10-16 ms (usually 15.625 ms, i.e. 64 interrupts/second) down to about 1 ms, while NtSetTimerResolution goes down to about 0.5 ms. It's not free, however, else it would be the default setting. More frequent timer interrupts can decrease system performance and increase power consumption. --- [1] https://docs.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttime [2] https://docs.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttimeprecise [3] https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime [4] https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeadjustment ---------- nosy: +eryksun versions: +Python 3.10, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:22:00 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 07 Aug 2020 05:22:00 +0000 Subject: [issue41440] os.cpu_count doesn't work on VxWorks RTOS In-Reply-To: <1596092864.05.0.11139024599.issue41440@roundup.psfhosted.org> Message-ID: <1596777720.52.0.15731726812.issue41440@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 3405e0542839cde94df9833b3809710a67a33c7c by pxinwr in branch 'master': bpo-41440: add os.cpu_count() support for VxWorks RTOS (GH-21685) https://github.com/python/cpython/commit/3405e0542839cde94df9833b3809710a67a33c7c ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:22:17 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 07 Aug 2020 05:22:17 +0000 Subject: [issue41440] os.cpu_count doesn't work on VxWorks RTOS In-Reply-To: <1596092864.05.0.11139024599.issue41440@roundup.psfhosted.org> Message-ID: <1596777737.38.0.533008053987.issue41440@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:26:20 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 05:26:20 +0000 Subject: [issue37724] [[Errno 17] File exists: ] # Try create directories that are not part of the archive with In-Reply-To: <1564525622.36.0.964910267569.issue37724@roundup.psfhosted.org> Message-ID: <1596777980.94.0.856717928667.issue37724@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:34:03 2020 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 Aug 2020 05:34:03 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596778443.6.0.113699213832.issue41497@roundup.psfhosted.org> Change by Inada Naoki : ---------- versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:34:51 2020 From: report at bugs.python.org (Vinay Sharma) Date: Fri, 07 Aug 2020 05:34:51 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1596778491.04.0.569295889964.issue38119@roundup.psfhosted.org> Vinay Sharma added the comment: As suggested by Guido I have floated this solution to python-dev mailing list. Link to archive: https://mail.python.org/archives/list/python-dev at python.org/thread/O67CR7QWEOJ7WDAJEBKSY74NQ2C4W3AI/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:39:12 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 05:39:12 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1596778752.4.0.123424306454.issue39871@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20905 pull_request: https://github.com/python/cpython/pull/21760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:38:52 2020 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 Aug 2020 05:38:52 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1596778732.06.0.769307259165.issue39871@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 54636355805dd2877bb54fbad8d967e1ddd8b553 by Zackery Spytz in branch 'master': bpo-39871: Fix an error in a news entry (GH-21749) https://github.com/python/cpython/commit/54636355805dd2877bb54fbad8d967e1ddd8b553 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:45:56 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 05:45:56 +0000 Subject: [issue39871] math.copysign raises SystemError with non-float x and custom y In-Reply-To: <1583463541.57.0.123228500554.issue39871@roundup.psfhosted.org> Message-ID: <1596779156.63.0.359046207441.issue39871@roundup.psfhosted.org> miss-islington added the comment: New changeset fc354ca51d0b6f24f2871788dfa7e35c56129f8b by Miss Islington (bot) in branch '3.9': bpo-39871: Fix an error in a news entry (GH-21749) https://github.com/python/cpython/commit/fc354ca51d0b6f24f2871788dfa7e35c56129f8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:48:10 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 05:48:10 +0000 Subject: [issue41169] socket.inet_pton raised when pass an IPv6 address like "[::]" to it In-Reply-To: <1593525971.46.0.103341919582.issue41169@roundup.psfhosted.org> Message-ID: <1596779290.39.0.651122324275.issue41169@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:50:46 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 05:50:46 +0000 Subject: [issue41157] email.message_from_string() is unable to find the headers for the .msg files In-Reply-To: <1593427866.61.0.334200042199.issue41157@roundup.psfhosted.org> Message-ID: <1596779446.19.0.864805885261.issue41157@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:52:49 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 05:52:49 +0000 Subject: [issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault In-Reply-To: <1593518684.95.0.149768712012.issue41168@roundup.psfhosted.org> Message-ID: <1596779569.29.0.620389298137.issue41168@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:53:16 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Aug 2020 05:53:16 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596779596.31.0.700402554536.issue41497@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good catch. Yes, when read Python source files you should either open them in binary mode if reading bytes is enough for use, or open them with tokenize.open() if we need string data, or use token.detect_encoding() and pass the result to open(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 01:53:57 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 05:53:57 +0000 Subject: [issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault In-Reply-To: <1593518684.95.0.149768712012.issue41168@roundup.psfhosted.org> Message-ID: <1596779637.54.0.799166193526.issue41168@roundup.psfhosted.org> Jeffrey Kintscher added the comment: Can you attach the Python source code for the PoC? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 02:01:48 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 07 Aug 2020 06:01:48 +0000 Subject: [issue41419] Path.mkdir and os.mkdir don't respect setgid if its parent is g-s In-Reply-To: <1595948087.76.0.888842556227.issue41419@roundup.psfhosted.org> Message-ID: <1596780108.16.0.256944653441.issue41419@roundup.psfhosted.org> Serhiy Storchaka added the comment: os.mkdir() is a thin wrapper around syscalls mkdir or mkdirat. Path.mkdir() is a thin wrapper around os.mkdir(). If you think that the behavior of mkdir differs from the documentation please file a report in the Linux kernel. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 02:10:10 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 06:10:10 +0000 Subject: [issue41419] Path.mkdir and os.mkdir don't respect setgid if its parent is g-s In-Reply-To: <1595948087.76.0.888842556227.issue41419@roundup.psfhosted.org> Message-ID: <1596780610.44.0.713798244658.issue41419@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: -Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 02:47:51 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 06:47:51 +0000 Subject: [issue37495] socket.inet_aton parsing issue on some libc versions In-Reply-To: <1562190874.32.0.352639947279.issue37495@roundup.psfhosted.org> Message-ID: <1596782871.67.0.930620814973.issue37495@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 02:49:54 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 06:49:54 +0000 Subject: [issue34360] urllib.parse doesn't fully comply to RFC 3986 In-Reply-To: <1533744155.42.0.56676864532.issue34360@psf.upfronthosting.co.za> Message-ID: <1596782994.83.0.991702921358.issue34360@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:25:11 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Aug 2020 07:25:11 +0000 Subject: [issue41129] Python extension modules fail to build on Mac 10.15.1 (Catalina) In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596785111.15.0.641060456029.issue41129@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the detailed analysis. That does seem like a reasonable explanation: the code in setup.py was not expecting to find anything other than system files under /System. For Apple to put other fs mount points in the /System hierarchy seems ... odd but there it is. At first glance, rather than singling out /Systems/Volumes/Data, changing the inclusion test from /System to /System/Library is probably sufficient. In the most recent SDKs, there is also /System/iOSSupport which is probably never going to come up in Python build contexts but it does point out that making assumptions here about the SDK contents is fragile. So perhaps an even better solution would be for setup.py to dynamically build a filter based on the contents of the SDK in use, i.e. examine the top level of System and usr in the SDK? As a reminder when implementing: /usr/local is a bit tricky. IIRC, recent versions of the compiler chain include /usr/local/include and /usrlocal/bin in the default search paths only in cases where an SDK was not explicitly named, the idea being that you don't want to include references to /usr/local files if you are building something to distribute to the world but it's fine (and necessary) to include /usr/local if you are just building something to run locally on the build system. I believe /Library works the same way. The tool chains from older version of Xcode and/or CLTs may work differently. So any changes we make here should try to do the right thing on the build tools for all supported versions of macOS. ---------- components: +macOS nosy: +ronaldoussoren resolution: works for me -> stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:32:03 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Aug 2020 07:32:03 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596785523.08.0.947907687619.issue41129@roundup.psfhosted.org> Change by Ned Deily : ---------- title: Python extension modules fail to build on Mac 10.15.1 (Catalina) -> setup.py test for macOS SDK files may incorrectly classify files in other file systems _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:32:06 2020 From: report at bugs.python.org (Inada Naoki) Date: Fri, 07 Aug 2020 07:32:06 +0000 Subject: [issue41098] Deprecating PyUnicodeEncodeError_Create In-Reply-To: <1592988158.78.0.202358099858.issue41098@roundup.psfhosted.org> Message-ID: <1596785526.28.0.308040754372.issue41098@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 46e19b61d31ba99f049258efa4ff1334856a3643 by Inada Naoki in branch 'master': bpo-41098: Doc: Add missing deprecated directives (GH-21162) https://github.com/python/cpython/commit/46e19b61d31ba99f049258efa4ff1334856a3643 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:32:07 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 07:32:07 +0000 Subject: [issue41098] Deprecating PyUnicodeEncodeError_Create In-Reply-To: <1592988158.78.0.202358099858.issue41098@roundup.psfhosted.org> Message-ID: <1596785527.37.0.632060617396.issue41098@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +20906 pull_request: https://github.com/python/cpython/pull/21761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:32:15 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 07:32:15 +0000 Subject: [issue41098] Deprecating PyUnicodeEncodeError_Create In-Reply-To: <1592988158.78.0.202358099858.issue41098@roundup.psfhosted.org> Message-ID: <1596785535.33.0.979838642011.issue41098@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20907 pull_request: https://github.com/python/cpython/pull/21762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:33:19 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Aug 2020 07:33:19 +0000 Subject: [issue41456] loop.run_in_executor creat thread but not destory it after the task run over In-Reply-To: <1596350435.61.0.637126528224.issue41456@roundup.psfhosted.org> Message-ID: <1596785599.16.0.143554900376.issue41456@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- resolution: -> not a bug type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:39:42 2020 From: report at bugs.python.org (Sergey Fedoseev) Date: Fri, 07 Aug 2020 07:39:42 +0000 Subject: [issue26834] Add truncated SHA512/224 and SHA512/256 In-Reply-To: <1461439661.19.0.970129415182.issue26834@psf.upfronthosting.co.za> Message-ID: <1596785982.11.0.163287964609.issue26834@roundup.psfhosted.org> Change by Sergey Fedoseev : ---------- nosy: +sir-sigurd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:49:57 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 07:49:57 +0000 Subject: [issue41098] Deprecating PyUnicodeEncodeError_Create In-Reply-To: <1592988158.78.0.202358099858.issue41098@roundup.psfhosted.org> Message-ID: <1596786597.07.0.449011620529.issue41098@roundup.psfhosted.org> miss-islington added the comment: New changeset dc98a5468a48ecffe95a6c3a07ce21366477bdd7 by Miss Islington (bot) in branch '3.8': bpo-41098: Doc: Add missing deprecated directives (GH-21162) https://github.com/python/cpython/commit/dc98a5468a48ecffe95a6c3a07ce21366477bdd7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 03:49:57 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 07:49:57 +0000 Subject: [issue41098] Deprecating PyUnicodeEncodeError_Create In-Reply-To: <1592988158.78.0.202358099858.issue41098@roundup.psfhosted.org> Message-ID: <1596786597.38.0.602706915382.issue41098@roundup.psfhosted.org> miss-islington added the comment: New changeset b2514c4934291364404a2bc78256b77026a80dff by Miss Islington (bot) in branch '3.9': bpo-41098: Doc: Add missing deprecated directives (GH-21162) https://github.com/python/cpython/commit/b2514c4934291364404a2bc78256b77026a80dff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 04:17:27 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 07 Aug 2020 08:17:27 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596788247.6.0.3517528327.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: I had not put any thought into subnormals (denormals?) because they didn't arise in my use cases. But it would be nice to handle them as well as possible. Accuracy improvements are welcome as well. And that goes hand in hand with better commutativity. The frexp() approach looks cleaner than my big/little matching algorithm and it doesn't require auxiliary memory. It may slower though. The matching algorithm only kicks in when overflows or underflows occur; otherwise, it runs close to full speed for the common case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 04:38:02 2020 From: report at bugs.python.org (=?utf-8?q?Lasse_N=C3=B8rfeldt?=) Date: Fri, 07 Aug 2020 08:38:02 +0000 Subject: [issue41499] logging nested file path Message-ID: <1596789482.89.0.186016372743.issue41499@roundup.psfhosted.org> New submission from Lasse N?rfeldt : I have been having a lot of issues when creating loggers that are located in nested folders. I have attached a .py with a logger module. Currently it works if I don't place them in nested folders... ---------- components: Library (Lib) files: logger.py messages: 374985 nosy: Norfeldt priority: normal severity: normal status: open title: logging nested file path versions: Python 3.8 Added file: https://bugs.python.org/file49374/logger.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 05:40:20 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Aug 2020 09:40:20 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596793220.1.0.98800205939.issue41129@roundup.psfhosted.org> Ronald Oussoren added the comment: > As a reminder when implementing: .... The whole configure machinery needs work :-(. Disabling looking in /usr/local should IMHO be an explicit choice when building, not something inferred from the presence of "-isysroot" in the compiler flags because that flag can be left out from most builds as Xcode hasn't shipped with multiple SDKs for a long while. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 05:43:14 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Aug 2020 09:43:14 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596793394.76.0.933915568213.issue41129@roundup.psfhosted.org> Ronald Oussoren added the comment: > For some background, our network location /mathworks is usually mounted at root, but due to the restrictions on macOS Catalina, it mounts at /System/Volumes/Data and we then add a symlink to the root directory so "/mathworks -> /System/Volumes/Data/mathworks" as to not break old code and scripts. So the real problem is that we cannot find extension module files under /System/Volumes/Data. Could you tell more about this? Why is this share mounted under /System/Volumes/Data and not under /Volumes? With the direction Apple is moving in I'm a bit surprised that this works at all, the direction seems to be toward a completely read-only tree in /System in /usr (except for /usr/local). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 06:01:15 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 07 Aug 2020 10:01:15 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596794475.27.0.549230765239.issue41129@roundup.psfhosted.org> Ned Deily added the comment: > Why is this share mounted under /System/Volumes/Data and not under /Volumes? See man 5 synthetic_conf for more details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 06:12:34 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 07 Aug 2020 10:12:34 +0000 Subject: [issue41499] logging nested file path In-Reply-To: <1596789482.89.0.186016372743.issue41499@roundup.psfhosted.org> Message-ID: <1596795154.19.0.236684589913.issue41499@roundup.psfhosted.org> Eric V. Smith added the comment: You'll need to explain what behavior you're seeing, and how that differs from what you expect. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 06:20:46 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Aug 2020 10:20:46 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1596795646.16.0.643578435372.issue41129@roundup.psfhosted.org> Ronald Oussoren added the comment: That doesn't answer my question, synthetic.conf should still make it possible to have the mountpoint in /, and that's even used as an example in the manpage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 07:10:23 2020 From: report at bugs.python.org (Pauser) Date: Fri, 07 Aug 2020 11:10:23 +0000 Subject: [issue41500] InterpolationSyntaxError reading the (windows) environment with unresolved environment variables Message-ID: <1596798623.9.0.767951694174.issue41500@roundup.psfhosted.org> New submission from Pauser : Hello, I tried to extend our config processing using the environment variables and the configparser module. On some machines (all windows) the configparser failed with an InterpolationSyntaxError ... It seems that not resolved environment variables (e.g. "test":"%not_existing%") lead to this error. I wrote little python test file reproducing the error and providing a very simple workaround to not fix all environments ;) Attention the bug is reproduced but the test is green ^^ I would be happy to remove the workaround as soon as possible ;) ---------- components: Library (Lib) files: test_EnvironmentProcessing.py messages: 374991 nosy: c_panser, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: InterpolationSyntaxError reading the (windows) environment with unresolved environment variables type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49375/test_EnvironmentProcessing.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 07:26:10 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Aug 2020 11:26:10 +0000 Subject: [issue41500] InterpolationSyntaxError reading the (windows) environment with unresolved environment variables In-Reply-To: <1596798623.9.0.767951694174.issue41500@roundup.psfhosted.org> Message-ID: <1596799570.05.0.459908035459.issue41500@roundup.psfhosted.org> Ronald Oussoren added the comment: The exception is due to the interpolation feature of ConfigParser, which expects a different syntax. The default interpolation syntax is "%(key)s". Interpolation can be turned off by passing "interpolation=None" when creating the ConfigParser object. See also https://docs.python.org/3/library/configparser.html#interpolation-of-values ---------- nosy: +ronaldoussoren resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 07:30:01 2020 From: report at bugs.python.org (=?utf-8?q?Lasse_N=C3=B8rfeldt?=) Date: Fri, 07 Aug 2020 11:30:01 +0000 Subject: [issue41499] logging nested file path In-Reply-To: <1596789482.89.0.186016372743.issue41499@roundup.psfhosted.org> Message-ID: <1596799801.86.0.34412278985.issue41499@roundup.psfhosted.org> Lasse N?rfeldt added the comment: When running a script like this ``` import os import utils.logger import utils.stats import utils.dir import utils.convert import re import CONSTANTS HTML_DIR_PATH = CONSTANTS.RAW_DATA_DIR + '/html' folder_contents = [fc for fc in os.listdir( HTML_DIR_PATH) if '.html' in fc and 'tablet' in fc and (', ' in fc or ' og ' in fc)] utils.dir.remove_dir(CONSTANTS.PROCESS_DATA_DIR) md_output_path = f'{CONSTANTS.PROCESS_DATA_DIR}/md' utils.dir.create_dir(md_output_path) convert_logger = utils.logger.LogFile('convert') for index, filename in enumerate(folder_contents): html_text = open(f'{HTML_DIR_PATH}/{filename}', 'r', encoding='utf-8').read() md_text = utils.convert.word_html_to_markdown(html_text) with open(f'{md_output_path}/{filename}.md', 'w+') as md_file: md_file.write(md_text) if any([flag in md_text for flag in CONSTANTS.INSPECT_FLAGS]): convert_logger.entry('Flag detected!') else: convert_logger.entry('Success! - no flags detected') procent = int(100*(index+1)/len(folder_contents)) print(f"{index+1}/{len(folder_contents)} ({procent}%)", end='\r') if index > 50: break utils.stats.gen_frequency_stats(convert_logger.path) utils.stats.gen_frequency_stats(utils.logger.EXCIPIENTS.path) utils.stats.gen_alpha_sort_stats(utils.logger.EXCIPIENTS.path) os.system(f'cat {utils.logger.EXCIPIENTS.path}.freq.stats') ``` I get an error like this ``` Traceback (most recent call last): File "dev/run_convert.py", line 40, in utils.stats.gen_frequency_stats(utils.logger.EXCIPIENTS.path) File "~/scraper-produktresume.dk/utils/stats.py", line 5, in gen_frequency_stats lines = _gen_list_from_lines(path_to_log_file) File "~/scraper-produktresume.dk/utils/stats.py", line 24, in _gen_list_from_lines with open(path_to_log_file, 'r') as log_file: FileNotFoundError: [Errno 2] No such file or directory: 'PROCESSED/excipients.log' ``` Was not expecting that since my utils.logger.py looks like this ``` import os import logging import CONSTANTS class LogFile: def __init__(self, logger_name): if not os.path.exists(CONSTANTS.PROCESS_DATA_DIR): os.makedirs(CONSTANTS.PROCESS_DATA_DIR) self.path = f'{CONSTANTS.PROCESS_DATA_DIR}/{logger_name}.log' self.file_handler = logging.FileHandler(self.path) self.logger = logging.getLogger(f'{logger_name}') self.logger.setLevel(logging.INFO) self.logger.addHandler(self.file_handler) def entry(self, text): self.logger.info(text) EXCIPIENTS = LogFile('excipients') ``` I'm both creating the file via the lib `os` (just to be sure that was not the case) and in the `self.file_handler` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 07:46:00 2020 From: report at bugs.python.org (Pauser) Date: Fri, 07 Aug 2020 11:46:00 +0000 Subject: [issue41500] InterpolationSyntaxError reading the (windows) environment with unresolved environment variables In-Reply-To: <1596798623.9.0.767951694174.issue41500@roundup.psfhosted.org> Message-ID: <1596800760.93.0.536202626783.issue41500@roundup.psfhosted.org> Pauser added the comment: So I have to use two config parser objects to merge the configuration of one config.ini (needs interpolation) and the environment on windows ? So at the end choose wether to use environment variables or config parser interpolation, right? (only on windows) Not the solution I was looking for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 07:57:16 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 11:57:16 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1596801436.22.0.604457803411.issue41483@roundup.psfhosted.org> Irit Katriel added the comment: Actually the lock is needed and it is currently missing from setTarget. The script below causes handle to be called on None, causing: File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1265, in emit self.flush() File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1348, in flush self.target.handle(record) AttributeError: 'NoneType' object has no attribute 'handle' ------------------------------------------------ import io import logging.handlers import threading import time class SlowHandler: def __init__(self): self.stream = io.StringIO() self.streamHandler = logging.StreamHandler(self.stream) def handle(self, msg): time.sleep(1) self.streamHandler.handle(msg) target = SlowHandler() mem_hdlr = logging.handlers.MemoryHandler(10, logging.ERROR, target) mem_logger = logging.getLogger('mem') mem_logger.propagate = False mem_logger.addHandler(mem_hdlr) def toggleTarget(): time.sleep(1) mem_hdlr.setTarget(None) t = threading.Thread(target=toggleTarget, args=()) t.daemon = True t.start() while True: time.sleep(0.1) mem_logger.warning("warning not flushed") mem_logger.error("error is flushed") print("%s" % target.stream.getvalue().splitlines()) ------------------------------------------------ ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 08:07:01 2020 From: report at bugs.python.org (hai shi) Date: Fri, 07 Aug 2020 12:07:01 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596802021.29.0.0292339742871.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20908 pull_request: https://github.com/python/cpython/pull/21764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 08:54:37 2020 From: report at bugs.python.org (BSM and 102 others) Date: Fri, 07 Aug 2020 12:54:37 +0000 Subject: [issue41501] 0x80070643, can't install any version Message-ID: <1596804877.84.0.108317920754.issue41501@roundup.psfhosted.org> New submission from BSM and 102 others : I wanted to install Python 3.8, but I poorly removed a previous version of Python 3.3 through the "permanently delete" function. I started the installer and it gave me a 0x80070643 error with a log similar to the link provided(https://pastebin.com/RzQEttiL). I then try and uninstall via the Control Panel, but it does nothing. "Change" brings up a 3.3 launcher, but that crashes as well. "Repair" brings up a message saying "Fatal error during installation", so I switch to installing via a 3.3.3 64bit launcher, which crashes, then I switch to a non-64bit one, and that crashes. I also try toggling PATH, but that changes nothing. And now I am stuck. ---------- components: Installation messages: 374996 nosy: BSMMedia priority: normal severity: normal status: open title: 0x80070643, can't install any version type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 09:11:36 2020 From: report at bugs.python.org (Aaron Lichtman) Date: Fri, 07 Aug 2020 13:11:36 +0000 Subject: [issue41502] Option for Colored Logging in http.server Module Message-ID: <1596805896.61.0.531750689021.issue41502@roundup.psfhosted.org> New submission from Aaron Lichtman : It would be useful if the http.server module had an option for colored logging to help users visually parse the HTTP traffic logs. $ python3 -m http.server 80 --color is along the lines of what I'm thinking. ---------- components: Library (Lib) messages: 374997 nosy: alichtman priority: normal severity: normal status: open title: Option for Colored Logging in http.server Module type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 10:39:58 2020 From: report at bugs.python.org (wyz23x2) Date: Fri, 07 Aug 2020 14:39:58 +0000 Subject: [issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?) In-Reply-To: <1585026386.04.0.352572849659.issue40051@roundup.psfhosted.org> Message-ID: <1596811198.89.0.293700533827.issue40051@roundup.psfhosted.org> wyz23x2 added the comment: Ping? Which of the 3 should we choose? ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 10:40:08 2020 From: report at bugs.python.org (wyz23x2) Date: Fri, 07 Aug 2020 14:40:08 +0000 Subject: [issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?) In-Reply-To: <1585026386.04.0.352572849659.issue40051@roundup.psfhosted.org> Message-ID: <1596811208.04.0.715927839305.issue40051@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:01:00 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 15:01:00 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1596812460.65.0.522082635323.issue41483@roundup.psfhosted.org> Irit Katriel added the comment: I guess the missing lock in setTarget is a different issue than the one you raise here and should be a separate ticket - I will create one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:08:08 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 07 Aug 2020 15:08:08 +0000 Subject: [issue41500] InterpolationSyntaxError reading the (windows) environment with unresolved environment variables In-Reply-To: <1596798623.9.0.767951694174.issue41500@roundup.psfhosted.org> Message-ID: <1596812888.22.0.237385462963.issue41500@roundup.psfhosted.org> Ronald Oussoren added the comment: There's multiple options: 1. Escape '%' in environment variables (%%not_existing%%) to avoid the exception 2. Switch to configparser.ExtendedInterpolation for the interpolation, which uses a different syntax that doesn't conflict with env. variables on Windows (but does conflict with that on Unix) Note that regardless of the option ConfigParser will not expand the value of the environment variable reference. If you want to be able to interpolate env variables you need a different solution, for example by using the 'defaults' argument to ConfigParser and expand references using the ConfigParser interpolation syntax. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:10:00 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 15:10:00 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler Message-ID: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> New submission from Irit Katriel : The `logging.handlers.MemoryHandler.setTarget()` method does not acquire the lock, so it can change the target while flush is processing the buffer. The script below causes flush to call target.handle when target is None, causing: File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1265, in emit self.flush() File "C:\Users\User\src\cpython\lib\logging\handlers.py", line 1348, in flush self.target.handle(record) AttributeError: 'NoneType' object has no attribute 'handle' ------------------------------------------------ import io import logging.handlers import threading import time class SlowHandler: def __init__(self): self.stream = io.StringIO() self.streamHandler = logging.StreamHandler(self.stream) def handle(self, msg): time.sleep(1) self.streamHandler.handle(msg) target = SlowHandler() mem_hdlr = logging.handlers.MemoryHandler(10, logging.ERROR, target) mem_logger = logging.getLogger('mem') mem_logger.propagate = False mem_logger.addHandler(mem_hdlr) def toggleTarget(): time.sleep(1) mem_hdlr.setTarget(None) t = threading.Thread(target=toggleTarget, args=()) t.daemon = True t.start() while True: time.sleep(0.1) mem_logger.warning("warning not flushed") mem_logger.error("error is flushed") ------------------------------------------------ ---------- components: Library (Lib) messages: 375001 nosy: iritkatriel priority: normal severity: normal status: open title: Race between setTarget and flush in logging.handlers.MemoryHandler type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:16:12 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 15:16:12 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1596813372.6.0.0921985328149.issue41503@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +20909 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:18:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:18:41 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596813521.33.0.774791353597.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 598a951844122678de2596dbc1e0e09e2be65fd2 by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21764) https://github.com/python/cpython/commit/598a951844122678de2596dbc1e0e09e2be65fd2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:29:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:29:26 +0000 Subject: [issue41477] test_genericalias fails if ctypes is missing In-Reply-To: <1596553540.81.0.229958329134.issue41477@roundup.psfhosted.org> Message-ID: <1596814166.53.0.901153409226.issue41477@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +20910 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:32:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:32:32 +0000 Subject: [issue41476] test_zoneinfo fails if the _lzma module is missing In-Reply-To: <1596553447.24.0.104799735954.issue41476@roundup.psfhosted.org> Message-ID: <1596814352.52.0.00931907947221.issue41476@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_zoneinfo fails when lzma module is unavailable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:32:47 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Aug 2020 15:32:47 +0000 Subject: [issue27307] string.Formatter does not support key/attribute access on unnumbered fields In-Reply-To: <1465831962.68.0.949862526307.issue27307@psf.upfronthosting.co.za> Message-ID: <1596814367.49.0.67952326541.issue27307@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +20911 pull_request: https://github.com/python/cpython/pull/21767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:38:04 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:38:04 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596814684.57.0.621863593331.issue41473@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +20912 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:38:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:38:54 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596814734.21.0.937089403186.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: Since I identified a gdb regression in gdb 9.2, I wrote PR 21768 to skip test_gdb on gdb >= 9.2 until the bug is fixed: https://bugzilla.redhat.com/show_bug.cgi?id=1866884 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:39:42 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 15:39:42 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1596814782.62.0.58428810254.issue41483@roundup.psfhosted.org> Irit Katriel added the comment: Regarding the change you suggest here - I think you need add another check that target is not None after you've acquired the lock to make it safe. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:57:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:57:01 +0000 Subject: [issue41477] test_genericalias fails if ctypes is missing In-Reply-To: <1596553540.81.0.229958329134.issue41477@roundup.psfhosted.org> Message-ID: <1596815821.45.0.644422125187.issue41477@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f44693eaed3b9d91a6e415d48224fd4750b59366 by Victor Stinner in branch 'master': bpo-41477: Make ctypes optional in test_genericalias (GH-21766) https://github.com/python/cpython/commit/f44693eaed3b9d91a6e415d48224fd4750b59366 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:57:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 15:57:59 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596815879.5.0.540371532766.issue41473@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e27a51c11e10d5df79b3e48dc3e7bfedfad5a794 by Victor Stinner in branch 'master': bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768) https://github.com/python/cpython/commit/e27a51c11e10d5df79b3e48dc3e7bfedfad5a794 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:59:27 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 15:59:27 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596815967.07.0.961258779078.issue41473@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20916 pull_request: https://github.com/python/cpython/pull/21770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 11:59:17 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 15:59:17 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596815957.63.0.677482826893.issue41473@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +20915 pull_request: https://github.com/python/cpython/pull/21769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 12:15:40 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 16:15:40 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596816940.53.0.893061043686.issue41473@roundup.psfhosted.org> miss-islington added the comment: New changeset 87bc22051fcfcf181160d06a57ac2b16ee071f8f by Miss Islington (bot) in branch '3.8': bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768) https://github.com/python/cpython/commit/87bc22051fcfcf181160d06a57ac2b16ee071f8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 12:18:32 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 07 Aug 2020 16:18:32 +0000 Subject: [issue41473] test_gdb fails on AMD64 Fedora Rawhide 3.x In-Reply-To: <1596550767.43.0.215651378336.issue41473@roundup.psfhosted.org> Message-ID: <1596817112.79.0.491618009664.issue41473@roundup.psfhosted.org> miss-islington added the comment: New changeset 5e12a5b82230cfa34a9c32f58467770e2076313c by Miss Islington (bot) in branch '3.9': bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768) https://github.com/python/cpython/commit/5e12a5b82230cfa34a9c32f58467770e2076313c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 12:29:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 16:29:12 +0000 Subject: [issue41303] perf_counter result does not count system sleep time in Mac OS In-Reply-To: <1594816999.52.0.200760723432.issue41303@roundup.psfhosted.org> Message-ID: <1596817752.44.0.62755680214.issue41303@roundup.psfhosted.org> STINNER Victor added the comment: > For time.time in Windows, Python 3.10 should switch to using GetSystemTimePreciseAsFileTime [3] instead of GetSystemTimeAsFileTime. It's already tracked by bpo-19007: "precise time.time() under Windows 8: use GetSystemTimePreciseAsFileTime". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 12:31:49 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 16:31:49 +0000 Subject: [issue41433] Logging libraries BufferingHandler flushed twice at shutdown In-Reply-To: <1596002244.65.0.208232248615.issue41433@roundup.psfhosted.org> Message-ID: <1596817909.55.0.529543194252.issue41433@roundup.psfhosted.org> Irit Katriel added the comment: I think this may be the same issue as in: https://stackoverflow.com/questions/47549602/logging-handlers-bufferinghandler-subclassed-handler-showing-log-twice Did you call flush on super()? If this is not the same issue, please post a code snippet to explain what exactly you are seeing. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 13:27:05 2020 From: report at bugs.python.org (hai shi) Date: Fri, 07 Aug 2020 17:27:05 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596821225.88.0.33894584646.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20917 pull_request: https://github.com/python/cpython/pull/21772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 14:07:15 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 18:07:15 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596823635.21.0.701022944883.issue41490@roundup.psfhosted.org> Steve Dower added the comment: The issue above doesn't appear to repro on 3.9, so I guess master has started leaking a file handle, presumably in zipimport. I'll see what I can track down, but can't be sure I'll have enough time to get it done for RC, so if anyone else wants to help out feel free. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 14:26:43 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 07 Aug 2020 18:26:43 +0000 Subject: [issue40934] Default RLock does not work well for Manager Condition In-Reply-To: <1591747783.0.0.431376232538.issue40934@roundup.psfhosted.org> Message-ID: <1596824803.37.0.749419064216.issue40934@roundup.psfhosted.org> Irit Katriel added the comment: I was unable to reproduce what you're seeing on windows 10, master branch. Please provide more information regarding the python version and system you are seeing this problem on. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 14:56:30 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Aug 2020 18:56:30 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596826590.6.0.390406733344.issue41455@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 15:04:43 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 19:04:43 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596827083.71.0.788990376685.issue41490@roundup.psfhosted.org> Steve Dower added the comment: Okay, I've tracked it down to the new importlib.readers.ZipReader class keeping the zip file open, presumably until it gets GC'd. This is used by certifi to extract the CA certs from the whl when ensurepip is doing the self-install from the mounted wheel. Jason is already on this bug, which is convenient :) I haven't yet figured out whether there's a convenient way for the reader to not keep the ZIP open for as long as it exists, but I think that's going to be the safest fix. We should definitely fix this one ourselves without forcing users to make changes to accommodate. As I mentioned above, it's only in 3.10 right now, but it's blocking updated pip and setuptools versions downlevel. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 15:10:59 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Aug 2020 19:10:59 +0000 Subject: [issue41460] Translation Error in in Functional Programming HOWTO page In-Reply-To: <1596428289.44.0.783644077267.issue41460@roundup.psfhosted.org> Message-ID: <1596827459.17.0.0748909119334.issue41460@roundup.psfhosted.org> Terry J. Reedy added the comment: This tracker is only for the original English version of the docs. The translations are by a different group with different tools and workflow. This page https://docs.python.org/ja/3/bugs.html# should not literally translate the instructions for the English version. Julien, I thought there was something about translations in the devguide but cannot find it. https://devguide.python.org/docquality/ would seen line a good place. ---------- nosy: +terry.reedy resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 15:14:15 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Aug 2020 19:14:15 +0000 Subject: [issue41478] Empty representation of AssertionError In-Reply-To: <1596559644.4.0.529490005495.issue41478@roundup.psfhosted.org> Message-ID: <1596827655.77.0.39113647999.issue41478@roundup.psfhosted.org> Terry J. Reedy added the comment: Ilya, in the future, when responding by email, please delete the message you are responding to. It is already present on the web page. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 15:29:22 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Aug 2020 19:29:22 +0000 Subject: [issue41478] Empty representation of AssertionError In-Reply-To: <1596559644.4.0.529490005495.issue41478@roundup.psfhosted.org> Message-ID: <1596828562.74.0.204476528196.issue41478@roundup.psfhosted.org> Terry J. Reedy added the comment: Since you should print the exception class anyway, I think that using repr should be sufficient and that this issue should be closed. In any case, the current behavior does not seem like a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 16:24:40 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 20:24:40 +0000 Subject: [issue5141] C API for appending to arrays In-Reply-To: <1233654934.43.0.515749486926.issue5141@psf.upfronthosting.co.za> Message-ID: <1596831880.59.0.873287174282.issue5141@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 16:38:30 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 07 Aug 2020 20:38:30 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1596832710.24.0.928217363954.issue41109@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 17:19:20 2020 From: report at bugs.python.org (Edward K Ream) Date: Fri, 07 Aug 2020 21:19:20 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst Message-ID: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> New submission from Edward K Ream : These links added with the provisional approval of GvR, pending approval of the PR. ---------- assignee: docs at python components: Documentation messages: 375019 nosy: docs at python, edreamleo priority: normal severity: normal status: open title: Add links to asttokens, leoAst, LibCST and Parso to ast.rst type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 17:27:18 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 07 Aug 2020 21:27:18 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1596835638.99.0.638629677718.issue41504@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +20918 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 17:43:54 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 21:43:54 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596836634.46.0.636102064513.issue41490@roundup.psfhosted.org> Steve Dower added the comment: Added some test cases to the PR that directly trigger the issue, specifically this one: def test_entered_path_does_not_keep_open(self): # This is what certifi does on import to make its bundle # available for the process duration. c = resources.path('ziptestdata', 'binary.file').__enter__() self.zip_path.unlink() All the tests I added pass on 3.9 (with minor tweaks for moved test utils). To unblock the upcoming releases, I'm going to do the backports first and leave this as a release blocker for 3.10. ---------- nosy: +brett.cannon, eric.snow priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 17:45:39 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 21:45:39 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596836739.79.0.934464055447.issue41490@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +20919 pull_request: https://github.com/python/cpython/pull/21774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 17:49:14 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 21:49:14 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596836954.24.0.997203453481.issue41490@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +20920 pull_request: https://github.com/python/cpython/pull/21775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 17:55:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 07 Aug 2020 21:55:42 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596837342.65.0.737643480837.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fcce8c649a14f7a81fae82f9f203bb5b5ee0c205 by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21772) https://github.com/python/cpython/commit/fcce8c649a14f7a81fae82f9f203bb5b5ee0c205 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 18:03:36 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 22:03:36 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596837816.03.0.667206207071.issue41490@roundup.psfhosted.org> Steve Dower added the comment: GitHub Actions has decided not to run CI today, so you'll have to look at Azure Pipelines for the test failures: https://dev.azure.com/Python/cpython/_build/results?buildId=67152&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334&t=5a421c4a-0933-53d5-26b9-04b36ad165eb&l=8012 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 18:10:40 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 22:10:40 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596838240.11.0.00755212162092.issue41490@roundup.psfhosted.org> Steve Dower added the comment: New changeset 135de08128a76f49752ac57c316129500275e828 by Steve Dower in branch '3.8': bpo-41490: Update ensurepip to install pip 20.2.1 and setuptools 49.2.1 (GH-21775) https://github.com/python/cpython/commit/135de08128a76f49752ac57c316129500275e828 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 18:33:10 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 22:33:10 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596839590.89.0.935915637923.issue41490@roundup.psfhosted.org> Change by Steve Dower : ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 19:17:35 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 07 Aug 2020 23:17:35 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596842255.52.0.527984278413.issue41455@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +pablogsal, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 19:47:47 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 23:47:47 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596844067.33.0.560776340514.issue41490@roundup.psfhosted.org> Steve Dower added the comment: New changeset 70e9243a55be9c32b41f2149cdfa3957f96f8471 by Steve Dower in branch '3.9': bpo-41490: Update ensurepip to install pip 20.2.1 and setuptools 49.2.1 (GH-21774) https://github.com/python/cpython/commit/70e9243a55be9c32b41f2149cdfa3957f96f8471 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 19:51:38 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 07 Aug 2020 23:51:38 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1596844298.21.0.944446742769.issue41490@roundup.psfhosted.org> Change by Steve Dower : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 20:13:06 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 08 Aug 2020 00:13:06 +0000 Subject: [issue41494] Add window resizing support [ SIGWINCH ] to Lib/pty In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1596845586.54.0.403776095921.issue41494@roundup.psfhosted.org> Soumendra Ganguly added the comment: Updated diff. Changes _ekill() ---------- Added file: https://bugs.python.org/file49376/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 20:44:32 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 08 Aug 2020 00:44:32 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596847472.58.0.582480315938.issue41474@roundup.psfhosted.org> Guido van Rossum added the comment: Sorry to rain on your parade, but couldn?t this be a new package on PyPI? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 20:47:02 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 08 Aug 2020 00:47:02 +0000 Subject: [issue41474] Missing dependency on Include/cpython/frameobject.h In-Reply-To: <1596551033.65.0.706475501997.issue41474@roundup.psfhosted.org> Message-ID: <1596847622.82.0.83558853309.issue41474@roundup.psfhosted.org> Guido van Rossum added the comment: Wrong issue, sorry. (Bpo bug?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 21:24:55 2020 From: report at bugs.python.org (Kevin Amado) Date: Sat, 08 Aug 2020 01:24:55 +0000 Subject: [issue41505] asyncio.gather of large streams with limited resources Message-ID: <1596849895.25.0.102671243316.issue41505@roundup.psfhosted.org> New submission from Kevin Amado : Sometimes when dealing with high concurrency systems developers face the problem of executing concurrently a large number of tasks while taking care of a finite pool of resources Just to mention some examples: - reading asynchronously a lot of files without exceeding the maximum number of open files by the operative system - making millions of requests to a website, doing it in sufficiently small batches as not to be banned by the site's firewall or hitting API limits - making a lot of DNS lookups without exceeding the maximum number of open sockets allowed by the operative system - and many more What these examples have in common is that there is a hard-limit in the maximum concurrency possible to solve the problem. A naive approach is to split the long list of tasks in small batches and use asyncio.gather on each batch. This, however, has some downsides if one of the tasks takes more time than the others because at some point in time only this task would be running and the execution of the following batch gets delayed, impacting performance and overall throughput and execution time. Another approach is to use asyncio.wait on a subset of tasks, gathering the done tasks and appending more tasks from the remaining subset until all tasks get executed. This alternative is good but still far from optimal as many boilerplate code is needed. The ideal approach is to operate in the possibly infinite list of tasks with an always constant number of them being resolved concurrently. If one of the tasks being concurrently executed finishes then immediately another one is fetched from the input stream and added to the list of concurrently executing ones. By doing it in this way we optimize the resources needed while minimizing the total execution time and never exceeding the finite pool of resources (sockets, open files, http API limit), etc. What I'm attaching is a proof of concept of a new function to add to the asyncio.tasks module that implements the ideal approach. The proposed signature for such function is: async def materialize(aws, *, max_concurrency=None) And functions in this way: ``` async def do(n: int) -> None: print('running', n) await asyncio.sleep(1) print('returning', n) return n async def main(): result = [] async for x in materialize(map(do, range(5)), max_concurrency=2): print('got', x) result.append(x) print(result) ``` Whose output is: running 0 running 1 returning 0 returning 1 got 0 got 1 running 2 running 3 returning 2 returning 3 got 2 got 3 running 4 returning 4 got 4 [0, 1, 2, 3, 4] As you can see, tasks are resolved concurrently without exceeding the max concurrency allowed, yet always executing concurrently as many tasks as the limit specifies. Yielding results as soon as available, keeping a small memory footprint (proportional to the max concurrency allowed) and returning results in the same order of the input stream (opposite to asyncio.as_completed) Since it's an asynchronous generator it can deal with infinite input streams, which is nice! I'm willing to work further on a PR ---------- components: asyncio files: materialize.py messages: 375028 nosy: asvetlov, kamadorueda, yselivanov priority: normal severity: normal status: open title: asyncio.gather of large streams with limited resources type: enhancement versions: Python 3.10 Added file: https://bugs.python.org/file49377/materialize.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 21:32:00 2020 From: report at bugs.python.org (Aaron Meurer) Date: Sat, 08 Aug 2020 01:32:00 +0000 Subject: [issue41506] Inclusion or documentation of extended with syntax in 3.9 Message-ID: <1596850320.21.0.142080709573.issue41506@roundup.psfhosted.org> New submission from Aaron Meurer : This discussion started at https://github.com/python/cpython/pull/19503 (actually on Twitter https://twitter.com/asmeurer/status/1289304407696261120), but Guido asked me to move it bpo. Alongside the implementation of Python 3.9's new PEG parser, a new syntax feature has been added, which is the ability to use parentheses in with statements, like with (open('a') as f1, open('b') as f2): ... This is an error in lower versions of Python (or an error about tuple not having __enter__ if the "as" parts are omitted). This new feature is not documented in the "What's new in Python 3.9" document https://docs.python.org/3.9/whatsnew/3.9.html. It also apparently goes against PEP 627 https://www.python.org/dev/peps/pep-0617/, which says (in bold), "no new Python Grammar addition will be added that requires the PEG parser". Note that this feature does indeed rely on the PEG parser, and it stops working if you use python -X oldparser or PYTHONOLDPARSER=1. I think this feature should either 1. be removed from 3.9 and held until 3.10, or 2. be documented properly, including in the document for the "with" statement and the "what's new" document. Also the PEP should be updated if this option is chosen. Others have stated opinions about this on the issue or on Twitter, but I'll let them repeat them here rather than trying to summarize. ---------- messages: 375029 nosy: asmeurer priority: normal pull_requests: 20921 severity: normal status: open title: Inclusion or documentation of extended with syntax in 3.9 versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 21:36:03 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 08 Aug 2020 01:36:03 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1596850563.09.0.385831243835.issue41109@roundup.psfhosted.org> Jeffrey Kintscher added the comment: The workaround is to override _init(), which I agree is not desirable. This is the relevant code in PurePath, which is the super class of PurePosixPath: @classmethod def _from_parsed_parts(cls, drv, root, parts, init=True): self = object.__new__(cls) self._drv = drv self._root = root self._parts = parts if init: self._init() return self ... def _init(self): # Overridden in concrete Path pass To me, the clean way to get the desired behavior seems like it would be to have _init() call self.__init__(). def _init(self): # Overridden in concrete Path self.__init__() This fixes p.parent, but GithubPath() ends up calling GithubPath.__init__() twice ??the first time by PurePath.__new__() calling PurePath._init() and the second time by the GithubPath object creation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 22:05:42 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 08 Aug 2020 02:05:42 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1596852342.96.0.166956744262.issue41109@roundup.psfhosted.org> Jeffrey Kintscher added the comment: Clarification: PurePath.__new__() calls PurePath._from_parts(), which then calls PurePath._init() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 22:51:16 2020 From: report at bugs.python.org (hai shi) Date: Sat, 08 Aug 2020 02:51:16 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596855076.05.0.33336554112.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20922 pull_request: https://github.com/python/cpython/pull/21771 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:03:12 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 08 Aug 2020 03:03:12 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596855792.48.0.07712405429.issue41497@roundup.psfhosted.org> Inada Naoki added the comment: New changeset a4084b9d1e40c1c9259372263d1fe8c8a562b093 by Konge in branch 'master': bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757) https://github.com/python/cpython/commit/a4084b9d1e40c1c9259372263d1fe8c8a562b093 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:03:32 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 03:03:32 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596855812.28.0.281545879051.issue41497@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20924 pull_request: https://github.com/python/cpython/pull/21783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:03:23 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 03:03:23 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596855803.51.0.932853917923.issue41497@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20923 pull_request: https://github.com/python/cpython/pull/21782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:14:44 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 08 Aug 2020 03:14:44 +0000 Subject: [issue41507] Use utf-8 in "Reading and Writing Files" tutorial. Message-ID: <1596856484.75.0.552563820268.issue41507@roundup.psfhosted.org> New submission from Inada Naoki : https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files Current tutorial doesn't mention about encoding and example uses locale encoding. Since UTF-8 is major text encoding and many Windows environment doesn't use UTF-8 by default, encoding should be mentioned in the tutorial and UTF-8 should be recommended. Additionally, the paragraph about line ending conversion [1] can be removed. This was important in Python 2. But it is not important because (en|de)coding binary data is nonsense already. [1]: "This behind-the-scenes modification to file data is fine for text files, but will corrupt binary data like that in JPEG or EXE files. Be very careful to use binary mode when reading and writing such files." ---------- assignee: docs at python components: Documentation keywords: newcomer friendly messages: 375033 nosy: docs at python, inada.naoki priority: normal severity: normal status: open title: Use utf-8 in "Reading and Writing Files" tutorial. type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:21:40 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 03:21:40 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596856900.91.0.570684269894.issue41497@roundup.psfhosted.org> miss-islington added the comment: New changeset 66c899661902edc18df96a5c3f22639310700491 by Miss Islington (bot) in branch '3.8': bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757) https://github.com/python/cpython/commit/66c899661902edc18df96a5c3f22639310700491 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:24:22 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 03:24:22 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596857062.02.0.0708683505925.issue41497@roundup.psfhosted.org> miss-islington added the comment: New changeset d9106434f77fa84c8a59f8e60dc9c14cdd989b35 by Miss Islington (bot) in branch '3.9': bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757) https://github.com/python/cpython/commit/d9106434f77fa84c8a59f8e60dc9c14cdd989b35 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:28:41 2020 From: report at bugs.python.org (Kevin Amado) Date: Sat, 08 Aug 2020 03:28:41 +0000 Subject: [issue41505] asyncio.gather of large streams with limited resources In-Reply-To: <1596849895.25.0.102671243316.issue41505@roundup.psfhosted.org> Message-ID: <1596857321.61.0.868330986008.issue41505@roundup.psfhosted.org> Change by Kevin Amado : Removed file: https://bugs.python.org/file49377/materialize-implementation.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 7 23:38:50 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 08 Aug 2020 03:38:50 +0000 Subject: [issue41497] Potential UnicodeDecodeError in dis In-Reply-To: <1596743565.22.0.770154691166.issue41497@roundup.psfhosted.org> Message-ID: <1596857930.06.0.708560224856.issue41497@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 Aug 8 00:15:56 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 08 Aug 2020 04:15:56 +0000 Subject: [issue32884] Adding the ability for getpass to print asterisks when password is typed In-Reply-To: <1519122533.37.0.467229070634.issue32884@psf.upfronthosting.co.za> Message-ID: <1596860156.91.0.393076391263.issue32884@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 02:11:42 2020 From: report at bugs.python.org (Chitrank-Dixit) Date: Sat, 08 Aug 2020 06:11:42 +0000 Subject: [issue40064] py38: document xml.etree.cElementTree will be removed in 3.9 Message-ID: <1596867102.24.0.790459922782.issue40064@roundup.psfhosted.org> Change by Chitrank-Dixit : ---------- keywords: +patch nosy: +Chitrank-Dixit nosy_count: 2.0 -> 3.0 pull_requests: +20925 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 02:15:46 2020 From: report at bugs.python.org (Chitrank-Dixit) Date: Sat, 08 Aug 2020 06:15:46 +0000 Subject: [issue40064] py38: document xml.etree.cElementTree will be removed in 3.9 Message-ID: <1596867346.4.0.810060139535.issue40064@roundup.psfhosted.org> New submission from Chitrank-Dixit : Looking at this issue, I can see the changes in the file `xml.etree.elementtree` should go like .. warning:: The :mod:`xml.etree.ElementTree` will be removed from python 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 03:33:54 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 08 Aug 2020 07:33:54 +0000 Subject: [issue32884] Adding the ability for getpass to print asterisks when password is typed In-Reply-To: <1519122533.37.0.467229070634.issue32884@psf.upfronthosting.co.za> Message-ID: <1596872034.52.0.80134518138.issue32884@roundup.psfhosted.org> Jeffrey Kintscher added the comment: This is easy to implement for Windows (as shown), but the unix implementation uses io.TextIOWrapper.readline() to get the password input. The unix implementation would have to be rewritten to provide the same functionality. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 05:32:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Aug 2020 09:32:49 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596879169.47.0.810808161887.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d94af3f7ed98e6bfb4bf5f918f464b5e23d3ed1b by Hai Shi in branch 'master': bpo-40275: Remove test helpers aliases in test.support (GH-21771) https://github.com/python/cpython/commit/d94af3f7ed98e6bfb4bf5f918f464b5e23d3ed1b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 05:47:14 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Sat, 08 Aug 2020 09:47:14 +0000 Subject: [issue41501] 0x80070643, can't install any version In-Reply-To: <1596804877.84.0.108317920754.issue41501@roundup.psfhosted.org> Message-ID: <1596880034.12.0.747072576146.issue41501@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 05:57:46 2020 From: report at bugs.python.org (Alex) Date: Sat, 08 Aug 2020 09:57:46 +0000 Subject: [issue41508] Failed to open os.path in Open Module window of IDLE without any error informations Message-ID: <1596880666.24.0.0998253425531.issue41508@roundup.psfhosted.org> New submission from Alex <2423067593 at qq.com>: When openning os.path by Open Module window in IDLE (Shortcut: Alt + M), the window didn't open 'ntpath'(in Windows) or show any error informations. ---------- assignee: terry.reedy components: IDLE messages: 375040 nosy: Alex-Python-Programmer, terry.reedy priority: normal severity: normal status: open title: Failed to open os.path in Open Module window of IDLE without any error informations type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 06:21:49 2020 From: report at bugs.python.org (hai shi) Date: Sat, 08 Aug 2020 10:21:49 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596882109.0.0.17313283091.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20927 pull_request: https://github.com/python/cpython/pull/21785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 06:34:16 2020 From: report at bugs.python.org (=?utf-8?q?=C3=89tienne_Pot?=) Date: Sat, 08 Aug 2020 10:34:16 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1596882856.28.0.495183152635.issue41109@roundup.psfhosted.org> ?tienne Pot added the comment: Before solving this issue, I think it would be best to think on a more generic solution on how to make Pathlib more extensible. Related to: https://discuss.python.org/t/make-pathlib-extensible/3428 For instance, if childs created with `p.parent()`, `p / 'subdir'` need to forward some state (e.g. `RemotePath(path, password=, user=)`). Rather than __init__, maybe there should be some __post_init__ like dataclasses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:05:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 08 Aug 2020 11:05:49 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596884749.57.0.618899053311.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c6f282f3b1cb6da6febc3b8b6d2dc1ef714dbbf7 by Hai Shi in branch 'master': bpo-40275: Use new test.support helper submodules in tests (GH-21785) https://github.com/python/cpython/commit/c6f282f3b1cb6da6febc3b8b6d2dc1ef714dbbf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:14:45 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 08 Aug 2020 11:14:45 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py for proper output rendering In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1596885285.49.0.124842971635.issue41494@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: Add window resizing support [ SIGWINCH ] to Lib/pty -> Adds window resizing support to Lib/pty.py for proper output rendering _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:18:04 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 Aug 2020 11:18:04 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596885484.24.0.0601381605982.issue40275@roundup.psfhosted.org> Terry J. Reedy added the comment: PR-21771 "Remove test helpers aliases in test.support" was just merged. It needs an immediate followup to document the new locations of constants and functions. The now dead entries in test.suppport doc must be moved into new support module docs, with whatever revisions. As of this moment, the module index has test test.support test.support.script_helper So temp_dir, for instance, is still documented as part of test.support, which it no longer is, instead of the undocumented test.support.os_helper, where it now exclusively resides. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:23:50 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 08 Aug 2020 11:23:50 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py for proper output rendering In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1596885830.67.0.719509237325.issue41494@roundup.psfhosted.org> Soumendra Ganguly added the comment: The following are two [ very old ] stackoverflow threads that are relevant. https://stackoverflow.com/questions/6418678/resize-the-terminal-with-python https://stackoverflow.com/questions/16941885/want-to-resize-terminal-windows-in-python-working-but-not-quite-right ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:26:03 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 08 Aug 2020 11:26:03 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1596885963.81.0.676383413076.issue41494@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: Adds window resizing support to Lib/pty.py for proper output rendering -> Adds window resizing support to Lib/pty.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:27:17 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 08 Aug 2020 11:27:17 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py [ SIGWINCH ] In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1596886037.21.0.877443281152.issue41494@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: Adds window resizing support to Lib/pty.py -> Adds window resizing support to Lib/pty.py [ SIGWINCH ] _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 07:54:24 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 08 Aug 2020 11:54:24 +0000 Subject: [issue41508] Failed to open os.path in Open Module window of IDLE without any error informations In-Reply-To: <1596880666.24.0.0998253425531.issue41508@roundup.psfhosted.org> Message-ID: <1596887664.03.0.533787906153.issue41508@roundup.psfhosted.org> Terry J. Reedy added the comment: On Windows 10: when I start 3.7.8 IDLE in Command Prompt with C:\Users\Terry>py -3.7 -m idlelib and try Open Module with 'os.path', I get this traceback in Command Prompt. Exception in Tkinter callback Traceback (most recent call last): File "C:\Programs\Python37\lib\tkinter\__init__.py", line 1705, in __call__ return self.func(*args) File "C:\Programs\Python37\lib\idlelib\query.py", line 148, in ok entry = self.entry_ok() File "C:\Programs\Python37\lib\idlelib\query.py", line 218, in entry_ok file_path = spec.loader.get_filename(name) File "", line 406, in _check_name_wrapper ImportError: loader for ntpath cannot handle os.path The same action displays ntpath.py in 3.8.5 and 3.9.0b5. Line 219 in query.py is the same as 3.7 query.py line 218 above. I conclude that the problem was a bug in importlib that was fixed more recently than your version of 3.8. Hence closing. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 08:27:10 2020 From: report at bugs.python.org (William Pickard) Date: Sat, 08 Aug 2020 12:27:10 +0000 Subject: [issue41501] 0x80070643, can't install any version In-Reply-To: <1596804877.84.0.108317920754.issue41501@roundup.psfhosted.org> Message-ID: <1596889630.56.0.168692316382.issue41501@roundup.psfhosted.org> William Pickard added the comment: Try what's explained here: https://support.microsoft.com/en-us/help/2438651/how-to-troubleshoot-windows-installer-errors ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 09:47:37 2020 From: report at bugs.python.org (Louis-Vincent Boudreault) Date: Sat, 08 Aug 2020 13:47:37 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1596894457.45.0.691783286863.issue41109@roundup.psfhosted.org> Louis-Vincent Boudreault added the comment: Path.__new__ should not call _from_parts because it breaks the specialization by directly using object.__new__. This is why `_from_parts` has to be duplicated in each subclass's `__new__`. My suggestion (first draft) is to do the parsing of arguments inside an `__init__` in the Path class hierarchy and deprecate `_from_parts`. ``` class PurePath: def __new__(cls, *args): if cls is PurePath: cls = PureWindowsPath if os.name == 'nt' else PurePosixPath super().__new__(cls, *args) # Here we remove call to from_parts def __init__(self, *args): # We should have an __init__ in the hierarchy. drv, root, parts = self._parse_args(args) # this would get the proper _flavour. self._drv = drv self._root = root self._parts = parts ... class Path(PurePath): def __new__(cls, *args, **kwargs): if cls is Path: cls = WindowsPath if os.name == 'nt' else PosixPath # REMOVE THIS LINE: self = cls._from_parts(args, init=False) # if not self._flavour.is_supported: raise NotImplementedError("cannot instantiate %r on your system" % (cls.__name__,)) return super().__new__(cls, *args, **kwargs) # Use super ``` I don't know what is the purpose of `_init` and if it could be replaced by an extra keyword argument in __init__. The class method `_from_parts` would become deprecated since the argument parsing would be now handled by `__init__`. By using __init__ and avoid the direct call to `object.__new__` we would respect class specialization and custom class could be implemented intuitively. ---------- nosy: +louis-vincent.boudre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 11:19:51 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 08 Aug 2020 15:19:51 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596899991.01.0.998811212104.issue41458@roundup.psfhosted.org> Tim Peters added the comment: "Denormal" and "subnormal" mean the same thing. The former is probably still in more common use, but all the relevant standards moved to "subnormal" some years ago. Long chains of floating mults can lose precision too, but hardly anyone bothers to do anything about that. Unlike sums, they're just not common or in critical cores. For example, nobody ever computes the determinant of a million-by-million triangular matrix by producting ;-) the diagonal. I only recall one paper devoted to this, using "doubled precision" tricks like fsum employs (but much more expensive unless hardware fused mul-add is available): "Accurate Floating Point Product and Exponentiation" Stef Graillat However, that does nothing to prevent spurious overflow or underflow. Much simpler: presumably pairwise products can enjoy lower accumulated error for essentially the same reasons pairwise summation "works well". Yet, far as I know, nobody bothers. Here's a cute program: if 1: from decimal import Decimal from random import random, shuffle, seed def pairwise(xs, lo, hi): n = hi - lo if n == 1: return xs[lo] elif n == 2: return xs[lo] * xs[lo + 1] else: mid = (lo + hi) // 2 return pairwise(xs, lo, mid) * pairwise(xs, mid, hi) N = 4000 print(f"using {N=:,}") for s in (153, 53, 314, 271828, 789): print("\nwith aeed", s) seed(s) xs = [random() * 10.0 for i in range(N)] xs.extend(1.0 / x for x in xs[:]) shuffle(xs) print("prod ", math.prod(xs)) print("product", product(xs)) # the code attached to this report print("frexp ", prod2(xs)) # straightforward frexp print("Decimal", float(math.prod(map(Decimal, xs)))) print("pair ", pairwise(xs, 0, len(xs))) By construction, the product of xs should be close to 1.0. With N=4000 as given, out-of-range doesn't happen, and all results are pretty much the same: using N=4,000 with aeed 153 prod 0.9999999999999991 product 0.9999999999999991 frexp 0.9999999999999991 Decimal 1.0000000000000042 pair 1.0000000000000016 with aeed 53 prod 1.0000000000000056 product 1.0000000000000056 frexp 1.0000000000000056 Decimal 1.0000000000000002 pair 0.9999999999999997 with aeed 314 prod 1.0000000000000067 product 1.0000000000000067 frexp 1.0000000000000067 Decimal 1.0000000000000082 pair 1.0000000000000002 with aeed 271828 prod 0.9999999999999984 product 0.9999999999999984 frexp 0.9999999999999984 Decimal 1.0000000000000004 pair 1.0000000000000064 with aeed 789 prod 0.9999999999999994 product 0.9999999999999994 frexp 0.9999999999999994 Decimal 1.0 pair 1.0000000000000069 But boost N so that out-of-range is common, and only frexp and Decimal remain reliable. Looks almost cetain that `product()` has serious bugs: using N=400,000 with aeed 153 prod 0.0 product 1980.1146715391837 frexp 0.999999999999969 Decimal 1.000000000000027 pair nan with aeed 53 prod 0.0 product 6.595056534948324e+24 frexp 1.0000000000000484 Decimal 1.0000000000000513 pair nan with aeed 314 prod 0.0 product 6.44538471095855e+60 frexp 0.9999999999999573 Decimal 0.999999999999934 pair nan with aeed 271828 prod inf product 2556126.798990014 frexp 0.9999999999999818 Decimal 0.9999999999999885 pair nan with aeed 789 prod 0.0 product 118772.89118349401 frexp 0.9999999999999304 Decimal 1.0000000000000053 pair nan ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 11:59:27 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 08 Aug 2020 15:59:27 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596902367.29.0.671054367561.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's a pairwise variant: def prod(seq): stack = [] exp = 0 for i, x in enumerate(seq, start=1): m, e = frexp(x) exp += e stack += [m] while not i&1: i >>= 1 x, y = stack[-2:] stack[-2:] = [x * y] total = 1.0 while stack: total *= stack.pop() return ldexp(total, exp) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 12:23:59 2020 From: report at bugs.python.org (Wayne Davison) Date: Sat, 08 Aug 2020 16:23:59 +0000 Subject: [issue40027] re.sub inconsistency beginning with 3.7 In-Reply-To: <1584724873.49.0.294512015302.issue40027@roundup.psfhosted.org> Message-ID: <1596903839.26.0.841580714589.issue40027@roundup.psfhosted.org> Wayne Davison <4wayned at gmail.com> added the comment: Can this bug please be reopened and fixed? This is an anchored substitution, and so should never match more than once. ---------- nosy: +4wayned _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 12:35:41 2020 From: report at bugs.python.org (hai shi) Date: Sat, 08 Aug 2020 16:35:41 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596904541.97.0.186434920388.issue40275@roundup.psfhosted.org> hai shi added the comment: Hi, terry. When creating the new test helpers, the docs have been updated. such as: https://docs.python.org/3.10/library/test.html#module-test.support.os_helper ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 13:30:17 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 08 Aug 2020 17:30:17 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596907817.78.0.829600653701.issue41458@roundup.psfhosted.org> Tim Peters added the comment: Well, that can't work: the most likely result for a long input is 0.0 (try it!). frexp() forces the mantissa into range [0.5, 1.0). Multiply N of those, and the result _can_ be as small as 2**-N. So, as in Mark's code, every thousand times (2**-1000 is nearing the subnormal boundary) frexp() is used again to force the product-so-far back into range. That's straightforward when going "left to right". With fancier reduction schemes, "it varies". Aiming for "obviously correct" rather than for maximal cleverness ;-) , here I'll associate each partial product with an integer e such that it's guaranteed (in the absence of infinities, NaNs, zeroes), abs(partial_product) >= 2^^-e. Then quick integer arithmetic can be used in advance to guard against a partial product underflowing: def frpair(seq): from math import frexp, ldexp stack = [] exp = 0 for i, x in enumerate(seq, start=1): m, e = frexp(x) exp += e stack += [(m, 1)] while not i&1: i >>= 1 (x, e1), (y, e2) = stack[-2:] esum = e1 + e2 if esum >= 1000: x, e = frexp(x) exp += e y, e = frexp(y) exp += e esum = 2 stack[-2:] = [(x * y, esum)] total = 1.0 totale = 0 while stack: x, e = stack.pop() totale += e if totale >= 1000: total, e = frexp(total) exp += e x, e = frexp(x) exp += e totale = 2 total *= x return ldexp(total, exp) But I see no obvious improvement in accuracy over "left to right" for the uniformly random test cases I've tried. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 13:34:37 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 08 Aug 2020 17:34:37 +0000 Subject: [issue41509] ntpath.relpath behaves differently on Windows with trailing spaces Message-ID: <1596908077.96.0.398710638995.issue41509@roundup.psfhosted.org> New submission from Jason R. Coombs : On Windows: Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import ntpath >>> ntpath.relpath('foo ', 'foo') '.' On macOS: Python 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ntpath >>> ntpath.relpath('foo ', 'foo') '..\\foo ' I stumbled into this issue when troubleshooting an [issue in a Setuptools PR](https://github.com/pypa/setuptools/pull/2305#issuecomment-670946965). I suspect the Windows version is using some API that strips whitespace from the filename before performing a relative path. However, when using relpath to detect characters after a common path, stripping the whitespace can cause problems. I wouldn't expect Windows to be performing normalization of paths in relpath, but it seems it does. If this behavior is by design and has a good reason, that behavior should be mirrored in the non-Windows implementation. ---------- components: Windows messages: 375053 nosy: jaraco, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ntpath.relpath behaves differently on Windows with trailing spaces versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 13:35:19 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 08 Aug 2020 17:35:19 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596908119.87.0.109477709994.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: > But I see no obvious improvement in accuracy > over "left to right" for the uniformly random > test cases I've tried. Same here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 14:48:24 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 18:48:24 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912504.55.0.0241359152945.issue41455@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 82ca8fada15b121866530f2cdac1b7055be4a244 by Yaroslav Pankovych in branch 'master': bpo-41455: Provide a link to how the third generation is collected in the GC docs (GH-21703) https://github.com/python/cpython/commit/82ca8fada15b121866530f2cdac1b7055be4a244 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 14:48:42 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 18:48:42 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912522.16.0.457969626023.issue41455@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20929 pull_request: https://github.com/python/cpython/pull/21787 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 14:48:35 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 18:48:35 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912515.05.0.845668903243.issue41455@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20928 pull_request: https://github.com/python/cpython/pull/21786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 14:48:49 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 18:48:49 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912529.4.0.7780429474.issue41455@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20930 pull_request: https://github.com/python/cpython/pull/21788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 14:49:18 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 18:49:18 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912558.36.0.347933455742.issue41455@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 Aug 8 14:55:18 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 18:55:18 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912918.84.0.705438129205.issue41455@roundup.psfhosted.org> miss-islington added the comment: New changeset 103ce3debf07a48e79319acd0890be0c53e64fff by Miss Islington (bot) in branch '3.9': bpo-41455: Provide a link to how the third generation is collected in the GC docs (GH-21703) https://github.com/python/cpython/commit/103ce3debf07a48e79319acd0890be0c53e64fff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 14:55:48 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 08 Aug 2020 18:55:48 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1596912948.74.0.945797083336.issue41455@roundup.psfhosted.org> miss-islington added the comment: New changeset 105cfb5b182da63e8481fcb009e92546d240c6b5 by Miss Islington (bot) in branch '3.8': bpo-41455: Provide a link to how the third generation is collected in the GC docs (GH-21703) https://github.com/python/cpython/commit/105cfb5b182da63e8481fcb009e92546d240c6b5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:15:05 2020 From: report at bugs.python.org (Eryk Sun) Date: Sat, 08 Aug 2020 19:15:05 +0000 Subject: [issue41509] ntpath.relpath behaves differently on Windows with trailing spaces In-Reply-To: <1596908077.96.0.398710638995.issue41509@roundup.psfhosted.org> Message-ID: <1596914105.65.0.212673205852.issue41509@roundup.psfhosted.org> Eryk Sun added the comment: > I suspect the Windows version is using some API that strips whitespace > from the filename before performing a relative path. When normalizing a path, the Windows API strips trailing dots and spaces from the final component. Apparently it also strips a single trailing dot from other components if the dot is preceded by any character other than a dot. For example: >>> nt._getfullpathname('foo../bar./bam. . .') 'C:\\foo..\\bar\\bam' The way to create or open a file or directory with a name that ends with a dot or space is to prefix the path with exactly "\\\\?\\". However, it is strongly advised to never create a file or directory with such an abnormal name. Note that this prefix only affects using a path in an open/create context. It doesn't prevent an explicit normalization, such as the following: >>> nt._getfullpathname('\\\\?\\C:/foo../bar./bam. . .') '\\\\?\\C:\\foo..\\bar\\bam' > I wouldn't expect Windows to be performing normalization of paths in > relpath, but it seems it does. ntpath.relpath calls ntpath.abspath, which calls nt._getfullpathname in Windows. On POSIX systems, ntpath.abspath is ntpath._abspath_fallback. The latter and ntpath.normpath need to be improved to better implement Windows path normalization. normpath should not exclude paths that start with '\\\\.\\' and '\\\\?\\', and it should trim trailing spaces and dots from component names to match how Windows normalizes a path. _abspath_fallback should default to the root directory for drive relative paths (e.g. "C:foo" -> "C:\\foo"). It should also substitute a device path if the final component in a relative or drive-letter path (but not a UNC path or device path) matches a known DOS device name. Matching a DOS device name ignores everything after a dot or colon that's preceded by zero or more spaces (e.g. "con .anything" -> "\\\\.\\con" and "nul:anything" -> "\\\\.\\nul"). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:48:21 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 19:48:21 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596916101.16.0.502105440309.issue40275@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR21771 has broken a considerable amount of buildbopts so we would need to revert it if is not fixed in 24 hours ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:49:41 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 19:49:41 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596916181.92.0.856952262421.issue40275@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> This PR has broken a considerable amount of build bots, so we would need to revert it if is not fixed in 24 hours Whops, sorry I just saw that this is being fixed here #21785, apologies then! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:51:32 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 19:51:32 +0000 Subject: [issue35786] get_lock() method is not present for Values created using multiprocessing.Manager() In-Reply-To: <1547934632.93.0.223661167179.issue35786@roundup.psfhosted.org> Message-ID: <1596916292.43.0.398662651114.issue35786@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:52:44 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 19:52:44 +0000 Subject: [issue39102] Increase Enum performance In-Reply-To: <1576810108.88.0.911071266859.issue39102@roundup.psfhosted.org> Message-ID: <1596916364.0.0.0132706831177.issue39102@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:52:53 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 19:52:53 +0000 Subject: [issue39697] Failed to build with --with-cxx-main=g++-9.2.0 In-Reply-To: <1582198678.47.0.589589124523.issue39697@roundup.psfhosted.org> Message-ID: <1596916373.62.0.874034618202.issue39697@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 15:52:49 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 08 Aug 2020 19:52:49 +0000 Subject: [issue39411] pyclbr rewrite using AST In-Reply-To: <1579613369.33.0.216761296366.issue39411@roundup.psfhosted.org> Message-ID: <1596916369.14.0.414527636467.issue39411@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 17:28:06 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 08 Aug 2020 21:28:06 +0000 Subject: [issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized In-Reply-To: <1592983758.49.0.230327773422.issue41097@roundup.psfhosted.org> Message-ID: <1596922086.21.0.399410428903.issue41097@roundup.psfhosted.org> Jeffrey Kintscher added the comment: The error message is found in three different locations in the source code. One is in the bytearray class, and the other two are in the BytesIO class. They are unrelated code paths. ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 18:38:29 2020 From: report at bugs.python.org (David Halter) Date: Sat, 08 Aug 2020 22:38:29 +0000 Subject: [issue41506] Inclusion or documentation of extended with syntax in 3.9 In-Reply-To: <1596850320.21.0.142080709573.issue41506@roundup.psfhosted.org> Message-ID: <1596926309.01.0.478106793213.issue41506@roundup.psfhosted.org> Change by David Halter : ---------- nosy: +davidhalter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 18:41:01 2020 From: report at bugs.python.org (David Halter) Date: Sat, 08 Aug 2020 22:41:01 +0000 Subject: [issue41506] Inclusion or documentation of extended with syntax in 3.9 In-Reply-To: <1596850320.21.0.142080709573.issue41506@roundup.psfhosted.org> Message-ID: <1596926461.7.0.429479207963.issue41506@roundup.psfhosted.org> David Halter added the comment: I second this. I just see people complaining about this not working in a lot of tools. This is really not necessary for a feature that should not be used anyway and puts work onto the greater Python ecosystem for no good reason. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 20:00:43 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sun, 09 Aug 2020 00:00:43 +0000 Subject: [issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized In-Reply-To: <1592983758.49.0.230327773422.issue41097@roundup.psfhosted.org> Message-ID: <1596931243.69.0.197441893044.issue41097@roundup.psfhosted.org> Jeffrey Kintscher added the comment: >>> import io >>> b = io.BytesIO() >>> b.write(b'abc') 3 >>> buf = b.getbuffer() >>> b.seek(0) 0 >>> b.write(b'?') Traceback (most recent call last): File "", line 1, in BufferError: Existing exports of data: object cannot be re-sized >>> The problem is caused by the b.getbuffer() call. It increments a reference counter in the BytesIO object that causes the b.write() call to fail because the counter is > 0. The error message is misleading. The counter is decremented when the buffer view is deleted. >>> import io >>> b = io.BytesIO() >>> b.write(b'abc') 3 >>> buf = b.getbuffer() >>> b.seek(0) 0 >>> b.write(b'?') Traceback (most recent call last): File "", line 1, in BufferError: Existing exports of data: object cannot be re-sized >>> del buf >>> b.write(b'?') 1 >>> b.getvalue() b'?bc' >>> The documentation for io.BytesIO.getbuffer() says "Note: As long as the view exists, the BytesIO object cannot be resized or closed." Either this is a bug, or the documentation needs to be updated to say the io.BytesIO object is unwritable while any buffer views exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 20:14:35 2020 From: report at bugs.python.org (Maciej Olko) Date: Sun, 09 Aug 2020 00:14:35 +0000 Subject: [issue41510] Mentions of pdb.set_trace() in library/functions and library/sys uncorrectly states that set_trace expects no arguments Message-ID: <1596932075.04.0.305444661582.issue41510@roundup.psfhosted.org> New submission from Maciej Olko : An argument was added to pdb.set_trace() in Python 3.7 and those fragments of documentation should have been updated: library/functions.rst:120 > By default, sys.breakpointhook() calls pdb.set_trace() expecting no arguments. library/sys.rst > For example, the default binding (e.g. pdb.set_trace()) expects no arguments, but you might bind it to a function that expects additional arguments (positional and/or keyword). ---------- assignee: docs at python components: Documentation messages: 375064 nosy: Maciej Olko, docs at python priority: normal severity: normal status: open title: Mentions of pdb.set_trace() in library/functions and library/sys uncorrectly states that set_trace expects no arguments versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 8 20:15:09 2020 From: report at bugs.python.org (Maciej Olko) Date: Sun, 09 Aug 2020 00:15:09 +0000 Subject: [issue41510] Mentions of pdb.set_trace() in library/functions and library/sys incorrectly states that set_trace expects no arguments In-Reply-To: <1596932075.04.0.305444661582.issue41510@roundup.psfhosted.org> Message-ID: <1596932109.03.0.866218083373.issue41510@roundup.psfhosted.org> Change by Maciej Olko : ---------- title: Mentions of pdb.set_trace() in library/functions and library/sys uncorrectly states that set_trace expects no arguments -> Mentions of pdb.set_trace() in library/functions and library/sys incorrectly states that set_trace expects no arguments _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 00:34:43 2020 From: report at bugs.python.org (Shubham Kumar Jha) Date: Sun, 09 Aug 2020 04:34:43 +0000 Subject: [issue41510] Mentions of pdb.set_trace() in library/functions and library/sys incorrectly states that set_trace expects no arguments In-Reply-To: <1596932075.04.0.305444661582.issue41510@roundup.psfhosted.org> Message-ID: <1596947683.82.0.0786561594675.issue41510@roundup.psfhosted.org> Shubham Kumar Jha added the comment: I am a first-time contributor, can I start working on this? ---------- nosy: +ShubhamKJha _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 02:12:38 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sun, 09 Aug 2020 06:12:38 +0000 Subject: [issue41097] confusing BufferError: Existing exports of data: object cannot be re-sized In-Reply-To: <1592983758.49.0.230327773422.issue41097@roundup.psfhosted.org> Message-ID: <1596953558.26.0.245402021457.issue41097@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- keywords: +patch pull_requests: +20931 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/21792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 06:51:20 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 09 Aug 2020 10:51:20 +0000 Subject: [issue35018] Sax parser provides no user access to lexical handlers In-Reply-To: <1539879741.38.0.788709270274.issue35018@psf.upfronthosting.co.za> Message-ID: <1596970280.06.0.693747321442.issue35018@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset e28b8c93878072dc02b116108ef5443084290d47 by Zackery Spytz in branch 'master': bpo-35018: Sax parser should provide user access to lexical handlers (GH-20958) https://github.com/python/cpython/commit/e28b8c93878072dc02b116108ef5443084290d47 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 06:52:55 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 09 Aug 2020 10:52:55 +0000 Subject: [issue35018] Sax parser provides no user access to lexical handlers In-Reply-To: <1539879741.38.0.788709270274.issue35018@psf.upfronthosting.co.za> Message-ID: <1596970375.49.0.214620312465.issue35018@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 Aug 9 07:30:55 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Aug 2020 11:30:55 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596972655.52.0.709283754381.issue40275@roundup.psfhosted.org> Terry J. Reedy added the comment: Sorry, I forgot that for the website, 3.x means 3.8, which has only 1 x_helper module. 3.9 has 3 and 3.10 has 7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 07:37:56 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Aug 2020 11:37:56 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596973076.2.0.53344730737.issue40275@roundup.psfhosted.org> Terry J. Reedy added the comment: The buildbots were fixed with PR-21785. '#' prefixes an issue on bpo, a PR on github. Confusing, especially now that PR #s are catching up to issue #s. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 08:52:36 2020 From: report at bugs.python.org (Inada Naoki) Date: Sun, 09 Aug 2020 12:52:36 +0000 Subject: [issue39102] Increase Enum performance In-Reply-To: <1576810108.88.0.911071266859.issue39102@roundup.psfhosted.org> Message-ID: <1596977556.94.0.845660822172.issue39102@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 10:35:06 2020 From: report at bugs.python.org (hai shi) Date: Sun, 09 Aug 2020 14:35:06 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1596983706.09.0.40548612068.issue40275@roundup.psfhosted.org> hai shi added the comment: # Confusing, especially now that PR #s are catching up to issue #s. Maybe we need redefine the matching rule(I am not sure about it). ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 10:37:45 2020 From: report at bugs.python.org (Claudio Canepa) Date: Sun, 09 Aug 2020 14:37:45 +0000 Subject: [issue40740] Missing api-ms-win-core-path-l1-1.0.dll for python-3.9.0b1-amd64.exe Under Win7 In-Reply-To: <1590225113.89.0.949676590632.issue40740@roundup.psfhosted.org> Message-ID: <1596983865.47.0.460532902114.issue40740@roundup.psfhosted.org> Claudio Canepa added the comment: At beta 5 the download page [0] says nothing about dropping win7 support. The installer, at least the one I tried ( python-3.9.0b5-amd64.exe ) will install on win7, and without warnings. It would be much better if it refused to install. ---------- nosy: +ccanepa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 10:38:40 2020 From: report at bugs.python.org (Claudio Canepa) Date: Sun, 09 Aug 2020 14:38:40 +0000 Subject: [issue40740] Missing api-ms-win-core-path-l1-1.0.dll for python-3.9.0b1-amd64.exe Under Win7 In-Reply-To: <1590225113.89.0.949676590632.issue40740@roundup.psfhosted.org> Message-ID: <1596983920.37.0.65265674494.issue40740@roundup.psfhosted.org> Claudio Canepa added the comment: opps, [0] https://www.python.org/downloads/release/python-390b5/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 10:49:16 2020 From: report at bugs.python.org (Claudio Canepa) Date: Sun, 09 Aug 2020 14:49:16 +0000 Subject: [issue40740] Missing api-ms-win-core-path-l1-1.0.dll for python-3.9.0b1-amd64.exe Under Win7 In-Reply-To: <1590225113.89.0.949676590632.issue40740@roundup.psfhosted.org> Message-ID: <1596984556.51.0.40945137273.issue40740@roundup.psfhosted.org> Claudio Canepa added the comment: also, no mention in https://pythondev.readthedocs.io/platforms.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 10:51:05 2020 From: report at bugs.python.org (Shubham Kumar Jha) Date: Sun, 09 Aug 2020 14:51:05 +0000 Subject: [issue41510] Mentions of pdb.set_trace() in library/functions and library/sys incorrectly states that set_trace expects no arguments In-Reply-To: <1596932075.04.0.305444661582.issue41510@roundup.psfhosted.org> Message-ID: <1596984665.7.0.354503488323.issue41510@roundup.psfhosted.org> Change by Shubham Kumar Jha : ---------- keywords: +patch pull_requests: +20932 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 11:00:32 2020 From: report at bugs.python.org (Paul Moore) Date: Sun, 09 Aug 2020 15:00:32 +0000 Subject: [issue40740] Missing api-ms-win-core-path-l1-1.0.dll for python-3.9.0b1-amd64.exe Under Win7 In-Reply-To: <1590225113.89.0.949676590632.issue40740@roundup.psfhosted.org> Message-ID: <1596985232.23.0.335727710434.issue40740@roundup.psfhosted.org> Paul Moore added the comment: https://docs.python.org/3.9/using/windows.html should probably be updated: """ As specified in PEP 11, a Python release only supports a Windows platform while Microsoft considers the platform under extended support. This means that Python 3.9 supports Windows Vista and newer. If you require Windows XP support then please install Python 3.4. """ Technically, the link to PEP 11 is sufficient, but "Python 3.9 supports Windows Vista and newer" is inaccurate. If someone wanted to submit a PR, I'm sure it would be welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 12:10:18 2020 From: report at bugs.python.org (Steve Dower) Date: Sun, 09 Aug 2020 16:10:18 +0000 Subject: [issue41501] 0x80070643, can't install any version In-Reply-To: <1596804877.84.0.108317920754.issue41501@roundup.psfhosted.org> Message-ID: <1596989418.36.0.728386523978.issue41501@roundup.psfhosted.org> Steve Dower added the comment: The Python 3.8 and 3.3 installers will not conflict at all, as they are completely different. If that is your log file, we'll also need the file in your %TEMP% directory that includes "core_JustForMe" in the name, as that's the subinstaller that's failing. Unfortunately, the error code is very generic, but the most common reason for this MSI to fail is because you've already got an install of an earlier version of 3.8 that was installed for all users (by an administrator), which the per-user installer cannot remove. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 13:02:05 2020 From: report at bugs.python.org (Tim Peters) Date: Sun, 09 Aug 2020 17:02:05 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596992525.72.0.853945798024.issue41458@roundup.psfhosted.org> Tim Peters added the comment: More extensive testing convinces me that pairing multiplication is no real help at all - the error distributions appear statistically indistinguishable from left-to-right multiplication. I believe this has to do with the "condition numbers" of fp addition and multiplication, which are poor for fp addition and good for fp multiplication. Intuitively, fp addition systematically loses mounds of information whenever two addends in different binades are added (the lower bits in the addend in the binade closer to 0 are entirely lost). But the accuracy of fp mult couldn't care which less which binades the inputs are in, provided only the result doesn't overflow or become subnormal. For "random" vectors, pairing summation tends to keep addends close together in magnitude, which is "the real" reason it helps. Left-to-right summation tends to make the difference in magnitude increase as it goes along (the running sum keeps getting bigger & bigger). So, red herring. The one thing that _can_ be done more-or-less straightforwardly and cheaply for fp mult is to prevent spurious overflow and underflow (including spurious trips into subnormal-land). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 13:43:16 2020 From: report at bugs.python.org (Yaroslav) Date: Sun, 09 Aug 2020 17:43:16 +0000 Subject: [issue41511] Pathlib parents doesn't support slicing with negative indexes Message-ID: <1596994996.9.0.794186780316.issue41511@roundup.psfhosted.org> New submission from Yaroslav : As I can see, pathlib path parents don't support slicing with negative indexes: >>> import pathlib >>> path = pathlib.PosixPath("some/very/long/path/here") >>> path.parents[-1] ... raise IndexError(idx) IndexError: -1 That's kinda weird for python. I mean, in regular list/etc if I need the last element, I'd normally do list[-1], but here to get the last parent, I need to actually know how many parents do I have. So now, I can do something like this: >>> parents_count = len(path.parents) - 1 >>> path.parents[parents_count] PosixPath('.') So that's how I can get the last parent. But is it pythonic? No. So, I decided to fix this, and now we can do negative slicing: >>> path.parents[-1] == path.parents[parents_count] True >>> path.parents[-2] == path.parents[parents_count - 1] True So what do you guys think about this? ---------- components: Library (Lib) messages: 375076 nosy: ypank priority: normal severity: normal status: open title: Pathlib parents doesn't support slicing with negative indexes type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 13:45:01 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Aug 2020 17:45:01 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1596995101.31.0.776308199524.issue41468@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +20933 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21798 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 13:54:09 2020 From: report at bugs.python.org (Roundup Robot) Date: Sun, 09 Aug 2020 17:54:09 +0000 Subject: [issue41511] Pathlib parents doesn't support slicing with negative indexes In-Reply-To: <1596994996.9.0.794186780316.issue41511@roundup.psfhosted.org> Message-ID: <1596995649.36.0.68127769448.issue41511@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +20934 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 13:56:02 2020 From: report at bugs.python.org (Yaroslav) Date: Sun, 09 Aug 2020 17:56:02 +0000 Subject: [issue41511] Pathlib parents doesn't support slicing with negative indexes In-Reply-To: <1596994996.9.0.794186780316.issue41511@roundup.psfhosted.org> Message-ID: <1596995762.31.0.37134966725.issue41511@roundup.psfhosted.org> Yaroslav added the comment: Here's opened PR: https://github.com/python/cpython/pull/21799 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 14:21:44 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 09 Aug 2020 18:21:44 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1596997304.81.0.0621827698863.issue41458@roundup.psfhosted.org> Raymond Hettinger added the comment: IIRC, both Factor and Julia use pairwise multiplication. I'm guessing that the reason is that if you have an associative-reduce higher order function, you tend to use it everywhere even in cases where the benefits are negligible ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 16:08:37 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 09 Aug 2020 20:08:37 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597003717.51.0.170326986182.issue41468@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset f2e161c27964a59bc5ab20d96f87ba5862c6222d by Terry Jan Reedy in branch 'master': bpo-41468: Improve and test IDLE run error exit (GH-21798) https://github.com/python/cpython/commit/f2e161c27964a59bc5ab20d96f87ba5862c6222d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 16:08:50 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Aug 2020 20:08:50 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597003730.96.0.385835649541.issue41468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20936 pull_request: https://github.com/python/cpython/pull/21801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 16:08:42 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Aug 2020 20:08:42 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597003722.26.0.359887159094.issue41468@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20935 pull_request: https://github.com/python/cpython/pull/21800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 16:26:40 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Aug 2020 20:26:40 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597004800.81.0.271664682258.issue41468@roundup.psfhosted.org> miss-islington added the comment: New changeset 61f23cb62d6bdd72b61fc36abf4c1492493d71af by Miss Islington (bot) in branch '3.8': bpo-41468: Improve and test IDLE run error exit (GH-21798) https://github.com/python/cpython/commit/61f23cb62d6bdd72b61fc36abf4c1492493d71af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 16:26:28 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 09 Aug 2020 20:26:28 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597004788.12.0.00204668758057.issue41468@roundup.psfhosted.org> miss-islington added the comment: New changeset a9fa66377fbd9ea2fca1483345a8c27d1b32d5b4 by Miss Islington (bot) in branch '3.9': bpo-41468: Improve and test IDLE run error exit (GH-21798) https://github.com/python/cpython/commit/a9fa66377fbd9ea2fca1483345a8c27d1b32d5b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 17:12:54 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sun, 09 Aug 2020 21:12:54 +0000 Subject: [issue41511] Pathlib parents doesn't support slicing with negative indexes In-Reply-To: <1596994996.9.0.794186780316.issue41511@roundup.psfhosted.org> Message-ID: <1597007574.21.0.235351615252.issue41511@roundup.psfhosted.org> R?mi Lapeyre added the comment: This is a duplicate of 21041, it would be better to change the title of your PR so that it points to this bug report and to continue the discussion there. ---------- nosy: +remi.lapeyre versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 17:13:09 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Sun, 09 Aug 2020 21:13:09 +0000 Subject: [issue41511] Pathlib parents doesn't support slicing with negative indexes In-Reply-To: <1596994996.9.0.794186780316.issue41511@roundup.psfhosted.org> Message-ID: <1597007589.83.0.0116155106296.issue41511@roundup.psfhosted.org> R?mi Lapeyre added the comment: *This is a duplicate of issue 21041 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 18:13:12 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sun, 09 Aug 2020 22:13:12 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1597011192.12.0.448937629289.issue26228@roundup.psfhosted.org> Soumendra Ganguly added the comment: Hi! Can anyone please take a look at https://bugs.python.org/issue41494 [ https://github.com/python/cpython/pull/21752 ]? I think these are related. I wrote a new function called wspawn, which is like spawn+the following differences. 1. It sets window size at the beginning. 2. It registers a SIGWINCH handler. 3. It does not depend on OSError to return. It does a clean return instead. ---------- nosy: +soumendra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 18:13:49 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sun, 09 Aug 2020 22:13:49 +0000 Subject: [issue29070] Integration tests for pty.spawn on Linux and all other platforms In-Reply-To: <1482684225.17.0.467768789806.issue29070@psf.upfronthosting.co.za> Message-ID: <1597011229.55.0.0707726405249.issue29070@roundup.psfhosted.org> Soumendra Ganguly added the comment: Hi! Can anyone please take a look at https://bugs.python.org/issue41494 [ https://github.com/python/cpython/pull/21752 ]? I think these are related. I wrote a new function called wspawn, which is like spawn+the following differences. 1. It sets window size at the beginning. 2. It registers a SIGWINCH handler. 3. It does not depend on OSError to return. It does a clean return instead. ---------- nosy: +soumendra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 18:29:21 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sun, 09 Aug 2020 22:29:21 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py [ SIGWINCH ] In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1597012161.17.0.653300594717.issue41494@roundup.psfhosted.org> Soumendra Ganguly added the comment: Possibly related issues: https://bugs.python.org/issue29070 https://bugs.python.org/issue26228 Since wspawn does not depend on OSError, it might be a possible [ not necessarily the only way ] of solving the above issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 19:08:48 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 09 Aug 2020 23:08:48 +0000 Subject: [issue40860] Exception in multiprocessing/context.py under load In-Reply-To: <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org> Message-ID: <1597014528.26.0.898694035673.issue40860@roundup.psfhosted.org> Irit Katriel added the comment: The source code for the Process class is here: https://github.com/python/cpython/blob/master/Lib/multiprocessing/process.py You can see that join and start both modify the global, non thread safe _children set. I'm guessing this is where you're seeing interference between threads. I'm not sure a lock on start is enough - I think you need to get the lock for the join_process(job, deadline) call as well, because join can modify _children too. (Or, alternatively, manage all processes from a single thread.) ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 20:41:09 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 00:41:09 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597020069.01.0.594196015478.issue41468@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 20:51:11 2020 From: report at bugs.python.org (evaldas) Date: Mon, 10 Aug 2020 00:51:11 +0000 Subject: [issue41512] Microsoft Store app IDLE (Python 3.8.5) cannot save files Message-ID: <1597020671.06.0.0667003578842.issue41512@roundup.psfhosted.org> New submission from evaldas : OS: x64 Windows 10 Professional 1903 Python: Python 3.8 package (3.8.5) installed from Microsoft Store Steps to reproduce the bug: 1. Create empty file (right click anywhere, "New" -> "Text document", rename to "insert_filename_here.py"). File size is 0 bytes. 2. Open the file in IDLE 3. Type "import os" (actually content could be anything). IDLE title bar changes by prepending asterisk (*) to the filename, indicating file is modified but not saved yet. 4a. Press Ctrl+S --> nothing happens 4b. Click "File" -> "Save" --> nothing happens 4c. Click "File" -> "Close". Dialog pops-up "Do you want to save insert_filename_here.py before closing?", click "Yes" --> nothing happens Tested on 2 machines, same behavior. If file has some previuos content, sometimes saving in IDLE works (not always). ---------- assignee: terry.reedy components: IDLE messages: 375088 nosy: evaldas, terry.reedy priority: normal severity: normal status: open title: Microsoft Store app IDLE (Python 3.8.5) cannot save files versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 20:57:47 2020 From: report at bugs.python.org (evaldas) Date: Mon, 10 Aug 2020 00:57:47 +0000 Subject: [issue41512] Microsoft Store app IDLE (Python 3.8.5) cannot save files In-Reply-To: <1597020671.06.0.0667003578842.issue41512@roundup.psfhosted.org> Message-ID: <1597021067.74.0.464705197277.issue41512@roundup.psfhosted.org> Change by evaldas : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 21:14:14 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 01:14:14 +0000 Subject: [issue41513] Scale by power of two in math.hypot() Message-ID: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> New submission from Raymond Hettinger : I'd like to resurrect Serhiy's idea for using power-of-two scaling in math.hypot() rather than dividing each coordinate by the maximum value. I drafted a patch. It looks to be a little faster than what we have now and is generally (but not always) more accurate. For accuracy, the current approach has the advantage that for the largest coordinate, (x/max)**2 is exactly 1.0. If that element is much larger than the others, it overpowers the 1/2 ulp error in each of the other divisions. In contrast, scaling by a power of two is always exact, but the squaring of the largest scaled coordinate is no longer exact. The two approaches each have some cases that are more accurate than the other. I generated 10,000 samples. In 66% of the cases, the two results agree. In 26% of the cases, scaling by a power of two was more accurate. In the remaining 8%, the division by max was more accurate. The standard deviation of relative errors was better using power-of-two scaling. These results were consistent whether using 2, 3, or 20 dimensions. As expected, multiplying by a power of two was a bit faster than dividing by an arbitrary float. ---------- components: Library (Lib) messages: 375089 nosy: mark.dickinson, rhettinger, serhiy.storchaka, tim.peters priority: low severity: normal status: open title: Scale by power of two in math.hypot() type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 21:19:50 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 01:19:50 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597022390.58.0.563183488833.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +20937 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 21:25:54 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 01:25:54 +0000 Subject: [issue41512] Microsoft Store app IDLE (Python 3.8.5) cannot save files In-Reply-To: <1597020671.06.0.0667003578842.issue41512@roundup.psfhosted.org> Message-ID: <1597022754.4.0.0412037253147.issue41512@roundup.psfhosted.org> Terry J. Reedy added the comment: Already fixed, will be in 3.9.0rc1 (tomorrow) and 3.8.6 (Sept). In meanwhile, create new files within IDLE with File => New. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> IDLE: edit/save files created by Windows Explorer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 21:29:50 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 01:29:50 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597022990.06.0.779390491862.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49378/test_hypot.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 22:11:01 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 10 Aug 2020 02:11:01 +0000 Subject: [issue41458] Avoid overflow/underflow in math.prod() In-Reply-To: <1596398598.74.0.852327933948.issue41458@roundup.psfhosted.org> Message-ID: <1597025461.98.0.775435665993.issue41458@roundup.psfhosted.org> Tim Peters added the comment: Or, like I did, they succumbed to an untested "seemingly plausible" illusion ;-) I generated 1,000 random vectors (in [0.0, 10.0)) of length 100, and for each generated 10,000 permutations. So that's 10 million 100-element products overall. The convert-to-decimal method was 100% insensitive to permutations, generating the same product (default decimal prec result rounded to float) for each of the 10,000 permutations all 1,000 times. The distributions of errors for the left-to-right and pairing products were truly indistinguishable. They ranged from -20 to +20 ulp (taking the decimal result as being correct). When I plotted them on the same graph, I thought I had made an error, because I couldn't see _any_ difference on a 32-inch monitor! I only saw a single curve. At each ulp the counts almost always rounded to the same pixel on the monitor, so the color of the second curve plotted almost utterly overwrote the first curve. As a sanity check, on the same vectors using the same driver code I compared sum() to a pairing sum. Pairing sum was dramatically better, with a much tighter error distribution with a much higher peak at the center ("no error"). That's what I erroneously expected to see for products too - although, in hindsight, I can't imagine why ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 9 23:04:08 2020 From: report at bugs.python.org (Arkady) Date: Mon, 10 Aug 2020 03:04:08 +0000 Subject: [issue40860] Exception in multiprocessing/context.py under load In-Reply-To: <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org> Message-ID: <1597028648.52.0.236081521287.issue40860@roundup.psfhosted.org> Arkady added the comment: I have switched to os.fork() I am doing something like this https://gist.github.com/larytet/3ca9f9a32b1dc089a24cb7011455141f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:13:11 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 Aug 2020 04:13:11 +0000 Subject: [issue41511] Pathlib parents doesn't support slicing with negative indexes In-Reply-To: <1596994996.9.0.794186780316.issue41511@roundup.psfhosted.org> Message-ID: <1597032791.05.0.283573574519.issue41511@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Closing it as duplicate of issue21041. Thanks Remi. Yaroslav, feel free to discuss it in the other issue. ---------- nosy: +xtreak resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> pathlib.PurePath.parents rejects negative indexes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:41:32 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 04:41:32 +0000 Subject: [issue27477] IDLE: Switch search dialogs to ttk widgets, and other refinement In-Reply-To: <1468181977.57.0.555586182066.issue27477@psf.upfronthosting.co.za> Message-ID: <1597034492.71.0.419322801982.issue27477@roundup.psfhosted.org> Terry J. Reedy added the comment: 5.0 History list? 1 for all boxes; start fresh each session ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:50:34 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 04:50:34 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597035034.81.0.801627678493.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Removed file: https://bugs.python.org/file49378/test_hypot.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:52:35 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 04:52:35 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597035155.91.0.816342233186.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Added a revised script for testing accuracy measured in ULPs. ---------- Added file: https://bugs.python.org/file49379/test_hypot.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:54:42 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 04:54:42 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597035282.46.0.990795018989.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Removed file: https://bugs.python.org/file49379/test_hypot.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:54:54 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 04:54:54 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597035294.36.0.405495217918.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49380/test_hypot.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 00:55:56 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 04:55:56 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597035356.88.0.894213880981.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg375095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 01:00:15 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 10 Aug 2020 05:00:15 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597035615.11.0.593280743211.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Added a revised script for testing accuracy measured in ULPs. It shows an improvement for all dimensions tested, with the best for 2 dimensions. Also, the maximum error is now 1 ulp; formerly, it was 2 ulps. ======== 2 dimensions ======== div-by-max: [(-2.0, 14), (-1.0, 1721), (0.0, 6533), (1.0, 1722), (2.0, 10)] scaled-by-2: [(-1.0, 841), (0.0, 8339), (1.0, 820)] ======== 3 dimensions ======== div-by-max: [(-2.0, 3), (-1.0, 1525), (0.0, 6933), (1.0, 1535), (2.0, 4)] scaled-by-2: [(-1.0, 739), (0.0, 8515), (1.0, 746)] ======== 5 dimensions ======== div-by-max: [(-2.0, 2), (-1.0, 1377), (0.0, 7263), (1.0, 1358)] scaled-by-2: [(-1.0, 695), (0.0, 8607), (1.0, 698)] ======== 10 dimensions ======== div-by-max: [(-2.0, 13), (-1.0, 1520), (0.0, 6873), (1.0, 1580), (2.0, 14)] scaled-by-2: [(-1.0, 692), (0.0, 8605), (1.0, 703)] ======== 20 dimensions ======== div-by-max: [(-1.0, 1285), (0.0, 7310), (1.0, 1405)] scaled-by-2: [(-1.0, 555), (0.0, 8822), (1.0, 623)] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 02:00:28 2020 From: report at bugs.python.org (Arcadiy Ivanov) Date: Mon, 10 Aug 2020 06:00:28 +0000 Subject: [issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval In-Reply-To: <1594319150.59.0.418042347071.issue41261@roundup.psfhosted.org> Message-ID: <1597039228.05.0.0630146207962.issue41261@roundup.psfhosted.org> Arcadiy Ivanov added the comment: >From what I understand an RC1 is being released for 3.9. This is a gentle reminder that there is no fix for this yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 02:15:00 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 Aug 2020 06:15:00 +0000 Subject: [issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval In-Reply-To: <1594319150.59.0.418042347071.issue41261@roundup.psfhosted.org> Message-ID: <1597040100.17.0.98004640751.issue41261@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 02:25:20 2020 From: report at bugs.python.org (Pauser) Date: Mon, 10 Aug 2020 06:25:20 +0000 Subject: [issue41500] InterpolationSyntaxError reading the (windows) environment with unresolved environment variables In-Reply-To: <1596798623.9.0.767951694174.issue41500@roundup.psfhosted.org> Message-ID: <1597040720.45.0.580704645955.issue41500@roundup.psfhosted.org> Pauser added the comment: Thanks a lot for the fast response ... did not expect this ;) I have looked into many threads and I will try to implement my own interpolation to use the current basic interpolation and process the current environment. So thanks a lot, stay healthy and have a nice day! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 03:25:09 2020 From: report at bugs.python.org (Yaroslav Pankovych) Date: Mon, 10 Aug 2020 07:25:09 +0000 Subject: [issue21041] pathlib.PurePath.parents rejects negative indexes In-Reply-To: <1395613011.22.0.29152070109.issue21041@psf.upfronthosting.co.za> Message-ID: <1597044309.46.0.58967223426.issue21041@roundup.psfhosted.org> Yaroslav Pankovych added the comment: That's kinda weird for python. I mean, in regular list/etc if I need the last element, I'd normally do list[-1], but here to get the last parent, I need to actually know how many parents do I have. So now, I can do something like this: >>> parents_count = len(path.parents) - 1 >>> path.parents[parents_count] PosixPath('.') ---------- message_count: 16.0 -> 17.0 nosy: +ypank nosy_count: 10.0 -> 11.0 pull_requests: +20938 stage: -> patch review versions: +Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.9 pull_request: https://github.com/python/cpython/pull/21799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 03:25:43 2020 From: report at bugs.python.org (Yaroslav Pankovych) Date: Mon, 10 Aug 2020 07:25:43 +0000 Subject: [issue21041] pathlib.PurePath.parents rejects negative indexes In-Reply-To: <1395613011.22.0.29152070109.issue21041@psf.upfronthosting.co.za> Message-ID: <1597044343.46.0.737871372642.issue21041@roundup.psfhosted.org> Yaroslav Pankovych added the comment: Here's possible fix: https://github.com/python/cpython/pull/21799 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 04:38:14 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 Aug 2020 08:38:14 +0000 Subject: [issue40185] Refactor typing.NamedTuple In-Reply-To: <1586034525.17.0.360408189871.issue40185@roundup.psfhosted.org> Message-ID: <1597048694.8.0.655500821688.issue40185@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to have caused a test failure in astroid project. I am not sure if the fix needs to be done from their end probably relying on some implementation detail or from the patch itself. Feel free to ignore if it's a third-party only error. Reproducer script : /tmp/namedtuple_astroid.py from astroid import parse mod = parse('''from typing import NamedTuple; NamedTuple("A")''') print(str(next(mod.body[-1].value.infer()))) assert str(next(mod.body[-1].value.infer())) != 'Uninferable' Before this commit : python /tmp/namedtuple_astroid.py Instance of typing.NamedTuple After this commit : python /tmp/namedtuple_astroid.py Uninferable Traceback (most recent call last): File "/tmp/namedtuple_astroid.py", line 4, in assert str(next(mod.body[-1].value.infer())) != 'Uninferable' AssertionError ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 04:44:05 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Aug 2020 08:44:05 +0000 Subject: [issue40860] Exception in multiprocessing/context.py under load In-Reply-To: <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org> Message-ID: <1597049045.09.0.201508900673.issue40860@roundup.psfhosted.org> Irit Katriel added the comment: There is an open ticket to improve documentation of thread safety of the multiprocessing module module: https://bugs.python.org/issue40815 Is there anything remaining to do on this ticket? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 04:45:09 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 10 Aug 2020 08:45:09 +0000 Subject: [issue40815] Multiprocessing docs don't describe thread-safety In-Reply-To: <1590758700.82.0.757809403714.issue40815@roundup.psfhosted.org> Message-ID: <1597049109.27.0.292431896858.issue40815@roundup.psfhosted.org> Irit Katriel added the comment: Here's an example where such documentation may have helped: https://bugs.python.org/issue40860 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 05:04:14 2020 From: report at bugs.python.org (Arkady) Date: Mon, 10 Aug 2020 09:04:14 +0000 Subject: [issue40860] Exception in multiprocessing/context.py under load In-Reply-To: <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org> Message-ID: <1597050254.44.0.0431652517789.issue40860@roundup.psfhosted.org> Arkady added the comment: "documentation of thread safety" I find it surprising that a module called "multiprocessing" has not a thread safe API. If this is inevitable, I guess that's the life. I expect nothing less that a bold bright red font at the top of the document page. Protecting a call to join() with a mutex would impact latency of the API: the slowest subprocess can win the race. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 05:37:33 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 10 Aug 2020 09:37:33 +0000 Subject: [issue40185] Refactor typing.NamedTuple In-Reply-To: <1586034525.17.0.360408189871.issue40185@roundup.psfhosted.org> Message-ID: <1597052253.54.0.383520902416.issue40185@roundup.psfhosted.org> Serhiy Storchaka added the comment: $ echo 'from typing import NamedTuple; NamedTuple("A")' | ./python -m ast Module( body=[ ImportFrom( module='typing', names=[ alias(name='NamedTuple')], level=0), Expr( value=Call( func=Name(id='NamedTuple', ctx=Load()), args=[ Constant(value='A')], keywords=[]))], type_ignores=[]) So mod.body[-1].value is a call: Call(func=Name(id='NamedTuple', ctx=Load()), args=[Constant(value='A')], keywords=[]) I do not know what Astroid does with this node, but seem the problem is in its infer() method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 08:02:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 12:02:17 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 Message-ID: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/597/builds/178 test_error (idlelib.idle_test.test_run.HandleErrorTest) ... FAIL (...) ====================================================================== FAIL: test_error (idlelib.idle_test.test_run.HandleErrorTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.8.cstratak-RHEL8-aarch64.refleak/build/Lib/unittest/mock.py", line 1325, in patched return func(*newargs, **newkeywargs) File "/home/buildbot/buildarea/3.8.cstratak-RHEL8-aarch64.refleak/build/Lib/idlelib/idle_test/test_run.py", line 352, in test_error eq(self.func.called, 2) AssertionError: 4 != 2 I can reproduce the issue on 3.8, 3.9 and master branches: 14:00:18 vstinner at apu$ ./python -m test -m test_error -v test_idle test_idle == CPython 3.8.5+ (heads/3.8:61f23cb62d, Aug 10 2020, 14:00:04) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] == Linux-5.7.11-200.fc32.x86_64-x86_64-with-glibc2.29 little-endian == cwd: /home/vstinner/python/3.8/build/test_python_43858 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.68 Run tests sequentially 0:00:00 load avg: 1.68 [1/2] test_idle test_error (idlelib.idle_test.test_run.HandleErrorTest) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.004s OK 0:00:00 load avg: 1.68 [2/2] test_idle test_error (idlelib.idle_test.test_run.HandleErrorTest) ... FAIL ====================================================================== FAIL: test_error (idlelib.idle_test.test_run.HandleErrorTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/3.8/Lib/unittest/mock.py", line 1325, in patched return func(*newargs, **newkeywargs) File "/home/vstinner/python/3.8/Lib/idlelib/idle_test/test_run.py", line 352, in test_error eq(self.func.called, 2) AssertionError: 4 != 2 ---------------------------------------------------------------------- Ran 1 test in 0.007s FAILED (failures=1) test test_idle failed test_idle failed == Tests result: FAILURE == 1 test OK. 1 test failed: test_idle Total duration: 722 ms Tests result: FAILURE It seems like the test was added recently: commit f2e161c27964a59bc5ab20d96f87ba5862c6222d Author: Terry Jan Reedy Date: Sun Aug 9 16:08:30 2020 -0400 bpo-41468: Improve and test IDLE run error exit (GH-21798) A message box pops up when an unexpected error stops the run process. Tell users it is likely a random glitch, but report it if not. ---------- assignee: terry.reedy components: IDLE, Tests messages: 375106 nosy: terry.reedy, vstinner priority: normal severity: normal status: open title: test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 08:02:57 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 12:02:57 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597060977.21.0.374803212057.issue41468@roundup.psfhosted.org> STINNER Victor added the comment: test_error() of test_idle fails when it's run twice in a row: bpo-41514 "test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 08:57:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 12:57:35 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1597064255.24.0.981290595043.issue26228@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:08:26 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 13:08:26 +0000 Subject: [issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once In-Reply-To: <1593682119.68.0.42848291784.issue41194@roundup.psfhosted.org> Message-ID: <1597064906.09.0.529009898508.issue41194@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20939 pull_request: https://github.com/python/cpython/pull/21807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:10:32 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 13:10:32 +0000 Subject: [issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval In-Reply-To: <1594319150.59.0.418042347071.issue41261@roundup.psfhosted.org> Message-ID: <1597065032.88.0.120050304004.issue41261@roundup.psfhosted.org> STINNER Victor added the comment: > From what I understand an RC1 is being released for 3.9. This is a gentle reminder that there is no fix for this yet. I wrote PR 21807 to backport my changes from master to 3.9. My PR fix a crash on 3.9 with the following script: --- import sys PyCF_ONLY_AST = 1024 tree = compile("x+y", "filename", "exec", PyCF_ONLY_AST) import _ast assert PyCF_ONLY_AST == _ast.PyCF_ONLY_AST compile(tree, "filename", "exec") del sys.modules['_ast'] import _ast compile(tree, "filename", "exec") --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:17:32 2020 From: report at bugs.python.org (david.six) Date: Mon, 10 Aug 2020 13:17:32 +0000 Subject: [issue18140] urlparse, urlsplit confused when password includes fragment (#), query (?) In-Reply-To: <1370425503.35.0.436511643169.issue18140@psf.upfronthosting.co.za> Message-ID: <1597065452.82.0.867791381068.issue18140@roundup.psfhosted.org> david.six added the comment: tl;dr: '#', '?' and a few other characters should be URL-encoded/%-encoded when they appear in userinfo which will already parse correctly. --- Following up on what Martin said, RFC 3986 has the specifications for how these examples should be parsed. userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" pct-encoded = "%" HEXDIG HEXDIG sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" Notably, gen-delims are _not_ included in the allowed characters, nor are non-ASCII characters. gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" These and other characters not mentioned should be URL-encoded/%-encoded if they appear in the password. Taking the first example: >>> from urllib.parse import urlparse >>> u = 'http://auser:secr%23et at 192.168.0.1:8080/a/b/c.html' >>> urlparse(u) ParseResult(scheme='http', netloc='auser:secr%23et at 192.168.0.1:8080', path='/a/b/c.html', params='', query='', fragment='') >>> unquote(urlparse(u).password) 'secr#et' ---------- nosy: +david.six status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:23:18 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 13:23:18 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597065798.65.0.572202025632.issue41514@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +20940 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:35:59 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 13:35:59 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597066559.23.0.644995098493.issue41514@roundup.psfhosted.org> Terry J. Reedy added the comment: Your reproducer worked to reproduce the bug for me, make the cause obvious, and test the fix. ?ukasz, it would be good if this test fix made it into the release candidate, but probably not essential as not too many people will check it for refleaks. ---------- nosy: +lukasz.langa type: -> behavior versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:44:03 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 13:44:03 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597067043.49.0.527069751786.issue41514@roundup.psfhosted.org> miss-islington added the comment: New changeset 416f0b71ba84fe83ee2ba4399b8a28712702980b by Terry Jan Reedy in branch 'master': bpo-41514: Fix buggy IDLE test (GH-21808) https://github.com/python/cpython/commit/416f0b71ba84fe83ee2ba4399b8a28712702980b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:44:25 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 13:44:25 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597067065.14.0.347100333447.issue41514@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20941 pull_request: https://github.com/python/cpython/pull/21809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:43:58 2020 From: report at bugs.python.org (Eric Fahlgren) Date: Mon, 10 Aug 2020 13:43:58 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError Message-ID: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> New submission from Eric Fahlgren : Windows 10 Pro 64 Python 3.8.3 64 wxPython 4.1.0 It appears that there are synthetic classes in the mro, which don't appear in the type's namespace, raising KeyError when encountered. From reading the function's doc and source, it looks like it should handle this internally and return a valid dict (possibly empty), and not raise KeyError. >>> import typing, wx >>> typing.get_type_hints(wx.Window)' Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python38\lib\typing.py", line 1223, in get_type_hints base_globals = sys.modules[base.__module__].__dict__ >>> wx.Window.mro() [, , , , , , , ] KeyError: 'sip' ---------- components: Library (Lib) messages: 375111 nosy: eric.fahlgren priority: normal severity: normal status: open title: typing.get_type_hints generates KeyError versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:44:33 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 13:44:33 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597067073.75.0.0163640164349.issue41514@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20942 pull_request: https://github.com/python/cpython/pull/21810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:55:47 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 13:55:47 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1596495799.45.0.151372385389.issue41468@roundup.psfhosted.org> Message-ID: <1597067747.2.0.8171278585.issue41468@roundup.psfhosted.org> Terry J. Reedy added the comment: Test error fixed on issue 41514. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:56:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 13:56:35 +0000 Subject: [issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once In-Reply-To: <1593682119.68.0.42848291784.issue41194@roundup.psfhosted.org> Message-ID: <1597067795.82.0.274399988177.issue41194@roundup.psfhosted.org> STINNER Victor added the comment: > Ok, then. I'll open a new bug. bpo-41261: "3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:56:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 13:56:02 +0000 Subject: [issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once In-Reply-To: <1593682119.68.0.42848291784.issue41194@roundup.psfhosted.org> Message-ID: <1597067762.07.0.70299641248.issue41194@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d2bea2636d5f0c2b196966315790af8e79c7bf82 by Victor Stinner in branch '3.9': [3.9] bpo-41194: Convert _ast extension to PEP 489 (GH-21807) https://github.com/python/cpython/commit/d2bea2636d5f0c2b196966315790af8e79c7bf82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:56:28 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 13:56:28 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597067788.02.0.590762291663.issue41514@roundup.psfhosted.org> Terry J. Reedy added the comment: issue 41514 added the new test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:56:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 13:56:02 +0000 Subject: [issue41204] Use of unitialized variable `fields` along error path in code generated from asdl_c.py In-Reply-To: <1593812820.7.0.967275410849.issue41204@roundup.psfhosted.org> Message-ID: <1597067762.17.0.0522327347092.issue41204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d2bea2636d5f0c2b196966315790af8e79c7bf82 by Victor Stinner in branch '3.9': [3.9] bpo-41194: Convert _ast extension to PEP 489 (GH-21807) https://github.com/python/cpython/commit/d2bea2636d5f0c2b196966315790af8e79c7bf82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 09:57:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 13:57:11 +0000 Subject: [issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval In-Reply-To: <1594319150.59.0.418042347071.issue41261@roundup.psfhosted.org> Message-ID: <1597067831.21.0.176508469651.issue41261@roundup.psfhosted.org> STINNER Victor added the comment: This bug should be fixed by: New changeset d2bea2636d5f0c2b196966315790af8e79c7bf82 by Victor Stinner in branch '3.9': [3.9] bpo-41194: Convert _ast extension to PEP 489 (GH-21807) https://github.com/python/cpython/commit/d2bea2636d5f0c2b196966315790af8e79c7bf82 I remove the "release blocker" priority. ---------- priority: release blocker -> resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:01:25 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 14:01:25 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597068085.6.0.655930850751.issue41514@roundup.psfhosted.org> miss-islington added the comment: New changeset 860bc0ea70c365825bfd9b7de7685cf6842ca3c7 by Miss Islington (bot) in branch '3.8': bpo-41514: Fix buggy IDLE test (GH-21808) https://github.com/python/cpython/commit/860bc0ea70c365825bfd9b7de7685cf6842ca3c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:05:09 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 14:05:09 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597068309.98.0.641771001084.issue41514@roundup.psfhosted.org> miss-islington added the comment: New changeset 9c253f4bc9dbf711dce3fffeaef86179c29fa0f5 by Miss Islington (bot) in branch '3.9': bpo-41514: Fix buggy IDLE test (GH-21808) https://github.com/python/cpython/commit/9c253f4bc9dbf711dce3fffeaef86179c29fa0f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:29:27 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 Aug 2020 14:29:27 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1597069767.94.0.732858793406.issue41515@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:32:29 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 10 Aug 2020 14:32:29 +0000 Subject: [issue41324] Add a minimal decimal capsule API In-Reply-To: <1594984713.74.0.721782226907.issue41324@roundup.psfhosted.org> Message-ID: <1597069949.08.0.0899882359152.issue41324@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 39042e00ab01d6521548c1b7cc6554c09f4389ff by Stefan Krah in branch 'master': bpo-41324 Add a minimal decimal capsule API (#21519) https://github.com/python/cpython/commit/39042e00ab01d6521548c1b7cc6554c09f4389ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:34:29 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 10 Aug 2020 14:34:29 +0000 Subject: [issue41324] Add a minimal decimal capsule API In-Reply-To: <1594984713.74.0.721782226907.issue41324@roundup.psfhosted.org> Message-ID: <1597070069.79.0.988795848707.issue41324@roundup.psfhosted.org> Change by Stefan Krah : ---------- components: +C API -Extension Modules resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:42:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 14:42:25 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597070545.6.0.706260549776.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: test__osx_support and test_selectors are broken, examples: https://github.com/python/cpython/pull/21806/checks?check_run_id=966438645 2020-08-10T12:04:20.7613070Z ====================================================================== 2020-08-10T12:04:20.7613710Z ERROR: test__remove_unsupported_archs (test.test__osx_support.Test_OSXSupport) 2020-08-10T12:04:20.7616560Z ---------------------------------------------------------------------- 2020-08-10T12:04:20.7617240Z Traceback (most recent call last): 2020-08-10T12:04:20.7617860Z File "/Users/runner/work/cpython/cpython/Lib/test/test__osx_support.py", line 23, in setUp 2020-08-10T12:04:20.7618560Z self.env = test.support.EnvironmentVarGuard() 2020-08-10T12:04:20.7621650Z AttributeError: module 'test.support' has no attribute 'EnvironmentVarGuard' and 2020-08-10T12:01:40.0736200Z ====================================================================== 2020-08-10T12:01:40.0738440Z ERROR: test_register_bad_fd (test.test_selectors.KqueueSelectorTestCase) 2020-08-10T12:01:40.0742700Z ---------------------------------------------------------------------- 2020-08-10T12:01:40.0744640Z Traceback (most recent call last): 2020-08-10T12:01:40.0747460Z File "/Users/runner/work/cpython/cpython/Lib/test/test_selectors.py", line 539, in test_register_bad_fd 2020-08-10T12:01:40.0753630Z bad_f = support.make_bad_fd() 2020-08-10T12:01:40.0757650Z AttributeError: module 'test.support' has no attribute 'make_bad_fd' Hai Shi: Would you mind to investigate this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:48:28 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 14:48:28 +0000 Subject: [issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached) In-Reply-To: <1358533279.94.0.666576182033.issue16995@psf.upfronthosting.co.za> Message-ID: <1597070908.23.0.462964107014.issue16995@roundup.psfhosted.org> miss-islington added the comment: New changeset 4ce6faa6c9591de6079347eccc9e61ae4e8d9e31 by Filipe La?ns in branch 'master': bpo-16995: add support for base32 extended hex (base32hex) (GH-20441) https://github.com/python/cpython/commit/4ce6faa6c9591de6079347eccc9e61ae4e8d9e31 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 10:52:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 14:52:30 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597071150.48.0.378579819214.issue40548@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20943 pull_request: https://github.com/python/cpython/pull/21806 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 11:47:12 2020 From: report at bugs.python.org (hai shi) Date: Mon, 10 Aug 2020 15:47:12 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597074432.42.0.884629215698.issue40275@roundup.psfhosted.org> hai shi added the comment: > Hai Shi: Would you mind to investigate this issue? Oh, sure, I will check the test cases again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 11:52:50 2020 From: report at bugs.python.org (D. A. Pellegrino) Date: Mon, 10 Aug 2020 15:52:50 +0000 Subject: [issue41516] venv activate scripts do not pass ShellCheck Message-ID: <1597074770.49.0.0492267082511.issue41516@roundup.psfhosted.org> New submission from D. A. Pellegrino : The activate scripts created by the venv module do not pass checks by ShellCheck (https://www.shellcheck.net/). ShellCheck generally has a point for each warning and note generated against the venv activate scripts. Addressing the ShellCheck reports would align the activate script implementation with best practices. ---------- components: Extension Modules messages: 375125 nosy: user93448 priority: normal severity: normal status: open title: venv activate scripts do not pass ShellCheck type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 11:55:46 2020 From: report at bugs.python.org (D. A. Pellegrino) Date: Mon, 10 Aug 2020 15:55:46 +0000 Subject: [issue37873] unittest: execute tests in parallel In-Reply-To: <1565964928.02.0.804836557192.issue37873@roundup.psfhosted.org> Message-ID: <1597074946.36.0.715132949206.issue37873@roundup.psfhosted.org> D. A. Pellegrino added the comment: Leveraging GNU Parallel (https://www.gnu.org/software/parallel/) might help simplify implementation. Perhaps that could be used as a subprocess call? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 11:56:16 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 10 Aug 2020 15:56:16 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1597074976.84.0.748901172524.issue41515@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, the fix would seem simple enough. Can you submit a PR? It would be nice if it had a test as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 12:02:28 2020 From: report at bugs.python.org (hai shi) Date: Mon, 10 Aug 2020 16:02:28 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597075348.22.0.158638470791.issue40275@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +20944 pull_request: https://github.com/python/cpython/pull/21811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 12:10:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 16:10:33 +0000 Subject: [issue37873] unittest: execute tests in parallel In-Reply-To: <1565964928.02.0.804836557192.issue37873@roundup.psfhosted.org> Message-ID: <1597075833.47.0.7199373532.issue37873@roundup.psfhosted.org> STINNER Victor added the comment: > Leveraging GNU Parallel (https://www.gnu.org/software/parallel/) might help simplify implementation. Perhaps that could be used as a subprocess call? In general, we attempt to avoid depending on the availability of external tool. For example, I don't expect this tool to be available on Windows, whereas it would be better to support parallel execution on Windows as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 12:37:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 16:37:07 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597077427.03.0.206581266768.issue40548@roundup.psfhosted.org> STINNER Victor added the comment: New changeset eaa551702d80fd67219c48ee6a13ffb571ca360b by Victor Stinner in branch 'master': bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806) https://github.com/python/cpython/commit/eaa551702d80fd67219c48ee6a13ffb571ca360b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 12:38:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 16:38:42 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597077522.37.0.206627777585.issue40548@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20945 pull_request: https://github.com/python/cpython/pull/21812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 12:50:28 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 16:50:28 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597078228.43.0.577809869171.issue40548@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20947 pull_request: https://github.com/python/cpython/pull/21814 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 12:50:17 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 16:50:17 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597078217.11.0.747930990036.issue40548@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20946 pull_request: https://github.com/python/cpython/pull/21813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 13:01:19 2020 From: report at bugs.python.org (James Franks) Date: Mon, 10 Aug 2020 17:01:19 +0000 Subject: [issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs In-Reply-To: <1588884932.92.0.367303002443.issue40553@roundup.psfhosted.org> Message-ID: <1597078879.22.0.722421454112.issue40553@roundup.psfhosted.org> James Franks added the comment: Hope this helps: I'm running Python Shell 3.8.5 on MacOSx 10.15.6 (Catalina). I can reproduce this hang easily. Open any existing module or create a new one. Can save the existing module or a new one just fine under the same name. (File menu - Save) Using "Save as..." from File dropdown menu, Windows appears, change the name, hit Save button and IDLE hangs. After approximately a minute the window becomes active again, but when hitting any button (Cancel or Save) it hangs again. No way to get out of this but force quit IDLE. My files are in iCloud documents folder. Did the same test with a Mac running Mojave (10.14.6) Also with Python Shell 3.8.5. Works fine. Seems to be something with Catalina as some have mentioned. Please help. This is extremely frustrating for someone like me just trying to learn Python. I will switch over to the machine running Mojave. Thanks for helping! ---------- nosy: +franksj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 13:06:19 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 17:06:19 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597079179.46.0.0640827488909.issue40548@roundup.psfhosted.org> miss-islington added the comment: New changeset 09d82609be3d4903104610ed918caeefb953f79a by Miss Islington (bot) in branch '3.8': bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806) https://github.com/python/cpython/commit/09d82609be3d4903104610ed918caeefb953f79a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 13:09:45 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 10 Aug 2020 17:09:45 +0000 Subject: [issue40548] Always run GitHub action jobs, even on documentation-only jobs In-Reply-To: <1588873177.1.0.956855864504.issue40548@roundup.psfhosted.org> Message-ID: <1597079385.69.0.523110408335.issue40548@roundup.psfhosted.org> miss-islington added the comment: New changeset 2cd58d8bb15c1afaeef59106941d6db697074ce8 by Miss Islington (bot) in branch '3.9': bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806) https://github.com/python/cpython/commit/2cd58d8bb15c1afaeef59106941d6db697074ce8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 13:47:58 2020 From: report at bugs.python.org (Tal Suhareanu) Date: Mon, 10 Aug 2020 17:47:58 +0000 Subject: [issue41517] Enum multiple inheritance loophole Message-ID: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> New submission from Tal Suhareanu : when inheriting an implemented enum, we get a runtime error But when creating a multiple inheritance like the following, it works? so something feels broken in the enum mechanism ------------------------------------ from enum import IntEnum, Enum class A(IntEnum): a = 1 class B(A, Enum): b= 1 print(B.b) ------------------------------------ ---------- components: Library (Lib) messages: 375133 nosy: talsuk5 priority: normal severity: normal status: open title: Enum multiple inheritance loophole type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 14:09:56 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 10 Aug 2020 18:09:56 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597082996.7.0.920121000845.issue41517@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +barry, eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 14:27:01 2020 From: report at bugs.python.org (Sebastian Berg) Date: Mon, 10 Aug 2020 18:27:01 +0000 Subject: [issue15751] [subinterpreters] Make the PyGILState API compatible with subinterpreters In-Reply-To: <1345526301.75.0.455071650321.issue15751@psf.upfronthosting.co.za> Message-ID: <1597084021.12.0.996545619895.issue15751@roundup.psfhosted.org> Sebastian Berg added the comment: In NumPy ufuncs and datatype casting (iteration) we have the following setup: user-code (releasing GIL) -> NumPy API -> 3rd-party C-function (in the ufunc code, numpy is the one releasing the GIL, although others, such as numba probably hook in and replace that.) Now, I want the 3rd-party C-function to be able to report errors in a reasonable way. Which, in my opinion means it must be able to grab the GIL, set an error (potentially release the GIL) and return an error result. In theory, setting the error could be deferred to some later "cleanup" when the GIL is held, but that just does not seem practical to me. One thing which may make this not as problematic is that the all of this can be expected to run within a Python created thread, so I somewhat think the initial proposal here would effectively fix the current NumPy usage (I am not sure). The reason I ask/post this is, that this is all part of public-API which requires a complete re-implementation very soon. While extensions to that new API may be possible, that is always a bit painful, so it would be good to know how that API should be designed right now. At this point, it seems that I should design the 3rd-party C-function API so that it is passed a `void *reserved = NULL` (always NULL) to be able to pass a `PyThreadState *` or `PyInterpreterState *` at some point safely. (Or a `PyThreadState **`/ `PyInterpreterState **`?) In the majority of cases, I could already pass this right now, but I have currently no clear idea of what is the best practice. I also need to take such an argument (requiring new API) in at least one place. If we know how this will pan out, adding it sooner rather than later would be good, since it will make future transition/adoption faster or at least easier. As far as I understand, right now PyGILState_Ensure()` not working is probably the single most blocking issue for correct subinterpreter support in NumPy, since this is baked into public API it may take years for true support in the above way, but we may be able to go a large part of the way now. My problem is that I can only do that if I am clear on what is needed. ---------- nosy: +seberg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 14:55:17 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 Aug 2020 18:55:17 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597085717.62.0.730591935714.issue41517@roundup.psfhosted.org> Eric V. Smith added the comment: Could you provide code which demonstrates the problem? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 14:56:50 2020 From: report at bugs.python.org (Ramesh Sahoo) Date: Mon, 10 Aug 2020 18:56:50 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols Message-ID: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> New submission from Ramesh Sahoo : With for loop, I am able to print all elements in the list 'a' a = ['a','a','b','b','c'] for i in a: print(i) O/P: a a b b c but with the following loop, python only prints 3 uniq elements instead of 5. stack = ['(', '(', '[', ']', ')'] for i in stack: print(i) O/P: ( ] ) Is this is intended behavior? ---------- messages: 375136 nosy: rameshsahoo11 priority: normal severity: normal status: open title: incorrect printing behavior with parenthesis symbols type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 14:58:59 2020 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 10 Aug 2020 18:58:59 +0000 Subject: [issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached) In-Reply-To: <1358533279.94.0.666576182033.issue16995@psf.upfronthosting.co.za> Message-ID: <1597085939.78.0.0211096703775.issue16995@roundup.psfhosted.org> Filipe La?ns added the comment: Paul, the PR is now merged :). Can you close the bug? ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:00:47 2020 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 10 Aug 2020 19:00:47 +0000 Subject: [issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached) In-Reply-To: <1358533279.94.0.666576182033.issue16995@psf.upfronthosting.co.za> Message-ID: <1597086047.8.0.235585496191.issue16995@roundup.psfhosted.org> Paul Ganssle added the comment: Thanks Filipe! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:01:16 2020 From: report at bugs.python.org (Tal Suhareanu) Date: Mon, 10 Aug 2020 19:01:16 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597086076.91.0.933646265236.issue41517@roundup.psfhosted.org> Tal Suhareanu added the comment: Eric V. Smith it's in the first comment ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:02:54 2020 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 10 Aug 2020 19:02:54 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1597086174.56.0.896056728537.issue36700@roundup.psfhosted.org> Paul Ganssle added the comment: Now that issue #16995 is resolved, I think we can move forward with updating the text. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:06:00 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 Aug 2020 19:06:00 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597086360.61.0.0142894929786.issue41517@roundup.psfhosted.org> Eric V. Smith added the comment: With Python 3.7.4, which is all I have handy, that code does not give a runtime error. It prints "B.b". Your text says code "when creating a multiple inheritance like the following, it works". It sounds like you know the code sample works. So I don't understand what code gives a runtime error. What type of error are you seeing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:08:20 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 Aug 2020 19:08:20 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597086500.95.0.481308752575.issue41518@roundup.psfhosted.org> Eric V. Smith added the comment: Here's what I see: Python 3.6.9 (default, Jul 21 2019, 14:33:59) [GCC 7.4.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> stack = ['(', '(', '[', ']', ')'] >>> for i in stack: ... print(i) ... ( ( [ ] ) That looks correct to me. What exact version of 3.6 are you using, and on what platform? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:24:02 2020 From: report at bugs.python.org (Tal Suhareanu) Date: Mon, 10 Aug 2020 19:24:02 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597087442.86.0.360014198552.issue41517@roundup.psfhosted.org> Tal Suhareanu added the comment: sorry, I'll explain. by "when inheriting an implemented enum, we get a runtime error" I refer to this https://docs.python.org/3/library/enum.html#restricted-enum-subclassing You shouldn't be able to subclass an enum, yet I just showed a loophole. my example code shows you can subclass an enum by using a trick, multiple inheritance. I hope it's more clear now :) btw it also works with regular Enum inheritance (I just used IntEnum for simplicity) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:40:07 2020 From: report at bugs.python.org (Roundup Robot) Date: Mon, 10 Aug 2020 19:40:07 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1597088407.51.0.488672256532.issue41515@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +20948 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:44:33 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 10 Aug 2020 19:44:33 +0000 Subject: [issue41514] test_idle: test_error() failed on aarch64 RHEL8 Refleaks 3.8 In-Reply-To: <1597060937.12.0.87529554525.issue41514@roundup.psfhosted.org> Message-ID: <1597088673.65.0.264833276807.issue41514@roundup.psfhosted.org> Terry J. Reedy added the comment: I just read that the release is tomorrow, so no issue about including this. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:48:59 2020 From: report at bugs.python.org (Ethan Furman) Date: Mon, 10 Aug 2020 19:48:59 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597088939.64.0.324817562185.issue41517@roundup.psfhosted.org> Ethan Furman added the comment: The problem is that class B should raise an error as class A already has members. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:52:49 2020 From: report at bugs.python.org (David Edelsohn) Date: Mon, 10 Aug 2020 19:52:49 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1597089169.96.0.104090522909.issue38628@roundup.psfhosted.org> David Edelsohn added the comment: +Eryksun,Vinay The patch to address array passing described in issue #22273 introduced regressions for other targets. The 16 byte struct size is specific to x86 ABI and register passing convention. I appreciate that the 16-32 byte size structure causes an abort for x64, but the patch shifted the problem to other targets that now produce wrong code. The later comments in discussion thread for issue #22273 refer to patches that disable and reenable ctypes struct tests for ARMv7 and PPC, so this regression is not a surprise. stgdict.c currently includes a target-specific work-around for small structures that is not restricted to the one target (x64) affected. What's the best way to proceed? ---------- nosy: +eryksun, vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:54:30 2020 From: report at bugs.python.org (Tal Suhareanu) Date: Mon, 10 Aug 2020 19:54:30 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597089270.34.0.811992324977.issue41517@roundup.psfhosted.org> Tal Suhareanu added the comment: Ethan Furman bullseye! thanks for clarifying ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 15:59:33 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 10 Aug 2020 19:59:33 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597089573.74.0.132641458719.issue41518@roundup.psfhosted.org> Eric V. Smith added the comment: Also, how are you running this? From the interactive shell (like I show in my previous message), or some other way? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 16:37:28 2020 From: report at bugs.python.org (Cory Nezin) Date: Mon, 10 Aug 2020 20:37:28 +0000 Subject: [issue41519] `pkgutil.get_data` causes future imports of children modules to fail. Message-ID: <1597091848.05.0.295677555121.issue41519@roundup.psfhosted.org> New submission from Cory Nezin : As demonstrated in this Stack Overflow question (https://stackoverflow.com/questions/59377661/python-pkgutil-get-data-disrupts-future-imports) using `pkgutil.get_data` on a module causes future imports of children modules to fail. I tracked this down to a call to `importlib._bootstrap.load` here: https://github.com/python/cpython/blob/3.8/Lib/pkgutil.py#L627 This seems to do something to sys.modules which I don't quite understand but I think it is caching the module when it shouldn't be. If I replace the linked line with `importlib.import_module(package))` it seems to work okay. ---------- components: Library (Lib) files: pkgutil_err.tar messages: 375149 nosy: cnezin priority: normal severity: normal status: open title: `pkgutil.get_data` causes future imports of children modules to fail. type: behavior versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file49381/pkgutil_err.tar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 17:12:38 2020 From: report at bugs.python.org (mohamed koubaa) Date: Mon, 10 Aug 2020 21:12:38 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597093958.68.0.184329029113.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +20949 pull_request: https://github.com/python/cpython/pull/21818 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 17:24:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 21:24:11 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597094651.62.0.4420524049.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 490c5426b1b23831d83d0c6b269858fb98450889 by Hai Shi in branch 'master': bpo-40275: Fix failed test cases by using test helpers (GH-21811) https://github.com/python/cpython/commit/490c5426b1b23831d83d0c6b269858fb98450889 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 17:32:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 10 Aug 2020 21:32:12 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597095132.06.0.719418028865.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: Update. "import test.support" now imports 37 modules, instead of 171 previously. It's way better! 23:26:20 vstinner at apu$ ./python Python 3.10.0a0 (heads/master:598a951844, Aug 7 2020, 17:24:10) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> import test >>> before=set(sys.modules) >>> import test.support >>> after=set(sys.modules) >>> len(after - before) 37 >>> import pprint; pprint.pprint(sorted(after - before)) ['_datetime', '_elementtree', '_heapq', '_sysconfigdata_d_linux_x86_64-linux-gnu', '_testcapi', '_weakrefset', 'argparse', 'copy', 'datetime', 'difflib', 'fnmatch', 'gettext', 'heapq', 'math', 'pprint', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'signal', 'sysconfig', 'test.support', 'test.support.testresult', 'traceback', 'unittest', 'unittest.case', 'unittest.loader', 'unittest.main', 'unittest.result', 'unittest.runner', 'unittest.signals', 'unittest.suite', 'unittest.util', 'weakref', 'xml', 'xml.etree', 'xml.etree.ElementPath', 'xml.etree.ElementTree'] Shorter list if imports made by unittest are ignored: 23:27:42 vstinner at apu$ ./python Python 3.10.0a0 (heads/master:598a951844, Aug 7 2020, 17:24:10) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys, unittest, test >>> before=set(sys.modules) >>> before=set(sys.modules); import test.support; after=set(sys.modules) >>> len(after) - len(before) 17 >>> import pprint; pprint.pprint(sorted(after - before)) ['_datetime', '_elementtree', '_sysconfigdata_d_linux_x86_64-linux-gnu', '_testcapi', 'copy', 'datetime', 'math', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'sysconfig', 'test.support', 'test.support.testresult', 'xml', 'xml.etree', 'xml.etree.ElementPath', 'xml.etree.ElementTree'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 17:57:55 2020 From: report at bugs.python.org (Matthias Bussonnier) Date: Mon, 10 Aug 2020 21:57:55 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. Message-ID: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> New submission from Matthias Bussonnier : assuming $ cat foo.py import warnings from codeop import compile_command warnings.simplefilter('error', SyntaxWarning) res = compile_command('1 is 1\n', symbol='exec') print('Res', res) On 3.8.0...3.8.4 this correctly raises a SyntaxError: python foo.py Traceback (most recent call last): File "foo.py", line 5, in res = compile_command('1 is 1\n', symbol='exec') File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 122, in compile_command return _maybe_compile(_compile, source, filename, symbol) File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 99, in _maybe_compile raise err1 File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 87, in _maybe_compile code1 = compiler(source + "\n", filename, symbol) File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 102, in _compile return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) File "", line 1 SyntaxError: "is" with a literal. Did you mean "=="? But will silently return None on 3.8.5 $ python foo.py Res None ---------- components: Interpreter Core messages: 375152 nosy: mbussonn priority: normal severity: normal status: open title: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 17:58:47 2020 From: report at bugs.python.org (Matthias Bussonnier) Date: Mon, 10 Aug 2020 21:58:47 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597096727.52.0.89606991271.issue41520@roundup.psfhosted.org> Matthias Bussonnier added the comment: seem to affect 3.8.4 as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 18:05:33 2020 From: report at bugs.python.org (Matthias Bussonnier) Date: Mon, 10 Aug 2020 22:05:33 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597097133.38.0.436686711044.issue41520@roundup.psfhosted.org> Matthias Bussonnier added the comment: Potentially due to https://bugs.python.org/issue40807 https://github.com/python/cpython/pull/20486 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 18:07:08 2020 From: report at bugs.python.org (Matthias Bussonnier) Date: Mon, 10 Aug 2020 22:07:08 +0000 Subject: [issue40807] Codeop: Show warnings once during _maybe_compile In-Reply-To: <1590674108.19.0.341062869134.issue40807@roundup.psfhosted.org> Message-ID: <1597097228.03.0.733223491149.issue40807@roundup.psfhosted.org> Matthias Bussonnier added the comment: I think that might have introduce https://bugs.python.org/issue41520 where now `warnings.simplefilter('error', SyntaxWarning)` is silently ignored... ---------- nosy: +mbussonn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 18:33:57 2020 From: report at bugs.python.org (Matthias Bussonnier) Date: Mon, 10 Aug 2020 22:33:57 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597098837.78.0.0529026204377.issue41520@roundup.psfhosted.org> Change by Matthias Bussonnier : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 18:44:05 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Mon, 10 Aug 2020 22:44:05 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597099445.49.0.378828522956.issue41518@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 18:46:25 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Mon, 10 Aug 2020 22:46:25 +0000 Subject: [issue41517] Enum multiple inheritance loophole In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597099585.61.0.837354643208.issue41517@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 19:18:35 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 10 Aug 2020 23:18:35 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597101515.5.0.79743872274.issue41518@roundup.psfhosted.org> Steven D'Aprano added the comment: Python 3.6 has reached security-fix only stage: https://www.python.org/dev/peps/pep-0494/#schedule-last-bugfix-release so even if this is a bug, it won't be fixed in 3.6. I cannot reproduce this in 3.7, and Eric cannot reproduce in 3.6.9, so I'm closing the issue. Please re-open if you can reproduce in 3.8 or better. (3.7 is also only accepting security fixes only.) (Eric do you concur? If you disagree please feel free to re-open.) ---------- nosy: +steven.daprano resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 19:42:29 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 10 Aug 2020 23:42:29 +0000 Subject: [issue41517] Able to subclass enum with members by using multiple inheritance In-Reply-To: <1597081678.02.0.276964498945.issue41517@roundup.psfhosted.org> Message-ID: <1597102949.12.0.918801519645.issue41517@roundup.psfhosted.org> Steven D'Aprano added the comment: The documentation says: "Allowing subclassing of enums that define members would lead to a violation of some important invariants of types and instances." but it isn't clear what those invariants are, or why it is more of a problem for enums than any other subclassing situation. Could the docs be updated to explain why it is prohibited? ---------- nosy: +steven.daprano title: Enum multiple inheritance loophole -> Able to subclass enum with members by using multiple inheritance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 20:02:19 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 11 Aug 2020 00:02:19 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597104139.17.0.481819786473.issue41518@roundup.psfhosted.org> Eric V. Smith added the comment: I agree, Steven. This doesn't seem to be a problem with Python. It's more likely a problem with the user's shell, or some other environment integration problem. If it can be duplicated in 3.8 or later, we can investigate further. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 20:30:03 2020 From: report at bugs.python.org (Thomas Caswell) Date: Tue, 11 Aug 2020 00:30:03 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597105803.84.0.47967746484.issue41520@roundup.psfhosted.org> Thomas Caswell added the comment: bisecting agrees with Matthias: # first bad commit: [c067183605cf84bb1a246635f52827251d0476f8] bpo-40807: Show warnings once from codeop._maybe_compile (GH-20486) ---------- nosy: +tcaswell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 20:58:01 2020 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Aug 2020 00:58:01 +0000 Subject: [issue41197] Async magic methods in contextlib.closing In-Reply-To: <1593714173.91.0.0149218020987.issue41197@roundup.psfhosted.org> Message-ID: <1597107481.34.0.509813731677.issue41197@roundup.psfhosted.org> Yury Selivanov added the comment: I'm OK with adding this, but the close method should be `aclose()` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 20:58:14 2020 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 11 Aug 2020 00:58:14 +0000 Subject: [issue41197] Async magic methods in contextlib.closing In-Reply-To: <1593714173.91.0.0149218020987.issue41197@roundup.psfhosted.org> Message-ID: <1597107494.01.0.877077955596.issue41197@roundup.psfhosted.org> Change by Yury Selivanov : ---------- nosy: +asvetlov, njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 21:58:26 2020 From: report at bugs.python.org (Albert Francis) Date: Tue, 11 Aug 2020 01:58:26 +0000 Subject: [issue41468] Unrecoverable server exiting In-Reply-To: <1597067747.2.0.8171278585.issue41468@roundup.psfhosted.org> Message-ID: Albert Francis added the comment: Got it, thanks! On Mon, 10 Aug 2020, 19:26 Terry J. Reedy, wrote: > > Terry J. Reedy added the comment: > > Test error fixed on issue 41514. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 10 23:07:33 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Tue, 11 Aug 2020 03:07:33 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1597115253.09.0.241990464076.issue41109@roundup.psfhosted.org> Jeffrey Kintscher added the comment: The purpose of the _init() function in PurePath is to allow PurePath methods to call the Path subclass override _init() function when initializing a Path object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 00:41:08 2020 From: report at bugs.python.org (Ned Deily) Date: Tue, 11 Aug 2020 04:41:08 +0000 Subject: [issue36982] Add support for extended color functions in ncurses 6.1 In-Reply-To: <1558406631.2.0.0939623901621.issue36982@roundup.psfhosted.org> Message-ID: <1597120868.88.0.589757800802.issue36982@roundup.psfhosted.org> Ned Deily added the comment: > We really need to get this merged since, without it, Python builds fail with the newer versions of ncurses now in most distributions. That is a bit of an overstatment on my part. What is true is that test_curses fails on 3.9 and 3.8 when run with ncurses 6.1+. It is also true that the relevant parts of test_curses are often skipped in CI and buildbot runs as described in Issue12669 so a test failure is often not seen. > ?ukasz can provide direction about whether and when it should be backported to 3.9 and/or 3.8. We discussed this and decided that a backport to 3.8 was out-of-scope but a backport in time for 3.9.0 might be OK. Alas, I had forgotten that other changes have gone into master for 3.10 prior to this merge which complicates a backport to 3.9, enough that we shouldn't be trying to throw this in just prior to 3.9.0rc1. Thanks everyone for the work on this! ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 01:25:12 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 11 Aug 2020 05:25:12 +0000 Subject: [issue41429] Let fnmatch.filter accept a tuple of patterns In-Reply-To: <1595979718.87.0.129861821474.issue41429@roundup.psfhosted.org> Message-ID: <1597123512.12.0.0366962829508.issue41429@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 01:30:31 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 11 Aug 2020 05:30:31 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597123831.01.0.153078869209.issue41520@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 03:16:35 2020 From: report at bugs.python.org (Ramesh Sahoo) Date: Tue, 11 Aug 2020 07:16:35 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597130195.31.0.374446947583.issue41518@roundup.psfhosted.org> Change by Ramesh Sahoo : ---------- resolution: works for me -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 03:16:20 2020 From: report at bugs.python.org (Ramesh Sahoo) Date: Tue, 11 Aug 2020 07:16:20 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597130180.68.0.308135625521.issue41518@roundup.psfhosted.org> Ramesh Sahoo added the comment: Hi all, Thanks for your valuable response. I would like to inform you that I found this issue while playing with the following code. This is reproducible with Python 3.8. Please find the following details and let me know if I am doing something wrong. [Using for loop popping elements] import sys stack,braces = [],{'(':')','{':'}','[':']'} stack = [s for s in "(([])"] c = 0 print(f"Python version: {sys.version}") print(f"Before for loop:\nbraces.keys = {braces.keys()}\nbraces.items = {braces.items()}\nstack = {stack}\n\n") for i in stack: c += 1 print(f"{'='*10} loop {c} {'='*10}") print("just after for loop stack =",stack) print(f"Just after for loop i =",i) print(f"Just after for loop: Is i'{i}' found in braces.keys:{i in braces.keys()}") if i in braces.keys(): print(f"inside if i = {i}") print("inside if stack =",stack) print("inside if Popped =",stack.pop(stack.index(i))) print(f"inside if after popped stack = {stack}\n") continue else: print(f"in else: Is i'{i}' found in braces.keys:{i in braces.keys()}") print(f"in else stack = {stack}\n") [Program Output] $ python3 test1.py Python version: 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] Before for loop: braces.keys = dict_keys(['(', '{', '[']) braces.items = dict_items([('(', ')'), ('{', '}'), ('[', ']')]) stack = ['(', '(', '[', ']', ')'] ========== loop 1 ========== just after for loop stack = ['(', '(', '[', ']', ')'] Just after for loop i = ( Just after for loop: Is i'(' found in braces.keys:True inside if i = ( inside if stack = ['(', '(', '[', ']', ')'] inside if Popped = ( inside if after popped stack = ['(', '[', ']', ')'] ========== loop 2 ========== just after for loop stack = ['(', '[', ']', ')'] Just after for loop i = [ Just after for loop: Is i'[' found in braces.keys:True inside if i = [ inside if stack = ['(', '[', ']', ')'] inside if Popped = [ inside if after popped stack = ['(', ']', ')'] ========== loop 3 ========== just after for loop stack = ['(', ']', ')'] Just after for loop i = ) Just after for loop: Is i')' found in braces.keys:False in else: Is i')' found in braces.keys:False in else stack = ['(', ']', ')'] [Summary] stack = ['(', '(', '[', ']', ')'] => [loop 1] is correct where the right element "(" has been popped. ['(', '[', ']', ')'] => [loop 2] "(" element should have been popped but "[" chosen to be popped. This seems to be incorrect. => There must be 5 iterations(3 in if block and 2 in else block) but loop completed with 3 iterations(2 in if and one in else). I am not sure if I am doing something wrong or it is a buggy behavior. [Popping elements manually gives correct behavior] import sys print(f"Python Version: {sys.version}") stack,braces = [],{'(':')','{':'}','[':']'} stack = [s for s in "(([])"] print(f"Original:\nbraces.keys = {braces.keys()}\nbraces.items = {braces.items()}\nstack = {stack}\n\n") # Popping '(' print(f"Popped {stack.pop(stack.index('('))}") print(f"stack after popping '(' = {stack}") # Popping '(' print(f"Popped {stack.pop(stack.index('('))}") print(f"stack after popping '(' = {stack}") # Popping '[' print(f"Popped {stack.pop(stack.index('['))}") print(f"stack after popping '[' = {stack}") [Program Output] Python Version: 3.8.0 (default, Nov 14 2019, 22:29:45) [GCC 5.4.0 20160609] Original: braces.keys = dict_keys(['(', '{', '[']) braces.items = dict_items([('(', ')'), ('{', '}'), ('[', ']')]) stack = ['(', '(', '[', ']', ')'] Popped ( stack after popping '(' = ['(', '[', ']', ')'] Popped ( stack after popping '(' = ['[', ']', ')'] Popped [ stack after popping '[' = [']', ')'] ---------- status: closed -> open versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 03:34:14 2020 From: report at bugs.python.org (Ramesh Sahoo) Date: Tue, 11 Aug 2020 07:34:14 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597131254.16.0.952619655926.issue41518@roundup.psfhosted.org> Ramesh Sahoo added the comment: Additional note: The following program completes all 5 iterations. #!/usr/bin/python3 stack = [s for s in range(5)] c = 0 for i in stack: c += 1 print(f"{'='*10} loop {c} {'='*10}") if i == 0 or i == 1 or i == 2: print(f"{i}\n") else: print(f"{i}\n") $ python3 test1.py ========== loop 1 ========== 0 ========== loop 2 ========== 1 ========== loop 3 ========== 2 ========== loop 4 ========== 3 ========== loop 5 ========== 4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 03:50:30 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 11 Aug 2020 07:50:30 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597132230.47.0.983546047132.issue41513@roundup.psfhosted.org> Mark Dickinson added the comment: Fine by me in principle; I haven't had a chance to look at the code yet. While we're doing this, any chance we could special-case the two-argument hypot to use the libm hypot directly? On many platforms the libm hypot will be correctly rounded, or close to it. There was a noticeable accuracy regression for two-argument hypot when hypot gained the ability to support multiple arguments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 04:34:30 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 11 Aug 2020 08:34:30 +0000 Subject: [issue33129] Add kwarg-only option to dataclass In-Reply-To: <1521847997.9.0.467229070634.issue33129@psf.upfronthosting.co.za> Message-ID: <1597134870.4.0.464916715456.issue33129@roundup.psfhosted.org> wyz23x2 added the comment: Since '/' was introduced in Python 3.8, support for positional parameters should be supported too. ---------- nosy: +wyz23x2 versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 05:00:47 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 11 Aug 2020 09:00:47 +0000 Subject: [issue22893] IDLE: __future__ does not work in startup code. In-Reply-To: <1416261777.24.0.465929106454.issue22893@psf.upfronthosting.co.za> Message-ID: <1597136447.51.0.939943447388.issue22893@roundup.psfhosted.org> Change by wyz23x2 : ---------- title: Idle: __future__ does not work in startup code. -> IDLE: __future__ does not work in startup code. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 05:09:06 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 11 Aug 2020 09:09:06 +0000 Subject: [issue41169] socket.inet_pton raised when pass an IPv6 address like "[::]" to it In-Reply-To: <1593525971.46.0.103341919582.issue41169@roundup.psfhosted.org> Message-ID: <1597136946.1.0.266839177402.issue41169@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 05:12:22 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 11 Aug 2020 09:12:22 +0000 Subject: [issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g) In-Reply-To: <1591787928.34.0.800218743026.issue40938@roundup.psfhosted.org> Message-ID: <1597137142.25.0.885796113687.issue40938@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 05:59:52 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 11 Aug 2020 09:59:52 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597130180.68.0.308135625521.issue41518@roundup.psfhosted.org> Message-ID: <20200811095919.GF23924@ando.pearwood.info> Steven D'Aprano added the comment: On Tue, Aug 11, 2020 at 07:16:20AM +0000, Ramesh Sahoo wrote: > for i in stack: > print("inside if Popped =",stack.pop(stack.index(i))) You are mutating the list while you iterate over it. This is prone to cause trouble. Here's is a much smaller and simpler demonstration: items = [1, 2, 3, 4, 5] for index, value in enumerate(items): print(f"index: {index}, value: {value}, items: {items}") if value == 2: x = items.pop(index) print(f"after popping 2: {items}") which has output: index: 0, value: 1, items: [1, 2, 3, 4, 5] index: 1, value: 2, items: [1, 2, 3, 4, 5] after popping 2: [1, 3, 4, 5] index: 2, value: 4, items: [1, 3, 4, 5] index: 3, value: 5, items: [1, 3, 4, 5] If you trace the code execution in your head, you will see that this is correct behaviour: Python is walking the list from position to position, but you removed one of the values so everything shifts and you end up skipping a value, because it moves before the loop can reach it. The lesson here is: Don't mutate a list that you are iterating over if you can avoid it. It you cannot avoid it, you can avoid problems by iterating in reverse, and only mutating the part of the list you have already processed. But better to avoid mutation altogether. So not a bug. Python is doing exactly what you told it to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 06:01:11 2020 From: report at bugs.python.org (Peixing Xin) Date: Tue, 11 Aug 2020 10:01:11 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1597140071.59.0.533624580734.issue31904@roundup.psfhosted.org> Change by Peixing Xin : ---------- pull_requests: +20950 pull_request: https://github.com/python/cpython/pull/21821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 06:02:14 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 11 Aug 2020 10:02:14 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597140134.87.0.437038090173.issue41518@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 06:32:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 10:32:50 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597141970.8.0.516684908786.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1d541c25c8019f7a0b80b3e1b437abe171e40b65 by Mohamed Koubaa in branch 'master': bpo-1635741: Port multiprocessing ext to multiphase init (GH-21378) https://github.com/python/cpython/commit/1d541c25c8019f7a0b80b3e1b437abe171e40b65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 08:44:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 12:44:30 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist Message-ID: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> New submission from STINNER Victor : I propose to replace whitelist/blacklist with allowlist/denylist. The terms whitelist and blacklist can be associated to color skins which isn't the intent. To avoid confusion, I propose to use neutral terms: allowlist and denylist. Moreover, as a french person (english is not my first language, but french), "allow" and "deny" are even more explicit to me than "white "and "black". The intent is to make the Python community more welcoming and more diverse by avoiding to make some people uncomfortable. Many other projects already replaced whitelist/blacklist with allowlist/denylist: * GitLab: https://gitlab.com/gitlab-org/gitlab/-/issues/7554 * React: https://github.com/facebook/react/commit/8a8d973d3cc5623676a84f87af66ef9259c3937c * Mediawiki: https://phabricator.wikimedia.org/T254646 * GitHub: https://thenextweb.com/dd/2020/06/15/github-plans-to-replace-racially-insensitive-terms-like-master-and-whitelist/ * Google Chrome: https://9to5google.com/2020/06/12/google-android-chrome-blacklist-blocklist-more-inclusive/ * etc. See also: * Carolyn Stransky's "Humanizing Your Documentation" presentation: https://speakerdeck.com/carolstran/humanizing-your-documentation-full-talk * bpo-34605: "Avoid master/slave terminology" Attached PRs replace whitelist/blacklist with allowlist/denylist. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 375170 nosy: docs at python, vstinner priority: normal severity: normal status: open title: Replace whitelist/blacklist with allowlist/denylist versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 08:47:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 12:47:27 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597150047.69.0.775469449736.issue41521@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +20951 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 08:49:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 12:49:05 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597150145.4.0.801422212766.issue41521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20952 pull_request: https://github.com/python/cpython/pull/21823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 08:50:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Aug 2020 12:50:01 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597150201.15.0.0801498523244.issue40994@roundup.psfhosted.org> Irit Katriel added the comment: Can you be more specific about what you found confusing? What is the documentation bug? What do you mean by "this point in the documentation"? Even better, can you suggest how to rewrite the documentation to make it clearer? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 08:52:23 2020 From: report at bugs.python.org (Christian Heimes) Date: Tue, 11 Aug 2020 12:52:23 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597150343.7.0.390380595959.issue41521@roundup.psfhosted.org> Christian Heimes added the comment: +1 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 08:57:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 12:57:38 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597150658.42.0.649202795128.issue41521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20953 pull_request: https://github.com/python/cpython/pull/21824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 09:08:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 13:08:52 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597151332.97.0.285744546132.issue41521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20954 pull_request: https://github.com/python/cpython/pull/21825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 09:27:07 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 13:27:07 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597152427.03.0.947656387462.issue41521@roundup.psfhosted.org> miss-islington added the comment: New changeset fabd7bb8e0450f16ed5c5c0ad575aa413d65712d by Victor Stinner in branch 'master': bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822) https://github.com/python/cpython/commit/fabd7bb8e0450f16ed5c5c0ad575aa413d65712d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 09:28:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 13:28:50 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597152530.77.0.833529066881.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0ee0b2938cb606151d8d287472c838044bad4a0e by Victor Stinner in branch 'master': bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823) https://github.com/python/cpython/commit/0ee0b2938cb606151d8d287472c838044bad4a0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 09:37:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 13:37:31 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597153051.31.0.564061193003.issue41521@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20955 pull_request: https://github.com/python/cpython/pull/21826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 09:47:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 13:47:18 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1597153638.27.0.130766076042.issue38912@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20956 pull_request: https://github.com/python/cpython/pull/21827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:19:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 14:19:49 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597155589.88.0.463342633566.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: "While the etymology of the words isn't steeped in racial undertones or history like other problematic tech word choices, there is no harm in changing them to synonyms that as just as understandable and avoid the question entirely" https://web.archive.org/web/20180921225759/https://github.com/facebook/react/issues/13604#issuecomment-419884422 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:24:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 14:24:23 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597155863.2.0.111465999039.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: Another rationale from "Inclusive Chromium code": Terms such as ?blacklist? and ?whitelist? reinforce the notion that black==bad and white==good. That Word Black, by Langston Hughes illustrates this problem in a lighthearted, if somewhat pointed way. These terms can usually be replaced by ?blocklist? and ?allowlist? without changing their meanings, but particular instances may need other replacements. https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:29:26 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Aug 2020 14:29:26 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597156166.29.0.814982976485.issue41503@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:29:55 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 11 Aug 2020 14:29:55 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597156195.75.0.547917083656.issue41475@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: __future__.annotations set to become default in Python 4.0? -> Make __future__.annotations default 3.10 in What's New 3.7 versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:29:45 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 11 Aug 2020 14:29:45 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1597156185.43.0.0787866846325.issue38605@roundup.psfhosted.org> Terry J. Reedy added the comment: Issue 41314 changed the __future__ annotations default version to 3.10. 3.10.0a1 is scheduled for next Oct 5, less than 2 months from now. It would be good if PR 20434 were merged before that. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:31:02 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 14:31:02 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597156262.0.0.105770570504.issue41504@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20957 pull_request: https://github.com/python/cpython/pull/21828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:36:03 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 14:36:03 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597156563.66.0.385001862639.issue41504@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20958 pull_request: https://github.com/python/cpython/pull/21829 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:43:32 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Aug 2020 14:43:32 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597157012.39.0.747953067979.issue41504@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum nosy_count: 4.0 -> 5.0 pull_requests: +20959 pull_request: https://github.com/python/cpython/pull/21830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:45:30 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Aug 2020 14:45:30 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597157130.46.0.920108641625.issue41504@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 7b3ceaa71051d811bfee0b62ef9cb0fd2121c7ee by Miss Islington (bot) in branch '3.8': [3.8] bpo-41504: Add links to asttokens, leoAst, LibCST and parso to ast docs (GH-21773) (GH-21829) https://github.com/python/cpython/commit/7b3ceaa71051d811bfee0b62ef9cb0fd2121c7ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 10:50:19 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Aug 2020 14:50:19 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597157419.82.0.395546579176.issue41504@roundup.psfhosted.org> Guido van Rossum added the comment: The master commit was e3c971ccfa58afcb2656b71b95e10b9703f2ad32 (somehow because the commit message didn't contain the bpo-41504 tag the automation didn't work flawlessly). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 11:03:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 15:03:41 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1597158221.69.0.365532155151.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a0b57b3317d6653255415af5228c94485aa57a0d by Victor Stinner in branch '3.9': bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718) (GH-21827) https://github.com/python/cpython/commit/a0b57b3317d6653255415af5228c94485aa57a0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 11:04:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 15:04:31 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1597158271.65.0.746530541156.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: On the AArch64 RHEL8 buildbot, I managed to reproduce a ENV_CHANGED issue with only these two test_asyncio tests: test.test_asyncio.test_events.SelectEventLoopTests.test_create_server_ssl_verify_failed test.test_asyncio.test_events.SelectEventLoopTests.test_create_server_ssl_verified I'm running a bisect for like 2 hours... The bug is really hard to trigger :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 11:29:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 15:29:09 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1597159749.27.0.511271276565.issue38912@roundup.psfhosted.org> STINNER Victor added the comment: test.test_asyncio.test_events.SelectEventLoopTests.test_create_server_ssl_verified fails randomly and emits an "unraisable exception". Logs: + /home/vstinner/python/master/python -m test --matchfile /tmp/tmpz2f1v5aq test_asyncio --fail-env-changed -v == CPython 3.10.0a0 (heads/master:0ee0b2938c, Aug 11 2020, 15:50:20) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] == Linux-4.18.0-193.14.3.el8_2.aarch64-aarch64-with-glibc2.28 little-endian == cwd: /home/vstinner/python/master/build/test_python_585912? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 7.50 Run tests sequentially 0:00:00 load avg: 7.50 [1/1] test_asyncio test_create_server_ssl_verified (test.test_asyncio.test_events.SelectEventLoopTests) ... /home/vstinner/python/master/Lib/test/support/__init__.py:597: ResourceWarning: unclosed gc.collect() ResourceWarning: Enable tracemalloc to get the object allocation traceback Task was destroyed but it is pending! task: wait_for=()]>> /home/vstinner/python/master/Lib/asyncio/sslproto.py:320: ResourceWarning: unclosed transport _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 321, in __del__ self.close() File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 316, in close self._ssl_protocol._start_shutdown() File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 590, in _start_shutdown self._abort() File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 731, in _abort self._transport.abort() File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 678, in abort self._force_close(None) File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 729, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/home/vstinner/python/master/Lib/asyncio/base_events.py", line 746, in call_soon self._check_closed() File "/home/vstinner/python/master/Lib/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed /home/vstinner/python/master/Lib/asyncio/selector_events.py:702: ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback ERROR /home/vstinner/python/master/Lib/unittest/case.py:620: ResourceWarning: unclosed outcome.errors.clear() ResourceWarning: Enable tracemalloc to get the object allocation traceback ====================================================================== ERROR: test_create_server_ssl_verified (test.test_asyncio.test_events.SelectEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/test_asyncio/test_events.py", line 1110, in test_create_server_ssl_verified proto.transport.close() AttributeError: 'NoneType' object has no attribute 'close' ---------------------------------------------------------------------- Ran 1 test in 0.218s FAILED (errors=1) /home/vstinner/python/master/Lib/asyncio/sslproto.py:320: ResourceWarning: unclosed transport _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Fatal error on SSL transport protocol: transport: <_SelectorSocketTransport closing fd=6> Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 236, in _runtest_inner2 test_runner() File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 211, in _test_module support.run_unittest(tests) File "/home/vstinner/python/master/Lib/test/support/__init__.py", line 1082, in run_unittest _run_suite(suite) File "/home/vstinner/python/master/Lib/test/support/__init__.py", line 974, in _run_suite raise TestFailed(err) test.support.TestFailed: Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/test_asyncio/test_events.py", line 1110, in test_create_server_ssl_verified proto.transport.close() AttributeError: 'NoneType' object has no attribute 'close' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 916, in write n = self._sock.send(data) ConnectionResetError: [Errno 104] Connection reset by peer During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 684, in _process_write_backlog self._transport.write(chunk) File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 922, in write self._fatal_error(exc, 'Fatal write error on socket transport') File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 717, in _fatal_error self._force_close(exc) File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 729, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/home/vstinner/python/master/Lib/asyncio/base_events.py", line 746, in call_soon self._check_closed() File "/home/vstinner/python/master/Lib/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed /home/vstinner/python/master/Lib/asyncio/selector_events.py:702: ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=6> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback test test_asyncio failed test_asyncio failed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 11:55:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 15:55:36 +0000 Subject: [issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597161336.77.0.737121899431.issue41520@roundup.psfhosted.org> Change by STINNER Victor : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 11:56:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 11 Aug 2020 15:56:51 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597161411.78.0.888412990126.issue41520@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. -> codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:14:00 2020 From: report at bugs.python.org (Andrew) Date: Tue, 11 Aug 2020 16:14:00 +0000 Subject: [issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems In-Reply-To: <1593195068.14.0.719266681703.issue41129@roundup.psfhosted.org> Message-ID: <1597162440.07.0.60440249868.issue41129@roundup.psfhosted.org> Andrew added the comment: Hi Ronald. The basic idea is that >= macOS 10.15.1 Apple has made most of the filesystem read only on a folder by folder basis. They separate user-writable onto a separate filesystem, treat it like a disk, and they mount it under /System/Volumes/ as "Data". Likewise, I think the idea is that other volumes get mounted under /System/Volumes, however, since "/System/Volumes/Data" is now "firmlinked" to root, I imagine you can find mounts to the writable filesystem under "/System/Volumes/Data/Volumes" which firmlinks to /Volumes. About the read-only system volume in macOS Catalina: https://support.apple.com/en-us/HT210650 More info on the container / firmlink scheme https://bombich.com/kb/ccc5/working-apfs-volume-groups ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:18:38 2020 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 11 Aug 2020 16:18:38 +0000 Subject: [issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault In-Reply-To: <1593518684.95.0.149768712012.issue41168@roundup.psfhosted.org> Message-ID: <1597162718.91.0.0307449940313.issue41168@roundup.psfhosted.org> Petr Viktorin added the comment: Closing; please re-open if you have more info. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:30:07 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 16:30:07 +0000 Subject: [issue41191] PyType_FromModuleAndSpec is not mentioned in 3.9 What's new In-Reply-To: <1593634040.83.0.8340731803.issue41191@roundup.psfhosted.org> Message-ID: <1597163407.18.0.728817168978.issue41191@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20960 pull_request: https://github.com/python/cpython/pull/21831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:33:29 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 11 Aug 2020 16:33:29 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597163609.19.0.0752546740591.issue41475@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 76643c10ede2813ca921464fe839e81caee21a84 by Ram Rachum in branch 'master': bpo-41475: Fix note in "What's new in 3.7" (#21733) https://github.com/python/cpython/commit/76643c10ede2813ca921464fe839e81caee21a84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:33:49 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 16:33:49 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597163629.85.0.042575858164.issue41475@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20962 pull_request: https://github.com/python/cpython/pull/21833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:33:41 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 16:33:41 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597163621.61.0.611899828846.issue41475@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +20961 pull_request: https://github.com/python/cpython/pull/21832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 12:53:23 2020 From: report at bugs.python.org (E. Paine) Date: Tue, 11 Aug 2020 16:53:23 +0000 Subject: [issue41522] IDLE: configdialog tab icons Message-ID: <1597164803.05.0.374696108322.issue41522@roundup.psfhosted.org> New submission from E. Paine : Currently, the tabs on the configdialog's Notebook only have a text description. I propose we add icons to the tabs to make them a little more colourful, new-user-friendly, etc. I have drafted a version which uses icons found in the Public Domain (I can provide links if this would be helpful - I believe the changes I have made would be covered under the CLA) resized to a height of 25px (see attached). The shown icons are meant more as a demonstration of this feature than a "I want these particular icons in the patch" but feel these make the dialog seem more inviting. I have nosied Mark Roseman as this idea came from the sort of changes described on the IDLE modernisation case study (https://tkdocs.com/tutorial/idle.html) ---------- assignee: terry.reedy components: IDLE files: idle-tab-icons.png messages: 375186 nosy: epaine, markroseman, taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE: configdialog tab icons type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49382/idle-tab-icons.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 13:03:28 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 11 Aug 2020 17:03:28 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597165408.06.0.912030708356.issue41475@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5de00f63d47b5aa1714ad2d88772ad55b10feea0 by Miss Islington (bot) in branch '3.9': bpo-41475: Fix note in "What's new in 3.7" (GH-21733) (#21832) https://github.com/python/cpython/commit/5de00f63d47b5aa1714ad2d88772ad55b10feea0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 13:23:57 2020 From: report at bugs.python.org (Bernat Gabor) Date: Tue, 11 Aug 2020 17:23:57 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check Message-ID: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> New submission from Bernat Gabor : from functools import cached_property, lru_cache class A: @property def a(self): return '' @cached_property def b(self): return '' @property @lru_cache def c(self): return "" print(isinstance(A.a, property)) print(isinstance(A.b, property)) print(isinstance(A.c, property)) True False True I feel like cached property should be of type property, not? ---------- messages: 375188 nosy: Bernat Gabor priority: normal severity: normal status: open title: functools.cached_property does not satisfy the property check versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 13:45:43 2020 From: report at bugs.python.org (Joshua Oreman) Date: Tue, 11 Aug 2020 17:45:43 +0000 Subject: [issue33786] @asynccontextmanager doesn't work well with async generators In-Reply-To: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> Message-ID: <1597167943.26.0.716174411762.issue33786@roundup.psfhosted.org> Joshua Oreman added the comment: This doesn't appear to have been backported to 3.7, even though it's in 3.6.6 and 3.8.0a0. ---------- nosy: +Joshua Oreman, lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 13:52:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Aug 2020 17:52:12 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597168332.26.0.0816080470506.issue41523@roundup.psfhosted.org> Serhiy Storchaka added the comment: No, cached_property is a completely different class. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 14:12:50 2020 From: report at bugs.python.org (Bernat Gabor) Date: Tue, 11 Aug 2020 18:12:50 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597169570.68.0.175255031178.issue41523@roundup.psfhosted.org> Bernat Gabor added the comment: I understand under the hood they're differenet, however I think cached_property wanted to be a shorter/better version of @property @lru_cache which does passes this check. Tools expecting properties to pass that check now need to extend their check... and similarly now is no longer enough to use isinstance property to check if something is a property. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 14:46:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 11 Aug 2020 18:46:57 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597171617.1.0.836597834633.issue41523@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are not much things common to property and cached_property. cached_property does not have attributes fget, fset, fdel. They are both descriptors, but cached_property is not a data descriptor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 14:48:35 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 11 Aug 2020 18:48:35 +0000 Subject: [issue37296] pdb next vs __next__ In-Reply-To: <1560626859.25.0.0533027405715.issue37296@roundup.psfhosted.org> Message-ID: <1597171715.28.0.783141199114.issue37296@roundup.psfhosted.org> Irit Katriel added the comment: Do you mean the python version? (Pdb) import sys (Pdb) sys.version '3.10.0a0 ....' ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 15:10:27 2020 From: report at bugs.python.org (Ramesh Sahoo) Date: Tue, 11 Aug 2020 19:10:27 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597173027.07.0.15587274719.issue41518@roundup.psfhosted.org> Ramesh Sahoo added the comment: Thank Steven for correcting and guiding me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 15:17:20 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Tue, 11 Aug 2020 19:17:20 +0000 Subject: [issue41518] incorrect printing behavior with parenthesis symbols In-Reply-To: <1597085810.49.0.205847918608.issue41518@roundup.psfhosted.org> Message-ID: <1597173440.73.0.846585256581.issue41518@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: -Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 15:18:37 2020 From: report at bugs.python.org (=?utf-8?b?QmVybsOhdCBHw6Fib3I=?=) Date: Tue, 11 Aug 2020 19:18:37 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597173517.61.0.645352055869.issue41523@roundup.psfhosted.org> Bern?t G?bor added the comment: I think they're implemented differently and have slightly different semantics, but they're equal from a user point of view most of the time ? ---------- nosy: +Bern?t G?bor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 15:39:08 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 11 Aug 2020 19:39:08 +0000 Subject: [issue41522] IDLE: configdialog tab icons In-Reply-To: <1597164803.05.0.374696108322.issue41522@roundup.psfhosted.org> Message-ID: <1597174748.22.0.933311169786.issue41522@roundup.psfhosted.org> Terry J. Reedy added the comment: I think we can agree that making the dialogs and in particular the settings dialog more visually inviting is a good thing. However, two problems are priority and differing aesthetic opinions. Some thoughts off the top of my head... I consider revising tab contents a higher priority. One thing is redoing the Highlights (Colors) and Keys pages using Mark's ideas from 5 years ago. At the time, Configdialog was a giant class with 70 methods and no tests. 3 years ago, Cheryl and I (with a bit of help from Louie Lu), split the class into a dialog class and classes for each tab, and added unit tests with, now, 94% coverage. Also, the dialog is now too tall to fit in the space Apple allows to apps on my small Macbook Air notebook. (See General comment below.) As for the tabs themselves. If left, 'Tabs' should be 'Indent', but the setting should be moved to General, which needs to be split into two pages (and classes) and tabs as there are other things to add. I think 'Highlights' should be 'Colors', as 'syntax coloring' only loosely fits 'important parts' or 'lightened parts'. Comments are colored separately so that they can be ignored. Ditto, sometimes, for strings. As for the icons, I don't think that the examples add much info. Hence they seem like noise to me. I think that the plug, possibly on an extension cord, fits best *because* it is so concordant with the text label. If we do use images, I might consider emoji that get rendered on most systems. Tk *will* display b/w astral emoji just fine in a read-only context. Example: "\U0001f40d = ?" This might be appropriate icon for one of the splits of General. (Or we can create images that combine images and text.) We could also consider creative typography. 'Fonts' in bold italic and varying size letters might better suggest 'font choice'. Ditto for 'Colors' in multiple colors. Boxing the 'K' of "Keys" in a key image or maybe even [K][E][Y]s might be interesting. Now that we are using ttk widgets for dialogs, I have thought about somehow using Python yellow and blue in an IDLE dialog style. But something else is always a higher priority. ---------- nosy: +cheryl.sabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 15:45:59 2020 From: report at bugs.python.org (William Pickard) Date: Tue, 11 Aug 2020 19:45:59 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597175159.09.0.478590287238.issue41523@roundup.psfhosted.org> William Pickard added the comment: In the lru_cache example, I think property is using the result of 'lru_cache(c)', which in turns returns a property instance, not a subtype instance. ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 15:56:59 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 11 Aug 2020 19:56:59 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597175819.9.0.870913707644.issue41523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > They are both descriptors, but cached_property is not a data descriptor. I think this is one of the key reasons this should not return "True" for isinstance(A.b, property). Also, cached_property does not allow you to implement a setter or a deleter. The docs say "Similar to property()" but not "the same as property()" ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 17:04:44 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Aug 2020 21:04:44 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597179884.73.0.717626791196.issue41504@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset d1d6a1c6abf76b27c247ead8a8872011db77cf58 by Guido van Rossum in branch '3.9': [3.9] bpo-41504: Add links to asttokens, leoAst, LibCST and parso to ast docs (GH-21773) (GH-21830) https://github.com/python/cpython/commit/d1d6a1c6abf76b27c247ead8a8872011db77cf58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 17:06:50 2020 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 11 Aug 2020 21:06:50 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597180010.72.0.238316711169.issue41504@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 17:21:54 2020 From: report at bugs.python.org (Edward K Ream) Date: Tue, 11 Aug 2020 21:21:54 +0000 Subject: [issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst In-Reply-To: <1596835160.37.0.4007435101.issue41504@roundup.psfhosted.org> Message-ID: <1597180914.83.0.766808198804.issue41504@roundup.psfhosted.org> Edward K Ream added the comment: You're welcome. It was a pleasure working with you all on this issue. I enjoyed learning the PR workflow, and I enjoyed the discussion of the merits. One last comment. Like everything in life, links and their implied endorsements are provisional. If a link ever becomes problematic, I would expect the python devs to remove it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 17:35:35 2020 From: report at bugs.python.org (Sydney Pemberton) Date: Tue, 11 Aug 2020 21:35:35 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1597150201.15.0.0801498523244.issue40994@roundup.psfhosted.org> Message-ID: Sydney Pemberton added the comment: If you look at the Jupyter notebook it should be fairly clear but to summarize here is the issue: class collections.abc.Container class collections.abc.Hashable class collections.abc.Sized class collections.abc.Callable ABCs for classes that provide respectively the methods __contains__(), __hash__(), __len__(), and __call__(). This should become class collections.abc.Container ABC for classes that provide the method __contains__(). class collections.abc.Hashable ABC for classes that provide the method __hash__(). class collections.abc.Sized ABC for classes that provide the method __len()__. class collections.abc.Callable ABC for classes that provide the method __call__(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 18:01:38 2020 From: report at bugs.python.org (William Meehan) Date: Tue, 11 Aug 2020 22:01:38 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far Message-ID: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> New submission from William Meehan : The existing implementation of PyOS_mystricmp increments both pointers as long as the first string hasn't reached the end yet. If the second string ends first, then we increment past the null byte. If there is a difference in the middle of the two strings, then the result actually compares the following pair of letters. e.g. PyOS_mystricmp("a", "\0") => 0 (should be positive) PyOS_mystricmp("foo", "fro") => 0 (should be negative) Similarly, PyOS_mystrnicmp increments the pointers in a condition before breaking out of the loop. It's possible to increment the first pointer without incrementing the second, and the result is the character past the null byte. e.g. PyOS_mystrnicmp("\0a", "\0b", 2) => 97 (should be negative) ---------- components: C API messages: 375203 nosy: wmeehan priority: normal severity: normal status: open title: PyOS_mystricmp advances pointers too far type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 18:21:11 2020 From: report at bugs.python.org (miss-islington) Date: Tue, 11 Aug 2020 22:21:11 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597184471.1.0.2760155951.issue41475@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20963 pull_request: https://github.com/python/cpython/pull/21835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 19:19:48 2020 From: report at bugs.python.org (William Pickard) Date: Tue, 11 Aug 2020 23:19:48 +0000 Subject: [issue41525] Python '--help' has corrupted text. Message-ID: <1597187988.07.0.0319767984896.issue41525@roundup.psfhosted.org> New submission from William Pickard : Running Python's '--help' argument yields some corrupted text: "-X dev: enable CPython??Ts ??odevelopment mode???, introducing additional runtime" ---------- components: Interpreter Core messages: 375204 nosy: WildCard65 priority: normal severity: normal status: open title: Python '--help' has corrupted text. type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 21:00:35 2020 From: report at bugs.python.org (Peter Lovett) Date: Wed, 12 Aug 2020 01:00:35 +0000 Subject: [issue41525] Python '--help' has corrupted text. In-Reply-To: <1597187988.07.0.0319767984896.issue41525@roundup.psfhosted.org> Message-ID: <1597194035.84.0.759653226991.issue41525@roundup.psfhosted.org> Peter Lovett added the comment: Also appearing in 3.9.0rc1 AMD64 I think it's transliterated Unicode, rather than an actual corruption. I'm on Win10, so it might be a Windows command shell issue (although it is showing bad in cmd, PS7 and PS5). Help messages should be plain ASCII to avoid this issue. ---------- nosy: +PeterL777 versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 21:04:09 2020 From: report at bugs.python.org (Peter Lovett) Date: Wed, 12 Aug 2020 01:04:09 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow Message-ID: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> New submission from Peter Lovett : "Setup was successful" dialog box text overflows the box, and last line can't be read. ---------- components: Installation files: Python 3.9.0rc1 setup successful overflow dialog box.PNG messages: 375206 nosy: PeterL777 priority: normal severity: normal status: open title: Python 3.9.0rc1 "setup successful" dialog box overflow type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49383/Python 3.9.0rc1 setup successful overflow dialog box.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 21:05:26 2020 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Wed, 12 Aug 2020 01:05:26 +0000 Subject: [issue10399] AST Optimization: inlining of function calls In-Reply-To: <1289593012.28.0.71054855235.issue10399@psf.upfronthosting.co.za> Message-ID: <1597194326.77.0.690079514078.issue10399@roundup.psfhosted.org> Change by Yonatan Goldschmidt : ---------- nosy: +Yonatan Goldschmidt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 22:54:55 2020 From: report at bugs.python.org (Maarten) Date: Wed, 12 Aug 2020 02:54:55 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1597200895.7.0.215107604344.issue10486@roundup.psfhosted.org> Maarten added the comment: The CGI examples of urwid (see http://urwid.org/manual/displaymodules.html#cgi-web-display-module-web-display) don't work on http.server because of missing meta variables. Using cgitb, I found out that the webdriver expects the environment variable `HTTP_X_URWID_METHOD` to be set. The javascript sets the "X-Urwid-Method" header (using XmlHttpRequest), but these are not visible by the CGI python script. So some scripts extra Meta-Variables neet to be set. I think section 4.1.18 applied because it is a http header that is being set. The sections says that these meta-variables are optional though. I argue that having access to extra headers is useful. ---------- nosy: +maarten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 11 23:52:19 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 12 Aug 2020 03:52:19 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597204339.37.0.414670991019.issue41526@roundup.psfhosted.org> Change by Zachary Ware : ---------- assignee: -> steve.dower components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 00:38:31 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 04:38:31 +0000 Subject: [issue41525] Python '--help' has corrupted text. In-Reply-To: <1597187988.07.0.0319767984896.issue41525@roundup.psfhosted.org> Message-ID: <1597207111.49.0.701411051723.issue41525@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +20964 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 00:46:04 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 04:46:04 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1597207564.86.0.803201456636.issue41524@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good catch! Do you mind to provide a PR for this William? ---------- keywords: +easy (C) nosy: +serhiy.storchaka stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 01:47:58 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 05:47:58 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597211278.59.0.854230049992.issue41521@roundup.psfhosted.org> Serhiy Storchaka added the comment: Should not such changes be widely discussed on the Python-Dev mailing list before merging? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 01:57:24 2020 From: report at bugs.python.org (wyz23x2) Date: Wed, 12 Aug 2020 05:57:24 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597211844.54.0.335821468959.issue41526@roundup.psfhosted.org> wyz23x2 added the comment: +1. I observe it too. ---------- nosy: +wyz23x2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 02:01:11 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 12 Aug 2020 06:01:11 +0000 Subject: [issue41525] Python '--help' has corrupted text. In-Reply-To: <1597187988.07.0.0319767984896.issue41525@roundup.psfhosted.org> Message-ID: <1597212071.32.0.732656907817.issue41525@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: serhiy , I can similar quotes present in Lib/pydoc_data/topics.py too which is autogenerated. Could this cause issues with pydoc too while reading topics? ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 02:11:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 06:11:56 +0000 Subject: [issue41525] Python '--help' has corrupted text. In-Reply-To: <1597187988.07.0.0319767984896.issue41525@roundup.psfhosted.org> Message-ID: <1597212716.97.0.579164252299.issue41525@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, but I think it is worth opening a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 02:31:07 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 12 Aug 2020 06:31:07 +0000 Subject: [issue41527] smart quotes in Lib/pydoc_data/topics.py file Message-ID: <1597213866.96.0.245351837241.issue41527@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Similar to issue41525 the generated file seems to contain smart quotes. This is used in help utility of the repl to explore different topics. git log -G'?' Lib/pydoc_data/topics.py | cat commit bc1c8af8ef2563802767404c78c8ec6d6a967897 Author: ?ukasz Langa Date: Mon Apr 27 22:44:04 2020 +0200 Python 3.9.0a6 commit fd757083df79c21eee862e8d89aeefefe45f64a0 Author: ?ukasz Langa Date: Tue Nov 19 12:17:21 2019 +0100 Python 3.9.0a1 commit aab0e57045f6badaa1404409626545785ef02d62 Author: ?ukasz Langa Date: Sun Feb 3 14:04:12 2019 +0100 [pydoc] Regenerate topics for v3.8.0a1 ---------- components: Library (Lib) messages: 375213 nosy: lukasz.langa, serhiy.storchaka, xtreak priority: normal severity: normal status: open title: smart quotes in Lib/pydoc_data/topics.py file type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 03:23:30 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 07:23:30 +0000 Subject: [issue41527] smart quotes in Lib/pydoc_data/topics.py file In-Reply-To: <1597213866.96.0.245351837241.issue41527@roundup.psfhosted.org> Message-ID: <1597217010.22.0.730051068722.issue41527@roundup.psfhosted.org> Serhiy Storchaka added the comment: Pydoc uses the backslashreplace error handler for characters not encodable with the output encoding (see issue21398 and issue23374). $ LC_ALL=uk_UA.koi8-u ./python -c "help('async')" [...] [2] A string literal appearing as the first statement in the function body is transformed into the function\u2019s "__doc__" attribute and therefore the function\u2019s *docstring*. [3] A string literal appearing as the first statement in the class body is transformed into the namespace\u2019s "__doc__" item and therefore the class\u2019s *docstring*. It would be better to replace non-ASCII quotation marks and dashes with corresponding ASCII quotation marks and hyphen-minus if they cannot be encoded. It may be a part of more general feature for transliterating non-ASCII characters to ASCII. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 03:36:26 2020 From: report at bugs.python.org (Marek Madejski) Date: Wed, 12 Aug 2020 07:36:26 +0000 Subject: [issue41528] Use math module in turtle Message-ID: <1597217786.87.0.701727445347.issue41528@roundup.psfhosted.org> New submission from Marek Madejski : "Turtle" module is closely related to geometry, which is also covered by "math" (and "cmath") module. Nevertheless, in many places in "turtle" the wheel is being reinvented. Currently, only ? and basing trig functions are used. Performance may be improved by such refactor (for example, by using "math.hypot" instead of manual calculation of vector norm). ---------- components: Library (Lib) messages: 375215 nosy: TrangOul priority: normal pull_requests: 20965 severity: normal status: open title: Use math module in turtle type: performance versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 04:23:18 2020 From: report at bugs.python.org (Andreas Jung) Date: Wed, 12 Aug 2020 08:23:18 +0000 Subject: [issue41529] Unable to compile 3.0b3 on Ubuntu systems: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Message-ID: <1597220598.27.0.292747751554.issue41529@roundup.psfhosted.org> New submission from Andreas Jung : Building 3.9.0b3 fails on Ubuntu 19 and 20 in same way: ./python -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = './python' isolated = 0 environment = 0 user site = 1 import site = 0 sys._base_executable = '/home/ajung/src/pp.server/Python-3.9.0b3/python' sys.base_prefix = '/opt/python-3.9.0b3' sys.base_exec_prefix = '/opt/python-3.9.0b3' sys.platlibdir = 'lib' sys.executable = '/home/ajung/src/pp.server/Python-3.9.0b3/python' sys.prefix = '/opt/python-3.9.0b3' sys.exec_prefix = '/opt/python-3.9.0b3' sys.path = [ '/opt/python-3.9.0b3/lib/python39.zip', '/opt/python-3.9.0b3/lib/python3.9', '/opt/python-3.9.0b3/lib/lib-dynload', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' Current thread 0x00007f824c25c280 (most recent call first): generate-posix-vars failed make: *** [Makefile:612: pybuilddir.txt] Error 1 ---------- components: Build messages: 375216 nosy: ajung priority: normal severity: normal status: open title: Unable to compile 3.0b3 on Ubuntu systems: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 04:53:24 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 12 Aug 2020 08:53:24 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597222404.87.0.491722699514.issue41521@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0e95bbf08571e98f4b688524efc2dcf20d315d91 by Victor Stinner in branch 'master': bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825) https://github.com/python/cpython/commit/0e95bbf08571e98f4b688524efc2dcf20d315d91 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 05:54:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 09:54:27 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597226067.86.0.128194033826.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: Serhiy: > Should not such changes be widely discussed on the Python-Dev mailing list before merging? I would prefer avoiding python-dev, since there are many trolls there who like to argue but not try to fix problem. See the recent discussion about the PEP 8 commit message for example. I opened https://github.com/python/devguide/issues/605 to define general guidelines about terminology. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 06:22:04 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 12 Aug 2020 10:22:04 +0000 Subject: [issue33786] @asynccontextmanager doesn't work well with async generators In-Reply-To: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> Message-ID: <1597227724.26.0.80743376366.issue33786@roundup.psfhosted.org> Ned Deily added the comment: Indeed, the backport to 3.7 slipped through the cracks somehow; we should fix that. Thanks for bringing this up! ---------- resolution: fixed -> stage: resolved -> backport needed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 06:36:24 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 12 Aug 2020 10:36:24 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597228584.93.0.574215180951.issue41475@roundup.psfhosted.org> Ned Deily added the comment: New changeset a8ad127c222456e614b59990f113e93e95593155 by Miss Islington (bot) in branch '3.7': bpo-41475: Fix note in "What's new in 3.7" (GH-21733) (GH-21835) https://github.com/python/cpython/commit/a8ad127c222456e614b59990f113e93e95593155 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 06:38:41 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 12 Aug 2020 10:38:41 +0000 Subject: [issue41475] Make __future__.annotations default 3.10 in What's New 3.7 In-Reply-To: <1596551798.69.0.0710620145203.issue41475@roundup.psfhosted.org> Message-ID: <1597228721.91.0.0638428552011.issue41475@roundup.psfhosted.org> Ned Deily added the comment: New changeset 622d90f65ca9f0a6ddf255a727de003b92dca01d by Miss Islington (bot) in branch '3.8': bpo-41475: Fix note in "What's new in 3.7" (GH-21733) (GH-21833) https://github.com/python/cpython/commit/622d90f65ca9f0a6ddf255a727de003b92dca01d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 06:53:28 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 12 Aug 2020 10:53:28 +0000 Subject: [issue41455] Python Devguide differs from python docs In-Reply-To: <1596304691.88.0.58289993883.issue41455@roundup.psfhosted.org> Message-ID: <1597229608.07.0.207221841564.issue41455@roundup.psfhosted.org> Ned Deily added the comment: New changeset f3b6f3cd9ac6931ae346cf298fae7b691d5656bb by Miss Islington (bot) in branch '3.7': bpo-41455: Provide a link to how the third generation is collected in the GC docs (GH-21703) (GH-21788) https://github.com/python/cpython/commit/f3b6f3cd9ac6931ae346cf298fae7b691d5656bb ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:26:03 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 11:26:03 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597231563.37.0.147973968526.issue41520@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch nosy: +vstinner nosy_count: 3.0 -> 4.0 pull_requests: +20966 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:28:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 11:28:11 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597231691.63.0.40793912254.issue41520@roundup.psfhosted.org> STINNER Victor added the comment: I proposed a fix: PR 21838. Would you mind to review it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:32:20 2020 From: report at bugs.python.org (E. Paine) Date: Wed, 12 Aug 2020 11:32:20 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1597231940.32.0.589178511207.issue40468@roundup.psfhosted.org> E. Paine added the comment: Reflecting on #41522, I decided that it would be best to work on this issue before going any further with that one (partly because it would require us to redo some of the work and also because this issue should have a higher priority). I have put together a demonstration which is mostly based on your comments on that issue (like before, I did the minimum required to make the window show). The exact list of (user-visible) changes is as follows: Fonts/Tabs: - rename to "Fonts" - move indentation width to the new "Editor/Shell" tab and use a spinbox Highlights - rename to "Colours" General - split into two tabs titled "Editor/Shell" (containing Editor & Shell frames) and "Windows" (containing Window frame) - move additional help sources to "Extensions" (I believe this makes more sense than having it in any of the other tabs) I would also suggest, if there was a patch/PR for this issue, we split the "Extensions" page into its own class. I also think the "Keys" page would benefit from some work but I will not include that in this issue. ---------- nosy: +cheryl.sabella, markroseman, taleinat title: IDLE split "general" into two tabs -> IDLE: configdialog tab rearrange versions: +Python 3.10 -Python 3.7 Added file: https://bugs.python.org/file49384/idle-configdialog-rearrange.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:42:16 2020 From: report at bugs.python.org (Joshua) Date: Wed, 12 Aug 2020 11:42:16 +0000 Subject: [issue41530] Unhandled exceptions in zoneinfo.ZoneInfo constructor Message-ID: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> New submission from Joshua : Attempting to parse specific keys in zoneinfo.ZoneInfo with tzdata installed will raise unhandled exceptions e.g. on windows >>> import zoneinfo >>> zoneinfo.ZoneInfo('Pacific') PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\Python39\\lib\\site-packages\\tzdata\\zoneinfo\\Pacific' >>> import zoneinfo >>> zoneinfo.ZoneInfo('__init__.py') ValueError: Invalid TZif file: magic not found This happens when non TZif files or directories in the tzdata.zoneinfo module are used as keys. ---------- components: Library (Lib) messages: 375225 nosy: josh.ja.butt priority: normal severity: normal status: open title: Unhandled exceptions in zoneinfo.ZoneInfo constructor type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:43:31 2020 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Aug 2020 11:43:31 +0000 Subject: [issue41530] Unhandled exceptions in zoneinfo.ZoneInfo constructor In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597232611.4.0.839303585766.issue41530@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +20967 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:47:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 11:47:35 +0000 Subject: [issue41530] Unhandled exceptions in zoneinfo.ZoneInfo constructor In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597232855.65.0.538294397521.issue41530@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:49:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 11:49:35 +0000 Subject: [issue41530] Unhandled exceptions in zoneinfo.ZoneInfo constructor In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597232975.07.0.112226989104.issue41530@roundup.psfhosted.org> STINNER Victor added the comment: Hi. It seems like you are running Windows. About the permission error, how did you install tzdata? Did you install it as an admin user and do you run Python as a different user? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:52:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 11:52:23 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597233143.04.0.809090201418.issue40949@roundup.psfhosted.org> STINNER Victor added the comment: PPC64LE RHEL7 Refleaks 3.9: https://buildbot.python.org/all/#/builders/704/builds/87 0:12:25 load avg: 8.94 [242/425/1] test_socket failed (env changed) (2 min 43 sec) -- running: test_decimal (2 min 26 sec), test_peg_generator (12 min 23 sec), test_signal (6 min 20 sec), test_weakref (2 min 41 sec), test_multiprocessing_fork (2 min 36 sec), test_venv (2 min 33 sec) beginning 6 repetitions 123456 .....Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) Warning -- Dangling thread: Warning -- Dangling thread: Warning -- Dangling thread: Warning -- Dangling thread: <_MainThread(MainThread, started 70367377380144)> Warning -- Dangling thread: . ---------- title: test_socket: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) -> test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 07:53:45 2020 From: report at bugs.python.org (Joshua) Date: Wed, 12 Aug 2020 11:53:45 +0000 Subject: [issue41530] Unhandled exceptions in zoneinfo.ZoneInfo constructor In-Reply-To: <1597232975.07.0.112226989104.issue41530@roundup.psfhosted.org> Message-ID: Joshua added the comment: tzdata was installed as an admin user, however this behaviour was reproducible on a linux installation where for the ZoneInfo.('Pacific') instance an IsADirectoryError would instead be raised. On Wed, Aug 12, 2020 at 9:50 PM STINNER Victor wrote: > > STINNER Victor added the comment: > > Hi. It seems like you are running Windows. > > About the permission error, how did you install tzdata? Did you install it > as an admin user and do you run Python as a different user? > > ---------- > nosy: +vstinner > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 08:19:24 2020 From: report at bugs.python.org (Ned Deily) Date: Wed, 12 Aug 2020 12:19:24 +0000 Subject: [issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code In-Reply-To: <1581171504.91.0.0818206259105.issue39584@roundup.psfhosted.org> Message-ID: <1597234764.45.0.245842247745.issue39584@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 08:49:20 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 12 Aug 2020 12:49:20 +0000 Subject: [issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code In-Reply-To: <1581171504.91.0.0818206259105.issue39584@roundup.psfhosted.org> Message-ID: <1597236560.15.0.732569716393.issue39584@roundup.psfhosted.org> Ronald Oussoren added the comment: I expect that this is more a problem with how memory management works on macOS, the freeze and crash is likely an indication of eager allocation of memory by the system. It is far from sure if implementing a workaround is feasible, the upper limit for safe calls to ftruncate likely depends on the amount of RAM in the system. BTW. The sample code tries to allocate well over a petabyte of memory, how realistic is that code? It might be good enough to document that using very large amounts of memory with multiprocessing.shared_memory causes problems on macOS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 08:53:54 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 12 Aug 2020 12:53:54 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597236834.55.0.16763950767.issue41520@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +20968 pull_request: https://github.com/python/cpython/pull/21840 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 08:53:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 12:53:58 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597236838.79.0.512666542854.issue41520@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 369a1cbdee14d9f27356fb3a8bb21e4fde289d25 by Victor Stinner in branch 'master': bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838) https://github.com/python/cpython/commit/369a1cbdee14d9f27356fb3a8bb21e4fde289d25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 08:54:01 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 12 Aug 2020 12:54:01 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597236841.24.0.610370688494.issue41520@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20969 pull_request: https://github.com/python/cpython/pull/21841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:12:09 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 12 Aug 2020 13:12:09 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597237929.1.0.033670271467.issue41520@roundup.psfhosted.org> miss-islington added the comment: New changeset afff51fc09993dff1693aacb440221314b163409 by Miss Islington (bot) in branch '3.8': bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838) https://github.com/python/cpython/commit/afff51fc09993dff1693aacb440221314b163409 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:13:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:13:24 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597238004.12.0.0960426420276.issue41530@roundup.psfhosted.org> STINNER Victor added the comment: Oh right, 'Pacific' is a directory, not a valid zone, and so ZoneInfoNotFoundError should be raised. I see. Example: $ ./python -m venv env $ env/bin/python -m pip install tzdata $ env/bin/python # ZoneInfoNotFoundError expected, get IsADirectoryError >>> import zoneinfo; zoneinfo.ZoneInfo('Pacific') Traceback (most recent call last): File "", line 1, in File "/home/vstinner/python/master/Lib/zoneinfo/_common.py", line 12, in load_tzdata return importlib.resources.open_binary(package_name, resource_name) File "/home/vstinner/python/master/Lib/importlib/resources.py", line 40, in open_binary return reader.open_resource(resource) File "/home/vstinner/python/master/Lib/importlib/abc.py", line 419, in open_resource return self.files().joinpath(resource).open('rb') File "/home/vstinner/python/master/Lib/pathlib.py", line 1238, in open return io.open(self, mode, buffering, encoding, errors, newline, IsADirectoryError: [Errno 21] Is a directory: '/home/vstinner/python/master/env/lib/python3.10/site-packages/tzdata/zoneinfo/Pacific' # valid zone >>> import zoneinfo; zoneinfo.ZoneInfo('Pacific/Noumea') zoneinfo.ZoneInfo(key='Pacific/Noumea') # raise ZoneInfoNotFoundError as expected (from FileNotFoundError) >>> import zoneinfo; zoneinfo.ZoneInfo('xxx') Traceback (most recent call last): File "/home/vstinner/python/master/Lib/zoneinfo/_common.py", line 12, in load_tzdata return importlib.resources.open_binary(package_name, resource_name) File "/home/vstinner/python/master/Lib/importlib/resources.py", line 40, in open_binary return reader.open_resource(resource) File "/home/vstinner/python/master/Lib/importlib/abc.py", line 419, in open_resource return self.files().joinpath(resource).open('rb') File "/home/vstinner/python/master/Lib/pathlib.py", line 1238, in open return io.open(self, mode, buffering, encoding, errors, newline, File "/home/vstinner/python/master/Lib/pathlib.py", line 1106, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: '/home/vstinner/python/master/env/lib/python3.10/site-packages/tzdata/zoneinfo/xxx' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/home/vstinner/python/master/Lib/zoneinfo/_common.py", line 24, in load_tzdata raise ZoneInfoNotFoundError(f"No time zone found with key {key}") zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key xxx' ---------- title: Unhandled exceptions in zoneinfo.ZoneInfo constructor -> zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:13:12 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 12 Aug 2020 13:13:12 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597237992.78.0.00556891708954.issue41520@roundup.psfhosted.org> miss-islington added the comment: New changeset 90eff4ed4445a0fa9d8cdf74c0f86c50ed510dad by Miss Islington (bot) in branch '3.9': bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838) https://github.com/python/cpython/commit/90eff4ed4445a0fa9d8cdf74c0f86c50ed510dad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:16:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:16:13 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597238173.89.0.662433035839.issue41530@roundup.psfhosted.org> STINNER Victor added the comment: On Linux, converting IsADirectoryError to ZoneInfoNotFoundError is easy. But on Windows, I don't think that converting any PermissionError into a ZoneInfoNotFoundError is a good idea. Maybe if PermissionError happens, we should check if the path is a directory. Pseudo-code: try: except OSError as exc: if os.path.isdir(zone_path): raise ZoneInfoNotFoundError else: raise ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:20:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:20:37 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597238437.23.0.800079293626.issue41530@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I dislike Roundup UI. I didn't notice that a PR was submitted: PR 21839 (now closed). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:21:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:21:27 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597238487.05.0.181387324913.issue41520@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Matthias Bussonnier for the fix. The regression should now be fixed. Also, I converted your reproducer into a regression test. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:24:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:24:07 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597238647.83.0.366900355733.issue40949@roundup.psfhosted.org> STINNER Victor added the comment: While running "./python -m test.bisect_cmd test_socket --fail-env-changed -v -o bisect" 6x in parallel (with a different filename for the -o option), I got this error: testSourceAddress (test.test_socket.NetworkConnectionAttributesTest) ... Warning -- Unraisable exception Exception ignored in thread started by: > Traceback (most recent call last): File "/home/vstinner/cpython/Lib/test/test_socket.py", line 396, in clientRun self.clientTearDown() File "/home/vstinner/cpython/Lib/test/test_socket.py", line 5164, in clientTearDown self.cli.close() AttributeError: 'NetworkConnectionAttributesTest' object has no attribute 'cli' By the way, I was also running "./python -m test -j20 -r -F" in parallel and it failed with the following error which isn't very helpful :-( test test_socket failed -- multiple errors occurred; run in verbose mode for details ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:24:28 2020 From: report at bugs.python.org (Joshua) Date: Wed, 12 Aug 2020 13:24:28 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597238437.23.0.800079293626.issue41530@roundup.psfhosted.org> Message-ID: Joshua added the comment: I had opened a PR which just caught IsADirectoryError and PermissionError but closed it as you'd mentioned that handling PermissionError that way probably would not be the best, and I agree. I can reopen and modify to check path on OSerror if you'd like otherwise feel free to handle however you see fit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:25:21 2020 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 12 Aug 2020 13:25:21 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597238721.62.0.414748395277.issue41530@roundup.psfhosted.org> Paul Ganssle added the comment: I think that `ZoneInfo('__init__.py')` is also a problem, but a slightly different one. That comes from the fact that in order to support `importlib.resources`, each of the zoneinfo subdirectories needs an `__init__.py`, but the ZoneInfo constructor should probably ignore those, since they are added by `tzdata` and not actually part of a tzdata distribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:26:50 2020 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 12 Aug 2020 13:26:50 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597232536.81.0.285347310196.issue41530@roundup.psfhosted.org> Message-ID: <1597238810.87.0.572588778534.issue41530@roundup.psfhosted.org> Paul Ganssle added the comment: By the way, it might be easiest to start with a PR against backports.zoneinfo, because I have a lot more linting, coverage and format checks set up there: https://github.com/pganssle/zoneinfo ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:35:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:35:36 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597239336.89.0.949952532113.issue40949@roundup.psfhosted.org> STINNER Victor added the comment: More logs before testSourceAddress failure: (...) testSmallReadNonBlocking (test.test_socket.UnbufferedFileObjectClassTestCase) ... ok testUnbufferedRead (test.test_socket.UnbufferedFileObjectClassTestCase) ... ok testWriteNonBlocking (test.test_socket.UnbufferedFileObjectClassTestCase) ... ok testAttributes (test.test_socket.LineBufferedFileObjectClassTestCase) ... ok testMakefileAfterMakefileClose (test.test_socket.LineBufferedFileObjectClassTestCase) ... ok testReadAfterTimeout (test.test_socket.LineBufferedFileObjectClassTestCase) ... ok testCloseAfterMakefile (test.test_socket.SmallBufferedFileObjectClassTestCase) ... ok testMakefileAfterMakefileClose (test.test_socket.SmallBufferedFileObjectClassTestCase) ... ok testUnbufferedRead (test.test_socket.SmallBufferedFileObjectClassTestCase) ... ok testAttributes (test.test_socket.UnicodeReadFileObjectClassTestCase) ... ok testClosedAttr (test.test_socket.UnicodeReadFileObjectClassTestCase) ... ok testMakefileAfterMakefileClose (test.test_socket.UnicodeReadFileObjectClassTestCase) ... ok testReadAfterTimeout (test.test_socket.UnicodeReadFileObjectClassTestCase) ... ok testReadline (test.test_socket.UnicodeReadFileObjectClassTestCase) ... ok testCloseAfterMakefile (test.test_socket.UnicodeWriteFileObjectClassTestCase) ... ok testClosedAttr (test.test_socket.UnicodeWriteFileObjectClassTestCase) ... ok testFullRead (test.test_socket.UnicodeWriteFileObjectClassTestCase) ... ok testMakefileAfterMakefileClose (test.test_socket.UnicodeWriteFileObjectClassTestCase) ... ok testReadAfterTimeout (test.test_socket.UnicodeWriteFileObjectClassTestCase) ... ok testRealClose (test.test_socket.UnicodeWriteFileObjectClassTestCase) ... ok testFullRead (test.test_socket.UnicodeReadWriteFileObjectClassTestCase) ... ok testMakefileAfterMakefileClose (test.test_socket.UnicodeReadWriteFileObjectClassTestCase) ... ok testReadAfterTimeout (test.test_socket.UnicodeReadWriteFileObjectClassTestCase) ... ok testReadline (test.test_socket.UnicodeReadWriteFileObjectClassTestCase) ... ok testSmallRead (test.test_socket.UnicodeReadWriteFileObjectClassTestCase) ... ok testUnbufferedRead (test.test_socket.UnicodeReadWriteFileObjectClassTestCase) ... ok test_create_connection (test.test_socket.NetworkConnectionNoServer) ... ok test_create_connection_timeout (test.test_socket.NetworkConnectionNoServer) ... ok testSourceAddress (test.test_socket.NetworkConnectionAttributesTest) ... Warning -- Unraisable exception Exception ignored in thread started by: > Traceback (most recent call last): File "/home/vstinner/cpython/Lib/test/test_socket.py", line 396, in clientRun self.clientTearDown() File "/home/vstinner/cpython/Lib/test/test_socket.py", line 5164, in clientTearDown self.cli.close() AttributeError: 'NetworkConnectionAttributesTest' object has no attribute 'cli' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:36:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:36:38 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597239398.96.0.26618112198.issue40949@roundup.psfhosted.org> STINNER Victor added the comment: Another error while running "./python -m test test_socket --fail-env-changed -j20 -r -F -w": NetworkConnectionNoServer.test_create_connection() fails with "AssertionError: OSError not raised". 0:01:13 load avg: 69.29 [ 12/1] test_socket failed (1 min 9 sec) -- running: test_socket (...) /home/vstinner/cpython/Lib/test/test_socket.py:5120: ResourceWarning: unclosed socket.create_connection((HOST, port)) ResourceWarning: Enable tracemalloc to get the object allocation traceback test test_socket failed -- Traceback (most recent call last): File "/home/vstinner/cpython/Lib/test/test_socket.py", line 5120, in test_create_connection socket.create_connection((HOST, port)) AssertionError: OSError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:45:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:45:14 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597239914.14.0.606195150707.issue40949@roundup.psfhosted.org> STINNER Victor added the comment: Oh, by design, NetworkConnectionNoServer.test_create_connection() has a race condition: port = socket_helper.find_unused_port() with self.assertRaises(OSError) as cm: socket.create_connection((HOST, port)) If another process starts to listen to the "unused" port between find_unused_port() call and the create_connection() call, create_connection() succeed and the test fails. Maybe I should just add a comment mentioning the race condition. Or we should find a more reliable way to get an error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:50:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 13:50:11 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597240211.22.0.605389599817.issue40949@roundup.psfhosted.org> STINNER Victor added the comment: I tried various commands to reproduce the "test_socket (env changed)" but I failed to find a reliable way to trigger this bug. I ran test.bisect_cmd for 3h, with other commands run in parallel to stress the machine (system load between 8 and 30). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 09:50:14 2020 From: report at bugs.python.org (Vinay Sharma) Date: Wed, 12 Aug 2020 13:50:14 +0000 Subject: [issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code In-Reply-To: <1581171504.91.0.0818206259105.issue39584@roundup.psfhosted.org> Message-ID: <1597240214.74.0.815687616461.issue39584@roundup.psfhosted.org> Vinay Sharma added the comment: I have 8GB of ram and 128 GB of hard disk. Now, creating a shared memory segment of size 10^12 (1 terabyte) somehow succeeds. Creating a shared memory segment of 10^15 (1 petabyte), mmap (not ftruncate) throws an error stating cannot allocate memory. Creating a shared memory segment of 10^18 (1 exabyte), causes the system to crash. Now, I understand that this should be documented for a genuine user. But, if documented this can be used by malicious softwares using python to crash systems abruptly. Also, I understand that this is an issue with macos, but shouldn't python handle this so that atleast python's APIs are safe. Creating shared memory segments of size 1 exabyte are not reasonable, but if some makes a mistake then, we must throw an error instead of a crash. Also, can we set a max limit on creating shared memory segments to 1TB ? because no one would genuinily need to create a segment of that size on a single machine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 10:07:46 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 12 Aug 2020 14:07:46 +0000 Subject: [issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code In-Reply-To: <1581171504.91.0.0818206259105.issue39584@roundup.psfhosted.org> Message-ID: <1597241266.57.0.0895941210571.issue39584@roundup.psfhosted.org> Ronald Oussoren added the comment: A workaround in the implementation of multiprocessing.SharedMemory is IMHO acceptable, tweaking os.ftruncate less so. Note that a Python script can already cause problems on systems by using APIs as intended (such as using shutil.rmtree on the user's home directory). There's balance between compensating for platform deviancies and having clean and performant implementation. BTW. We should file an issue with Apple about this. I'll do so when I've had time to crash a test VM using the C code you provided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 10:46:45 2020 From: report at bugs.python.org (Joshua) Date: Wed, 12 Aug 2020 14:46:45 +0000 Subject: [issue41530] zoneinfo: ZoneInfo raises IsADirectoryError instead of ZoneInfoNotFoundError In-Reply-To: <1597238810.87.0.572588778534.issue41530@roundup.psfhosted.org> Message-ID: Joshua added the comment: I'll reopen the PR with an attempted resolution of the OSError related issues however. In my quick testing it seems at least on Linux backports.zoneinfo segfaults when trying `ZoneInfo('__init__.py')` so that might be a larger issue for Paul to look into. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 10:52:16 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 12 Aug 2020 14:52:16 +0000 Subject: [issue40979] typing module docs: keep text, add subsections In-Reply-To: <1592164571.1.0.235029301981.issue40979@roundup.psfhosted.org> Message-ID: <1597243936.97.0.381601160983.issue40979@roundup.psfhosted.org> Change by Guido van Rossum : ---------- pull_requests: +20970 pull_request: https://github.com/python/cpython/pull/21843 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:14:28 2020 From: report at bugs.python.org (Matthias Bussonnier) Date: Wed, 12 Aug 2020 15:14:28 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597245267.99.0.343558098947.issue41520@roundup.psfhosted.org> Matthias Bussonnier added the comment: > Thanks Matthias Bussonnier for the fix. Thank *YOU* for the fix, and the bug report is initially from tcaswell. At least on 3.8 branch this is fixed for me. Just for completeness, this was discovered as in IPython we try to guess whether "enter" is "insert new line" or "execute", and `1 is 1` would keep adding new lines. Much love for the fast turnaround; looking fwd to 3.9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:28:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 15:28:10 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597246090.04.0.00984945924831.issue41520@roundup.psfhosted.org> STINNER Victor added the comment: Thanks tcaswell in this case ;-) ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:41:38 2020 From: report at bugs.python.org (Matthias Klose) Date: Wed, 12 Aug 2020 15:41:38 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597246898.48.0.0339151230377.issue40204@roundup.psfhosted.org> Matthias Klose added the comment: 3.9.0 rc1 fails to build the docs with Sphinx 3.2.0, even with setting c_allow_pre_v3 = True c_warn_on_allowed_pre_v3 = False Warning, treated as error: /packages/python/3.9/python3.9-3.9.0~rc1/Doc/c-api/buffer.rst:92:Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*buf -----^ make[1]: *** [Makefile:52: build] Error 2 With 3.2.0, you still need to build without -W ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:42:56 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 12 Aug 2020 15:42:56 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter Message-ID: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> New submission from Miro Hron?ok : Consider this reproducer.py: import sys LEN = int(sys.argv[1]) with open('big_dict.py', 'w') as f: print('INTS = {', file=f) for i in range(LEN): print(f' {i}: None,', file=f) print('}', file=f) import big_dict assert len(big_dict.INTS) == LEN, len(big_dict.INTS) And run it with any number > 65535: $ python3.9 reproducer.py 65536 Traceback (most recent call last): File "/tmp/reproducer.py", line 12, in assert len(big_dict.INTS) == LEN, len(big_dict.INTS) AssertionError: 65535 This has not happened on python 3.8. This also happens with PYTHONOLDPARSER=1. ---------- messages: 375255 nosy: hroncok priority: normal severity: normal status: open title: Python 3.9 regression: Literal dict with > 65535 items are one item shorter type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:45:10 2020 From: report at bugs.python.org (=?utf-8?q?Zbyszek_J=C4=99drzejewski-Szmek?=) Date: Wed, 12 Aug 2020 15:45:10 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597247110.3.0.747816400255.issue41531@roundup.psfhosted.org> Zbyszek J?drzejewski-Szmek added the comment: Also reproduces with today's git. ---------- nosy: +zbysz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:50:19 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 12 Aug 2020 15:50:19 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597247419.9.0.220318411244.issue41531@roundup.psfhosted.org> Miro Hron?ok added the comment: It appears that the 65535 key is missing regardless of the LEN value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 11:56:21 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 12 Aug 2020 15:56:21 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597247781.14.0.620893878098.issue41531@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:05:44 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 12 Aug 2020 16:05:44 +0000 Subject: [issue41528] Use math module in turtle In-Reply-To: <1597217786.87.0.701727445347.issue41528@roundup.psfhosted.org> Message-ID: <1597248344.8.0.676385326159.issue41528@roundup.psfhosted.org> Vedran ?a?i? added the comment: Well, if you want to exploit Python features in full, I'd suggest cmath as even better library. Turtle position is just a complex numbers, and cmath has direct conversion from and to polar coordinates, which is all that's needed for basic commands. :-) ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:08:28 2020 From: report at bugs.python.org (=?utf-8?q?Zbyszek_J=C4=99drzejewski-Szmek?=) Date: Wed, 12 Aug 2020 16:08:28 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597248508.92.0.471056679059.issue41531@roundup.psfhosted.org> Zbyszek J?drzejewski-Szmek added the comment: Bisect says 8a4cd700a7426341c2074a2b580306d2d60ec839 is the first bad commit. Considering that 0xFFFF appears a few times in that patch, that seems plausible ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:09:09 2020 From: report at bugs.python.org (Ammar Askar) Date: Wed, 12 Aug 2020 16:09:09 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597248549.73.0.707957625479.issue41531@roundup.psfhosted.org> Change by Ammar Askar : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:11:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 16:11:30 +0000 Subject: [issue39320] Handle unpacking of */** arguments and rvalues in the compiler In-Reply-To: <1578918490.54.0.342025462897.issue39320@roundup.psfhosted.org> Message-ID: <1597248690.1.0.131095873516.issue39320@roundup.psfhosted.org> STINNER Victor added the comment: These changes introduced a regression: bpo-41531 "Python 3.9 regression: Literal dict with > 65535 items are one item shorter". ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:17:22 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 12 Aug 2020 16:17:22 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597249042.22.0.187815454513.issue41531@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:22:18 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 16:22:18 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597249338.78.0.398397343836.issue41531@roundup.psfhosted.org> Change by STINNER Victor : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:22:24 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 16:22:24 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597249344.79.0.531094709309.issue41531@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +3.9regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:26:59 2020 From: report at bugs.python.org (hai shi) Date: Wed, 12 Aug 2020 16:26:59 +0000 Subject: [issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5) In-Reply-To: <1591885643.11.0.227802495041.issue40949@roundup.psfhosted.org> Message-ID: <1597249619.1.0.513141898274.issue40949@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:36:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 16:36:42 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597250202.2.0.669598409915.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20971 pull_request: https://github.com/python/cpython/pull/21844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:37:48 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Aug 2020 16:37:48 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597250268.06.0.194561017762.issue39994@roundup.psfhosted.org> Irit Katriel added the comment: This change makes a difference in semantics (perhaps a good one) in this case: import pprint class MyDict(dict): def __repr__(self): return 'I do my own thing'*50 if __name__ == '__main__': d=MyDict() for i in range(50): d['a%s'%i] = i pprint.pprint(d) Before the change MyDict.__repr__ is ignored and the dict contents are printed. After the change it prints "I do my own thing" 50 times. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:43:17 2020 From: report at bugs.python.org (=?utf-8?b?6rmA7KeE7ISc?=) Date: Wed, 12 Aug 2020 16:43:17 +0000 Subject: [issue41532] Import precedence is broken in some library Message-ID: <1597250597.2.0.528794904808.issue41532@roundup.psfhosted.org> New submission from ??? : I found this behavior by chance: >>> with open('tokenize.py', 'w') as f: ... f.write("print('This is so sad')") ... >>> import linecache This is so sad >>> path/of/python/Lib/linecache.py: import functools import sys import os import tokenize [...] Meanwhile, >>> with open('functools.py', 'w') as f: ... f.write("print('This is so sad')") ... >>> import linecache >>> It seems for me to be broken: 'import' doesn't have clear precedence. ---------- components: Library (Lib) messages: 375262 nosy: contact priority: normal severity: normal status: open title: Import precedence is broken in some library type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:51:34 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Aug 2020 16:51:34 +0000 Subject: [issue41532] Import precedence is broken in some library In-Reply-To: <1597250597.2.0.528794904808.issue41532@roundup.psfhosted.org> Message-ID: <1597251094.09.0.60544099637.issue41532@roundup.psfhosted.org> Irit Katriel added the comment: Did you restart python before the functools test? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:52:27 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 12 Aug 2020 16:52:27 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597251147.5.0.202211914219.issue41531@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 12:58:04 2020 From: report at bugs.python.org (Jinseo Kim) Date: Wed, 12 Aug 2020 16:58:04 +0000 Subject: [issue41532] Import precedence is broken in some library In-Reply-To: <1597250597.2.0.528794904808.issue41532@roundup.psfhosted.org> Message-ID: <1597251484.59.0.850601510664.issue41532@roundup.psfhosted.org> Jinseo Kim added the comment: Yes, I restarted and cleared directory before each test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:06:04 2020 From: report at bugs.python.org (William Meehan) Date: Wed, 12 Aug 2020 17:06:04 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1597251964.27.0.624744929863.issue41524@roundup.psfhosted.org> Change by William Meehan : ---------- keywords: +patch pull_requests: +20972 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:06:08 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 12 Aug 2020 17:06:08 +0000 Subject: [issue41532] Import precedence is broken in some library In-Reply-To: <1597250597.2.0.528794904808.issue41532@roundup.psfhosted.org> Message-ID: <1597251968.11.0.288611642967.issue41532@roundup.psfhosted.org> Irit Katriel added the comment: What is your environment - system and python version? I get this on master checkout on windows 10: Running Release|Win32 interpreter... Python 3.10.0a0 (heads/master:46e19b61d3, Aug 12 2020, 18:02:36) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> with open('functools.py', 'w') as f: ... f.write("print('This is so sad')") ... 23 >>> import linecache This is so sad Traceback (most recent call last): File "", line 1, in File "C:\Users\User\src\cpython\lib\linecache.py", line 11, in import tokenize File "C:\Users\User\src\cpython\lib\tokenize.py", line 32, in import re File "C:\Users\User\src\cpython\lib\re.py", line 315, in @functools.lru_cache(_MAXCACHE) AttributeError: module 'functools' has no attribute 'lru_cache' >>> quit() C:\Users\User\src\cpython>del functools.py C:\Users\User\src\cpython>python Running Release|Win32 interpreter... Python 3.10.0a0 (heads/master:46e19b61d3, Aug 12 2020, 18:02:36) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> with open('tokenize.py', 'w') as f: ... f.write("print('This is so sad')") ... 23 >>> import linecache This is so sad >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:09:40 2020 From: report at bugs.python.org (Jinseo Kim) Date: Wed, 12 Aug 2020 17:09:40 +0000 Subject: [issue41532] Import precedence is broken in some library In-Reply-To: <1597250597.2.0.528794904808.issue41532@roundup.psfhosted.org> Message-ID: <1597252180.37.0.573899595019.issue41532@roundup.psfhosted.org> Jinseo Kim added the comment: My environment is Ubuntu 18.04.4 Python version: Python 3.8.0 (default, Oct 28 2019, 16:14:01) [GCC 8.3.0] on linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:22:00 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 17:22:00 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597252920.09.0.791215378368.issue41531@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Interpreter Core nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:27:41 2020 From: report at bugs.python.org (Tony) Date: Wed, 12 Aug 2020 17:27:41 +0000 Subject: [issue41533] Bugfix: va_build_stack leaks the stack if do_mkstack fails Message-ID: <1597253261.51.0.12759996374.issue41533@roundup.psfhosted.org> New submission from Tony : When calling a function a stack is allocated via va_build_stack. There is a leak that happens if do_mkstack fails in it. ---------- messages: 375267 nosy: tontinton priority: normal severity: normal status: open title: Bugfix: va_build_stack leaks the stack if do_mkstack fails _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:28:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 17:28:13 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597253293.7.0.774117509314.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20973 pull_request: https://github.com/python/cpython/pull/21846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:28:52 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 17:28:52 +0000 Subject: [issue41532] Import precedence is broken in some library In-Reply-To: <1597250597.2.0.528794904808.issue41532@roundup.psfhosted.org> Message-ID: <1597253332.44.0.220423340632.issue41532@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is because module functools is already imported (you can see it in sys.modules), but module tokenize is not. It is likely due to module rlcompleter imported at startup on Linux, but not on Windows. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:34:37 2020 From: report at bugs.python.org (Tony) Date: Wed, 12 Aug 2020 17:34:37 +0000 Subject: [issue41533] Bugfix: va_build_stack leaks the stack if do_mkstack fails In-Reply-To: <1597253261.51.0.12759996374.issue41533@roundup.psfhosted.org> Message-ID: <1597253677.86.0.806165482413.issue41533@roundup.psfhosted.org> Change by Tony : ---------- keywords: +patch pull_requests: +20974 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21847 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:36:38 2020 From: report at bugs.python.org (hai shi) Date: Wed, 12 Aug 2020 17:36:38 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597253798.98.0.413053983539.issue40275@roundup.psfhosted.org> hai shi added the comment: Hi, victor: About https://bugs.python.org/issue40275#msg369214, shall we continue to improve the libregretest? 1. Running test cases sequential: you have use a mechanism to unload the modules which load in the running test cases stage: https://github.com/python/cpython/blob/master/Lib/test/libregrtest/main.py#L437 2. Running test cases concurrently: It have use subprocess to isolate the module resources, no? I am not sure about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:38:53 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 17:38:53 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597253933.09.0.610910466495.issue39994@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, this code was kept for backward compatibility when the dispatch mapping was added. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:44:48 2020 From: report at bugs.python.org (Fred Drake) Date: Wed, 12 Aug 2020 17:44:48 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597254288.23.0.844442172965.issue39994@roundup.psfhosted.org> Fred Drake added the comment: Adding serhiy.storchaka to nosy list since it looks like he introduced the isinstance check on purpose (see bpo-23741). Though bpo-23741 asserts that no behavior was changed with the patch applied then, reading through the change leads me to think this did change for cases like the MyDict example from iritkatriel. The intent of the original code was that MyDict.__repr__ would be used; only the small handful of "known" reprs would be handled specially. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:45:24 2020 From: report at bugs.python.org (hai shi) Date: Wed, 12 Aug 2020 17:45:24 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597254324.57.0.538096346827.issue1635741@roundup.psfhosted.org> hai shi added the comment: There will have many unicode strs releaks when we calling `Py_Initialize()` again after `Py_Finalize()`: interned will be cleared in `Py_Finalize()`, but those unicodes str will still alive all the time. Q: How to solve the probleam? A: MAYBE we need share the interned of unicodeobject.c all the time and don't care how many times we will calling `Py_Initialize(); Py_Finalize();` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:50:13 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 12 Aug 2020 17:50:13 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597254613.7.0.336504289397.issue41520@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +terry.reedy nosy_count: 5.0 -> 6.0 pull_requests: +20975 pull_request: https://github.com/python/cpython/pull/21848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:54:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 17:54:48 +0000 Subject: [issue40807] Codeop: Show warnings once during _maybe_compile In-Reply-To: <1590674108.19.0.341062869134.issue40807@roundup.psfhosted.org> Message-ID: <1597254888.5.0.40960129921.issue40807@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 5.0 -> 6.0 pull_requests: +20976 pull_request: https://github.com/python/cpython/pull/21838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:55:03 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 12 Aug 2020 17:55:03 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597254903.64.0.932044720591.issue41520@roundup.psfhosted.org> Terry J. Reedy added the comment: This 'fix' introduces another regression by undoing the previous fix in issue 40807 of emitting DeprecationWarning (for '\e', for instance) just once instead of thrice. I suspect that the example of Matthias would fail in a debug build (with DeprecationWarnings on) for DeprecationWarning also. PR-21848 removes the limitation of the first fix to SyntaxWarning and includes DeprecationWarning in the test for single emission. ---------- nosy: +cheryl.sabella priority: -> release blocker resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 13:58:59 2020 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 12 Aug 2020 17:58:59 +0000 Subject: [issue24783] Import Error (undefined symbol: PyFloat_Type) when Importing math Module on Shared Build In-Reply-To: <1438561917.37.0.601266500098.issue24783@psf.upfronthosting.co.za> Message-ID: <1597255139.97.0.0542135249868.issue24783@roundup.psfhosted.org> Zackery Spytz added the comment: Python 2.7 is no longer supported, so I think this issue should be closed. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:00:45 2020 From: report at bugs.python.org (Roundup Robot) Date: Wed, 12 Aug 2020 18:00:45 +0000 Subject: [issue40563] Support pathlike objects on dbm/shelve In-Reply-To: <1588949755.54.0.0616905460961.issue40563@roundup.psfhosted.org> Message-ID: <1597255245.75.0.157383977195.issue40563@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +20977 pull_request: https://github.com/python/cpython/pull/21849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:07:00 2020 From: report at bugs.python.org (Matthew Barnett) Date: Wed, 12 Aug 2020 18:07:00 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597255620.9.0.299644896838.issue41531@roundup.psfhosted.org> Matthew Barnett added the comment: I think what's happening is that in 'compiler_dict' (Python/compile.c), it's checking whether 'elements' has reached a maximum (0xFFFF). However, it's not doing this after incrementing; instead, it's checking before incrementing and resetting 'elements' to 0 when it should be resetting to 1. The 65535th element isn't counted. ---------- nosy: +mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:10:13 2020 From: report at bugs.python.org (r1kk3r) Date: Wed, 12 Aug 2020 18:10:13 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 Message-ID: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> New submission from r1kk3r : I looked into changelog and the source code to see if the behavior was wanted but I was not able to see the source of the issue. import argparse parser = argparse.ArgumentParser(allow_abbrev=True) parser.add_argument('-o', type=str, required=True, dest="bla", help="bla") known_args, rest_of_args = parser.parse_known_args(["-o", "test1", "-object_lto", "test2"]) print(rest_of_args) Executing with python 3.7.8 With allow_abbrev=True: ['test2'] allow_abbrev=False: ['-object_lto', 'test2'] Executed with python 3.8.5 With allow_abbrev=True: ['test2'] allow_abbrev=False: ['test2'] Is it expected? How do I get the behavior of python 3.7 in python 3.8? ---------- components: Library (Lib) messages: 375276 nosy: r1kk3r priority: normal severity: normal status: open title: argparse : allow_abbrev behavior between 3.7 and 3.8 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:10:16 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 12 Aug 2020 18:10:16 +0000 Subject: [issue40979] typing module docs: keep text, add subsections In-Reply-To: <1592164571.1.0.235029301981.issue40979@roundup.psfhosted.org> Message-ID: <1597255816.46.0.293834772036.issue40979@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset b3ad2ca56afc6a56c9a6e7b419bc05e8e5b15e19 by Guido van Rossum in branch '3.9': [3.9] bpo-40979: refactored typing.rst; (mostly) same content, new sub-sections and ordering (GH-21574) (#21843) https://github.com/python/cpython/commit/b3ad2ca56afc6a56c9a6e7b419bc05e8e5b15e19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:25:44 2020 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 12 Aug 2020 18:25:44 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Futrue In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597256744.66.0.948264506211.issue40782@roundup.psfhosted.org> Guido van Rossum added the comment: I think it makes sense to remove the `async` from the definition in AbstractEventLoop. If you want to help, you can submit a PR to do it. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:33:26 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 12 Aug 2020 18:33:26 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597257206.1.0.898714568575.issue41531@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch nosy: +pablogsal nosy_count: 7.0 -> 8.0 pull_requests: +20978 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:34:18 2020 From: report at bugs.python.org (=?utf-8?q?Batuhan_Osman_Ta=C5=9Fkaya?=) Date: Wed, 12 Aug 2020 18:34:18 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597257258.55.0.431190845082.issue41531@roundup.psfhosted.org> Change by Batuhan Osman Ta?kaya : ---------- nosy: +batuhanosmantaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:48:47 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 12 Aug 2020 18:48:47 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597258127.63.0.686637665521.issue39994@roundup.psfhosted.org> Serhiy Storchaka added the comment: bpo-23741 did not change the behavior. The specified code was added specially to preserve the existing behavior. For other base types the condition was like `issubclass(typ, list) and r is list.__repr__`, but for dict it was just `issubclass(typ, dict)`. Actually the initial behavior was changed by bad3c88094f43f3bc7dcce22f47b8c2a8dddabcf (no issue number), with adding support of OrderedDict. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 14:52:28 2020 From: report at bugs.python.org (Fred Drake) Date: Wed, 12 Aug 2020 18:52:28 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597258348.35.0.491013361708.issue39994@roundup.psfhosted.org> Fred Drake added the comment: Ah, good find! It's been so long since the first version of that code, but the implementation was surprisingly nuanced. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 15:49:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 19:49:49 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597261789.41.0.128178216846.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 423e77d6de497931585d1883805a9e3fa4096b0b by Victor Stinner in branch 'master': bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) https://github.com/python/cpython/commit/423e77d6de497931585d1883805a9e3fa4096b0b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 16:10:45 2020 From: report at bugs.python.org (Zachary Ware) Date: Wed, 12 Aug 2020 20:10:45 +0000 Subject: [issue41529] Unable to compile 3.0b3 on Ubuntu systems: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding In-Reply-To: <1597220598.27.0.292747751554.issue41529@roundup.psfhosted.org> Message-ID: <1597263045.58.0.843226658073.issue41529@roundup.psfhosted.org> Zachary Ware added the comment: Can you reproduce this with the current release (3.9.0rc1)? Also, how did you call `./configure` and `make`? Adding ?ukasz so this is on his radar in case the first answer is affirmative and there's nothing exotic in the second. For the record, I can't reproduce on Ubuntu-based Pop_OS 20.04. ---------- nosy: +lukasz.langa, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 16:22:33 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 12 Aug 2020 20:22:33 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1597263753.46.0.0248797873173.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: Experiments are good, even if not accepted as is. Python uses American spellings: so 'Colors'. Moving help sources frees up enough vertical space to reduce the pressure to split General. It would again fit vertically on my Mac Airbook. 'Windows' is really 'Shell&Editor'. 'Blink' is the only thing that really applies to grep output windows. 'Windows' will not apply if we make IDLE multi-tabbed. The collage showing all pages at once is useful. I really want to spread the dialog horizontally a bit. The font sample could be wider. Colors and keys should have a uniform simplified theme/keyset selection box and other misc stuff on the left and a text or list box on the right. The cfg_highlight_alt.png and highlight3.png on issue 24781 are similar except that the left selection box should only be as big as needed (default 3) and the text is now bigger. So other stuff, possibly revised, should likely be on the left. Most of the General entries can be shrunk to 50-60% of the current width, or else wrapped. Example: At startup, open ()Shell ()Editor > split the "Extensions" page into its own class This was intended: issue 31207. I guess we ran out of gas before this. We could even consider extension and help frame classes besides the help/ext page class. Possible order of changes. #31207: ExtPage class and tests new: move Help sources to ExtPage and tests (to own testcase) new: move indent (as int entry box) and test to general. Add help note that indent is used to indent tab adds, indent delete backspaces, and smart indents. List issue on #24776 where indent discussed. #24781: Colors (see discussion above) new: Keys this? or new: redo General At some point, list classes in configdialog and test_configdialog. docstring so know what names to search for to find them. There are several other configdialog issues to fix glitches or make small improvements here and there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 16:23:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 20:23:46 +0000 Subject: [issue41529] Unable to compile 3.0b3 on Ubuntu systems: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding In-Reply-To: <1597220598.27.0.292747751554.issue41529@roundup.psfhosted.org> Message-ID: <1597263826.21.0.648376767155.issue41529@roundup.psfhosted.org> STINNER Victor added the comment: It seems like you're getting the error while running "make". I'm surprised by the sys.path value. Do you have a file called pybuilddir.txt in the current directory? If yes, what does it contain? Can you please try the command: make SHELL="bash -x" What is your current directory? Is it '/home/ajung/src/pp.server/Python-3.9.0b? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 17:07:17 2020 From: report at bugs.python.org (John McCrone) Date: Wed, 12 Aug 2020 21:07:17 +0000 Subject: [issue41535] platform win32_ver produces incorrect value for release on Windows domain controllers Message-ID: <1597266437.41.0.707688174447.issue41535@roundup.psfhosted.org> New submission from John McCrone : The method platform.win32_ver() produces the client version for the release rather than the server version on a Windows domain controller. This is easy to recreate on 3.8.5. For example, on a Windows 2012 server running as a domain controller, the method produces the following: >>> import platform >>> platform.win32_ver() ('8', '6.2.9200', 'SP0', 'Multiprocessor Free') The product type is 2: >>> import sys >>> sys.getwindowsversion().product_type 2 The correct value should not be '8' but rather '2012Server'. From looking at the source (platform.py), it appears that we determine if we are on a windows server by this check: if getattr(winver, 'product_type', None) == 3 However, both types 2 (Domain Controller) and 3 (Non-Domain Controller Server) are server types (see the documentation for sys.getwindowsversion() https://docs.python.org/3/library/sys.html). Therefore, it seems likely to me that it should check if the value of product_type is either 2 or 3 instead of just 3. ---------- components: Windows messages: 375285 nosy: jvm3487, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: platform win32_ver produces incorrect value for release on Windows domain controllers type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 17:17:59 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 21:17:59 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597267079.61.0.379893244955.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > There will have many unicode strs releaks when we calling `Py_Initialize()` again after `Py_Finalize()`: interned will be cleared in `Py_Finalize()`, but those unicodes str will still alive all the time. Py_Finalize() calls _PyUnicode_ClearInterned() which clears interned strings. Which strings are still alive after Py_Finalize()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 17:23:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 21:23:37 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597267417.72.0.167201955906.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8ecc0c4d390d03de5cd2344aa44b69ed02ffe470 by Hai Shi in branch 'master': bpo-1635741: Clean sysdict and builtins of interpreter at exit (GH-21605) https://github.com/python/cpython/commit/8ecc0c4d390d03de5cd2344aa44b69ed02ffe470 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 17:56:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 12 Aug 2020 21:56:51 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597269411.44.0.0167862258394.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: > Q: How to solve the problem? Making sure that the "total reference count" is zero after Py_Finalize() is a long term project which requires to solve many subproblems: * Convert static types to heap types: bpo-40077 * Somehow related, convert extension modules to multiphase initialization (PEP 489): this issue * Identify remaining global variables and either clear them explicitly, or move them to a structure which is cleared at exit To convert extension modules to multiphase init, one practical problem is that the PEP 573 doesn't cover slots and a few other corner cases. The PEP 573 should be extended: https://mail.python.org/archives/list/capi-sig at python.org/thread/6CGIIZVMJRYHWZDJLNWCLPSYYAVRRVCC/ There are likely a bunch of other misc corner cases which should be fixed as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 18:48:20 2020 From: report at bugs.python.org (Maxime Belanger) Date: Wed, 12 Aug 2020 22:48:20 +0000 Subject: [issue41100] Build failure on macOS 11 (beta) In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1597272500.92.0.496805573198.issue41100@roundup.psfhosted.org> Change by Maxime Belanger : ---------- nosy: +Maxime Belanger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 20:00:31 2020 From: report at bugs.python.org (Richard Sheridan) Date: Thu, 13 Aug 2020 00:00:31 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1597276831.59.0.479643166819.issue33479@roundup.psfhosted.org> Change by Richard Sheridan : ---------- nosy: +Richard Sheridan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 22:29:57 2020 From: report at bugs.python.org (Phillip Mackintosh) Date: Thu, 13 Aug 2020 02:29:57 +0000 Subject: [issue41536] pathlib's Path("NUL:").resolve() throws an error on windows Message-ID: <1597285797.92.0.269181951645.issue41536@roundup.psfhosted.org> New submission from Phillip Mackintosh : I'm looking for the equivalent windows functionality to the posix `/dev/null` file, and I discovered `NUL:` This snippet works on a windows OS, proving that it is indeed a writable file: `Path('NUL:').write_text('abcd')` However, `Path('NUL:').resolve()` Throws an exception `OSError: [WinError 87] The parameter is incorrect: 'NUL:'` Is this the expected behaviour? I.E. I should wrap the call to `resolve()` in a `try...except`? If I catch all `OSError` types, how can I determine if it's a legitimate error or not? E.G. Full console output: 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. >>> from pathlib import Path >>> Path('NUL:') WindowsPath('NUL:') >>> Path('NUL:').write_text('abcd') 4 >>> Path('NUL:').resolve() Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python37\lib\pathlib.py", line 1134, in resolve s = self._flavour.resolve(self, strict=strict) File "C:\Program Files\Python37\lib\pathlib.py", line 192, in resolve s = self._ext_to_normal(_getfinalpathname(s)) OSError: [WinError 87] The parameter is incorrect: 'NUL:' ---------- components: Windows messages: 375289 nosy: paul.moore, phillmac, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: pathlib's Path("NUL:").resolve() throws an error on windows type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 12 23:49:28 2020 From: report at bugs.python.org (hai shi) Date: Thu, 13 Aug 2020 03:49:28 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 In-Reply-To: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> Message-ID: <1597290568.86.0.637924083718.issue41534@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 00:46:06 2020 From: report at bugs.python.org (hai shi) Date: Thu, 13 Aug 2020 04:46:06 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597293966.67.0.776502345411.issue1635741@roundup.psfhosted.org> hai shi added the comment: > Py_Finalize() calls _PyUnicode_ClearInterned() which clears interned strings. Which strings are still alive after Py_Finalize()? Yes.especially those encodings, interpreter leaks much encodings refcount after Py_Finalize(). I am not sure they are corner cases or not. Maybe we could check it again afer we have done all convert works. No matter how many times `Py_Initialize(); Py_Finalize();` have called, Holding a same interned of unicodeobject.c all the time sound like a stupied idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 01:29:01 2020 From: report at bugs.python.org (Poorna VenkataSai) Date: Thu, 13 Aug 2020 05:29:01 +0000 Subject: [issue41537] {Save, Save As, Save Copy As} not Working from version 3.8.3 Message-ID: <1597296541.26.0.0912699525588.issue41537@roundup.psfhosted.org> New submission from Poorna VenkataSai : save, Save as, Save Copy As are not responding in IDLE in the scenario created a PYTHON FILE from by renaming the new text document. now i wrote some content and trying to save. but, it's not responding. ---------- assignee: terry.reedy components: IDLE messages: 375291 nosy: lpoorna357, terry.reedy priority: normal severity: normal status: open title: {Save, Save As, Save Copy As} not Working from version 3.8.3 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 02:27:22 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 13 Aug 2020 06:27:22 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 In-Reply-To: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> Message-ID: <1597300042.45.0.61949074329.issue41534@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Bisection tells me this was introduced with commit b1e4d1b6032d4c82b549233fa08a2c7cfe7e818b in issue26967 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 02:28:43 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 13 Aug 2020 06:28:43 +0000 Subject: [issue41536] pathlib's Path("NUL:").resolve() throws an error on windows In-Reply-To: <1597285797.92.0.269181951645.issue41536@roundup.psfhosted.org> Message-ID: <1597300123.75.0.421189216327.issue41536@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 03:36:18 2020 From: report at bugs.python.org (James Barrett) Date: Thu, 13 Aug 2020 07:36:18 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Futrue In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597304178.61.0.931487044235.issue40782@roundup.psfhosted.org> Change by James Barrett : ---------- keywords: +patch pull_requests: +20979 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 03:49:28 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 13 Aug 2020 07:49:28 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597304967.99.0.301359884919.issue40782@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Futrue -> AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 04:03:30 2020 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 Aug 2020 08:03:30 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 In-Reply-To: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> Message-ID: <1597305810.2.0.593203902617.issue41534@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 04:30:23 2020 From: report at bugs.python.org (Ned Deily) Date: Thu, 13 Aug 2020 08:30:23 +0000 Subject: [issue24783] Import Error (undefined symbol: PyFloat_Type) when Importing math Module on Shared Build In-Reply-To: <1438561917.37.0.601266500098.issue24783@psf.upfronthosting.co.za> Message-ID: <1597307423.43.0.674160836764.issue24783@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 04:31:21 2020 From: report at bugs.python.org (Albert Cervin) Date: Thu, 13 Aug 2020 08:31:21 +0000 Subject: [issue41538] Allow customizing python interpreter in venv.EnvBuilder Message-ID: <1597307480.95.0.346460653424.issue41538@roundup.psfhosted.org> New submission from Albert Cervin : When creating a virtualenv using venv.EnvBuilder, it always uses sys._base_executable. However, in some embedded cases (Blender being one example), it is not set to a valid Python executable. The proposal is to add a keyword parameter to the EnvBuilder constructor for specifying which python interpreter to use, much like the -p flag in virtualenv. ---------- components: Library (Lib) messages: 375293 nosy: abbec priority: normal severity: normal status: open title: Allow customizing python interpreter in venv.EnvBuilder type: enhancement versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 04:34:48 2020 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Aug 2020 08:34:48 +0000 Subject: [issue40860] Exception in multiprocessing/context.py under load In-Reply-To: <1591239973.04.0.347860195364.issue40860@roundup.psfhosted.org> Message-ID: <1597307688.46.0.293423818281.issue40860@roundup.psfhosted.org> Irit Katriel added the comment: I agree that it would be better not to lock join, and instead manage each process from one thread. I think this ticket can be closed as a duplicate of issue40815. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 04:48:53 2020 From: report at bugs.python.org (Mark Shannon) Date: Thu, 13 Aug 2020 08:48:53 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597308533.33.0.449469687268.issue41531@roundup.psfhosted.org> Mark Shannon added the comment: New changeset c51db0ea40ddabaf5f771ea633b37fcf4c90a495 by Pablo Galindo in branch 'master': bpo-41531: Fix compilation of dict literals with more than 0xFFFF elements (GH-21850) https://github.com/python/cpython/commit/c51db0ea40ddabaf5f771ea633b37fcf4c90a495 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 04:49:09 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 08:49:09 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597308549.24.0.174126448481.issue41531@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +20980 pull_request: https://github.com/python/cpython/pull/21853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 05:00:13 2020 From: report at bugs.python.org (Mark Shannon) Date: Thu, 13 Aug 2020 09:00:13 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597309213.32.0.860652393431.issue41531@roundup.psfhosted.org> Mark Shannon added the comment: @hroncok, How did you discover this issue? I'd like to clean up the code for creating dictionary literals and it might be helpful to know where such huge dictionary literals exist. I'm guessing that they are used as lookup tables for things like Unicode code-point tables, and that they would only include constants. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 05:03:39 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 13 Aug 2020 09:03:39 +0000 Subject: [issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter In-Reply-To: <1597246976.86.0.332574378371.issue41531@roundup.psfhosted.org> Message-ID: <1597309419.0.0.820126502237.issue41531@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: @hroncok said on Twitter it was reported at https://github.com/Storyyeller/enjarify/issues/17 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 05:42:10 2020 From: report at bugs.python.org (Martin) Date: Thu, 13 Aug 2020 09:42:10 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output Message-ID: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> New submission from Martin : I experience a problem with multiprocessing and print. I tried to make a minimal working example, please see the attached file. WITHOUT the offending print statement in the queue filler thread, everything works: - pytest experiments/mp_problem.py - pytest experiments/mp_problem.py -s - python experiments/mp_problem.py WITH the offending print statement, not so much: - pytest experiments/mp_problem.py WORKS (Probably because pytest captures fd 1) - pytest experiments/mp_problem.py -s FAILS eventually (after a couple of workers have been started) - python experiments/mp_problem.py FAILS eventually (same). WITH the offending print statement AND PYTHONUNBUFFERED=1, everything works again: - pytest experiments/mp_problem.py - pytest experiments/mp_problem.py -s - python experiments/mp_problem.py Environment: Ubuntu 18.04.5 LTS python 3.8.5 (hcff3b4d_1) on conda 4.8.3 ---------- files: mp_problem.py messages: 375298 nosy: moi90 priority: normal severity: normal status: open title: print blocks with multiprocessing and buffered output type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49385/mp_problem.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 05:57:27 2020 From: report at bugs.python.org (Martin) Date: Thu, 13 Aug 2020 09:57:27 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1597312647.44.0.98918537586.issue41539@roundup.psfhosted.org> Martin added the comment: python experiments/mp_problem.py also fails for: - 3.8.3, 3.8.2, 3.8.1, 3.8.0 - 3.7.7 - 3.6.10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 06:30:41 2020 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Aug 2020 10:30:41 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1597314641.55.0.833803118214.issue41539@roundup.psfhosted.org> Irit Katriel added the comment: Try putting a lock on the print statement. See this: https://stackoverflow.com/questions/40356200/python-printing-in-multiple-threads/ ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 07:02:22 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 13 Aug 2020 11:02:22 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597316542.61.0.734564612834.issue41520@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The commit 369a1cbdee14d9f27356fb3a8bb21e4fde289d25 introduces a change in environment. I haven't checked the other PR though to see if this is fixed. ./python.exe -m test --fail-env-changed test_codeop -m test_warning 0:00:00 load avg: 2.30 Run tests sequentially 0:00:00 load avg: 2.30 [1/1] test_codeop Warning -- warnings.filters was modified by test_codeop Before: (4331716096, [('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)], [('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)]) After: (4331716096, [('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)], [('error', None, , None, 0), ('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)]) test_codeop failed (env changed) == Tests result: ENV CHANGED == 1 test altered the execution environment: test_codeop Total duration: 38 ms Tests result: ENV CHANGED On an unrelated note the test passes with verbose mode though fail-env-changed flag is passed. ./python.exe -m test --fail-env-changed test_codeop -m test_warning -vvv == CPython 3.10.0a0 (heads/master:c51db0ea40d, Aug 13 2020, 15:47:27) [Clang 10.0.1 (clang-1001.0.46.4)] == macOS-10.14.6-x86_64-i386-64bit little-endian == cwd: /Users/kasingar/stuff/python/cpython/build/test_python_29945? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.53 Run tests sequentially 0:00:00 load avg: 1.53 [1/1] test_codeop test_warning (test.test_codeop.CodeopTests) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK == Tests result: SUCCESS == 1 test OK. Total duration: 58 ms Tests result: SUCCESS ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 07:09:31 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 13 Aug 2020 11:09:31 +0000 Subject: [issue41538] Allow customizing python interpreter in venv.EnvBuilder In-Reply-To: <1597307480.95.0.346460653424.issue41538@roundup.psfhosted.org> Message-ID: <1597316971.65.0.940592359327.issue41538@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 07:35:17 2020 From: report at bugs.python.org (Albert Cervin) Date: Thu, 13 Aug 2020 11:35:17 +0000 Subject: [issue41538] Allow customizing python interpreter in venv.EnvBuilder In-Reply-To: <1597307480.95.0.346460653424.issue41538@roundup.psfhosted.org> Message-ID: <1597318517.31.0.36645708369.issue41538@roundup.psfhosted.org> Change by Albert Cervin : ---------- keywords: +patch pull_requests: +20981 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:15:27 2020 From: report at bugs.python.org (Tony Reix) Date: Thu, 13 Aug 2020 12:15:27 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX Message-ID: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> New submission from Tony Reix : Python master of 2020/08/11 Test test_maxcontext_exact_arith (test.test_decimal.CWhitebox) checks that Python correctly handles a case where an object of size 421052631578947376 is created. maxcontext = Context(prec=C.MAX_PREC, Emin=C.MIN_EMIN, Emax=C.MAX_EMAX) Both on Linux and AIX, we have: Context(prec=999999999999999999, rounding=ROUND_HALF_EVEN, Emin=-999999999999999999, Emax=999999999999999999, capitals=1, clamp=0, flags=[], traps=[InvalidOperation, DivisionByZero, Overflow]) The test appears in: Lib/test/test_decimal.py 5665 def test_maxcontext_exact_arith(self): and the issue (on AIX) exactly appears at: self.assertEqual(Decimal(4) / 2, 2) The issue is due to code in: Objects/obmalloc.c : void * PyMem_RawMalloc(size_t size) { /* * Limit ourselves to PY_SSIZE_T_MAX bytes to prevent security holes. * Most python internals blindly use a signed Py_ssize_t to track * things without checking for overflows or negatives. * As size_t is unsigned, checking for size < 0 is not required. */ if (size > (size_t)PY_SSIZE_T_MAX) return NULL; return _PyMem_Raw.malloc(_PyMem_Raw.ctx, size); Both on Fedora/x86_64 and AIX, we have: size: 421052631578947376 PY_SSIZE_T_MAX: 9223372036854775807 thus: size < PY_SSIZE_T_MAX and _PyMem_Raw.malloc() is called. However, on Linux, the malloc() returns a NULL pointer in that case, and then Python handles this and correctly runs the test. However, on AIX, the malloc() tries to allocate the requested memory, and the OS gets stucked till the Python process is killed by the OS. Either size is too small, or PY_SSIZE_T_MAX is not correctly computed: ./Include/pyport.h : /* Largest positive value of type Py_ssize_t. */ #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) Anyway, the following code added in PyMem_RawMalloc() before the call to _PyMem_Raw.malloc() , which in turns calls malloc() : if (size == 421052631578947376) { printf("TONY: 421052631578947376: --> PY_SSIZE_T_MAX: %ld \n", PY_SSIZE_T_MAX); return NULL; } does fix the issue on AIX. However, it is simply a way to show where the issue can be fixed. Another solution (fix size < PY_SSIZE_T_MAX) is needed. ---------- components: C API messages: 375302 nosy: T.Rex priority: normal severity: normal status: open title: Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:23:04 2020 From: report at bugs.python.org (mohamed koubaa) Date: Thu, 13 Aug 2020 12:23:04 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597321384.72.0.362200069228.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +20982 pull_request: https://github.com/python/cpython/pull/21855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:23:30 2020 From: report at bugs.python.org (mohamed koubaa) Date: Thu, 13 Aug 2020 12:23:30 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597321410.68.0.369461942451.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +20983 pull_request: https://github.com/python/cpython/pull/21856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:28:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 12:28:13 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597321693.07.0.971113293073.issue41540@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:28:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 12:28:27 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597321707.18.0.796153713.issue41540@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +facundobatista, mark.dickinson, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:39:19 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 13 Aug 2020 12:39:19 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597322359.09.0.821719486312.issue41540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Could be a duplicate/related to the problem described in https://bugs.python.org/issue39576 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 08:43:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 13 Aug 2020 12:43:29 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597322609.72.0.845295193789.issue41540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately, I do not understand why you conclude that the problem is in PyMem_RawMalloc. That code seems correct. Could you provide evidence that the value of PY_SSIZE_T_MAX is miscalculated in AIX? Alternatively, could you elaborate on what makes you believe that the problem is in PyMem_RawMalloc? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 09:12:55 2020 From: report at bugs.python.org (Tony Reix) Date: Thu, 13 Aug 2020 13:12:55 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597324375.68.0.918268589299.issue41540@roundup.psfhosted.org> Tony Reix added the comment: Some more explanations. On AIX, the memory is controlled by the ulimit command. "Global memory" comprises the physical memory and the paging space, associated with the Data Segment. By default, both Memory and Data Segment are limited: # ulimit -a data seg size (kbytes, -d) 131072 max memory size (kbytes, -m) 32768 ... However, it is possible to remove the limit, like: # ulimit -d unlimited Now, when the "data seg size" is limited, the malloc() routine checks if enough memory/paging-space are available, and it immediately returns a NULL pointer. But, when the "data seg size" is unlimited, the malloc() routine first tries to allocate and quickly consumes the paging space, which is much slower than acquiring memory since it consumes disk space. And it nearly hangs the OS. Thus, in that case, it does NOT check if enough memory of data segments are available. Bad. So, this issue appears on AIX only if we have: # ulimit -d unlimited Anyway, the test: if (size > (size_t)PY_SSIZE_T_MAX) in: Objects/obmalloc.c: PyMem_RawMalloc() seems weird to me since the max of size is always lower than PY_SSIZE_T_MAX . ---------- nosy: -facundobatista, mark.dickinson, pablogsal, rhettinger, skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 09:18:57 2020 From: report at bugs.python.org (Tony Reix) Date: Thu, 13 Aug 2020 13:18:57 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597324737.11.0.484084994814.issue41540@roundup.psfhosted.org> Tony Reix added the comment: Hi Pablo, I'm only surprised that the maximum size generated in the test is always lower than the PY_SSIZE_T_MAX. And this appears both on AIX and on Linux, which both compute the same values. On AIX, it appears (I've just discovered this now) that malloc() does not ALWAYS check that there is enough memory to allocate before starting to claim memory (and thus paging space). This appears when Data Segment size is unlimited. On Linux/Fedora, I had no limit too. But it behaves differently and malloc() always checks that the size is correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 09:20:02 2020 From: report at bugs.python.org (Sanket Rathi) Date: Thu, 13 Aug 2020 13:20:02 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597324802.31.0.729735274183.issue41540@roundup.psfhosted.org> Change by Sanket Rathi : ---------- nosy: +sanket _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 09:47:03 2020 From: report at bugs.python.org (Phil Connell) Date: Thu, 13 Aug 2020 13:47:03 +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: <1597326423.81.0.915819380157.issue14905@roundup.psfhosted.org> Phil Connell added the comment: One version of the bug described here (and fixed in the old implementation under issue17633) exists in the Python implementation of zipimport: $ unzip -l namespace1.zip Archive: namespace1.zip Length Date Time Name --------- ---------- ----- ---- 0 08-13-2020 06:30 one/ 0 08-13-2020 06:30 one/two/ 0 08-13-2020 06:30 one/two/three.py --------- ------- 0 3 files $ unzip -l namespace2.zip Archive: namespace2.zip Length Date Time Name --------- ---------- ----- ---- 0 08-13-2020 06:37 alpha/beta/gamma.py --------- ------- 0 1 file $ PYTHONPATH=namespace1.zip:namespace2.zip ./python Python 3.10.0a0 (heads/master:c51db0ea40, Aug 13 2020, 06:41:20) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import one >>> import alpha Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'alpha' >>> In short, imports where there's no separate entry for directories in the zip file don't work. Any opinions on whether this *is* the problem this issue is trying to track? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 09:51:09 2020 From: report at bugs.python.org (E. Paine) Date: Thu, 13 Aug 2020 13:51:09 +0000 Subject: [issue41537] {Save, Save As, Save Copy As} not Working from version 3.8.3 In-Reply-To: <1597296541.26.0.0912699525588.issue41537@roundup.psfhosted.org> Message-ID: <1597326669.93.0.137260847675.issue41537@roundup.psfhosted.org> E. Paine added the comment: Would you mind please checking if #41373 is the problem you describe? (apologies about this issue, we are having relatively lots of reports about it but the fix won't be distributed until 3.9.0/3.8.6) ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 09:57:32 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 13 Aug 2020 13:57:32 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597327052.21.0.175893584332.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: We need more information. Is this 64-bit AIX? How much physical memory does the machine have? Linux also has over-allocation and the default for ulimit is unlimited. But it does not attempt to over-allocate such an outrageous amount of memory. Neither do FreeBSD, Windows, etc. ---------- nosy: +skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 10:16:03 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 13 Aug 2020 14:16:03 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597328163.57.0.262315806918.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: Also, perhaps build Python with -bmaxdata? https://www.enterprisedb.com/edb-docs/d/postgresql/reference/manual/11.1/installation-platform-notes.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 10:23:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 14:23:17 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597328597.87.0.502937250035.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e087f7cd43dfa4223c55a8ecd71f4a7d685178e4 by Mohamed Koubaa in branch 'master': bpo-1635741: Port _winapi ext to multi-stage init (GH-21371) https://github.com/python/cpython/commit/e087f7cd43dfa4223c55a8ecd71f4a7d685178e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 10:24:48 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 14:24:48 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597328688.18.0.74297697394.issue41520@roundup.psfhosted.org> STINNER Victor added the comment: > The commit 369a1cbdee14d9f27356fb3a8bb21e4fde289d25 introduces a change in environment. (...) Right. It's fixed by PR 21848. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 10:57:19 2020 From: report at bugs.python.org (Tony Reix) Date: Thu, 13 Aug 2020 14:57:19 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597330639.53.0.225037017034.issue41540@roundup.psfhosted.org> Tony Reix added the comment: Is it a 64bit AIX ? Yes, AIX is 64bit by default and only since ages, but it manages 32bit applications as well as 64bit applications. The experiments were done with 64bit Python executables on both AIX and Linux. The AIX machine has 16GB Memory and 16GB Paging Space. The Linux Fdora32/x86_64 machine has 16GB Memory and 8269820 Paging Space (swapon -s). Yes, I agree that the behavior of AIX malloc() under "ulimit -d unlimited" is... surprising. And the manual of malloc() does not talk about this. Anyway, does the test: if (size > (size_t)PY_SSIZE_T_MAX) was aimed to prevent calling malloc() with such a huge size? If yes, that does not work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 11:21:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 15:21:34 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597332094.59.0.551131518593.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20984 pull_request: https://github.com/python/cpython/pull/21857 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 11:36:19 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 13 Aug 2020 15:36:19 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py [ SIGWINCH ] In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1597332979.03.0.399607611076.issue41494@roundup.psfhosted.org> Soumendra Ganguly added the comment: Closing because registering SIGWINCH handler from within library function is impractical. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 11:36:24 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 13 Aug 2020 15:36:24 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py [ SIGWINCH ] In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1597332984.46.0.712023761229.issue41494@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 11:46:25 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 15:46:25 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597333585.92.0.697699040311.issue40275@roundup.psfhosted.org> STINNER Victor added the comment: > About https://bugs.python.org/issue40275#msg369214, shall we continue to improve the libregretest? If someone wants to continue the effort in libregrtest, I suggest to open a new issue. This one already has a long list of commits and messages about test.support. See test.libregrtest.runtest_mp module for the "multiprocessing" implementation which uses subprocess. It's used when you run tests using -jN option. Almost all buildbots use -jN: see make buildbottest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 12:14:30 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 16:14:30 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597335270.09.0.520919772636.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20985 pull_request: https://github.com/python/cpython/pull/21858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 12:17:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 16:17:12 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597335432.24.0.853705848689.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20986 pull_request: https://github.com/python/cpython/pull/21859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 12:51:26 2020 From: report at bugs.python.org (Stefan Krah) Date: Thu, 13 Aug 2020 16:51:26 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597337486.31.0.418573612369.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: The test (size > (size_t)PY_SSIZE_T_MAX)) has nothing to do with it. Within Python, most sizes are ssize_t, so a value larger than SSIZE_MAX is suspicious. AIX is an unsupported platform. Realistically, if people want AIX to be supported, someone has to give core devs full ssh access to an AIX system. Perhaps I'll just skip this test on AIX. ---------- components: +Extension Modules -C API nosy: +David.Edelsohn priority: normal -> low type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 12:53:45 2020 From: report at bugs.python.org (David Edelsohn) Date: Thu, 13 Aug 2020 16:53:45 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597337625.08.0.0691091487136.issue41540@roundup.psfhosted.org> David Edelsohn added the comment: Core developers have full access to AIX system for the asking. Back to you, Stefan. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:00:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 17:00:37 +0000 Subject: [issue41525] Python '--help' has corrupted text. In-Reply-To: <1597187988.07.0.0319767984896.issue41525@roundup.psfhosted.org> Message-ID: <1597338037.44.0.477184369138.issue41525@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:09:48 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Aug 2020 17:09:48 +0000 Subject: [issue41537] {Save, Save As, Save Copy As} not Working from version 3.8.3 In-Reply-To: <1597296541.26.0.0912699525588.issue41537@roundup.psfhosted.org> Message-ID: <1597338588.62.0.313931036354.issue41537@roundup.psfhosted.org> Terry J. Reedy added the comment: The first save fix is in 3.8.5. The second fix is in 3.9.0rc1, released 2 days ago. In the absence of specific information otherwise, I am assuming that this is a duplicate of one of the two no-save causes. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> IDLE: edit/save files created by Windows Explorer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:13:18 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Aug 2020 17:13:18 +0000 Subject: [issue41537] {Save, Save As, Save Copy As} not Working from version 3.8.3 In-Reply-To: <1597296541.26.0.0912699525588.issue41537@roundup.psfhosted.org> Message-ID: <1597338798.39.0.224097658175.issue41537@roundup.psfhosted.org> Terry J. Reedy added the comment: A copy of what I wrote elsewhere. There are two possible reasons in 3.8.4 and 3.9.0b4 - non-ascii characters and files created outside of IDLE. Non-ascii chars was fixed in 3.8.5 and 3.9.0b5. Files created outside of IDLE work in 3.8.6, due in September and 3.9.0rc1, released today. If you do not need 3rd party modules, use the latter. If you do, create new files within IDLE with File=> New. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:15:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 17:15:42 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597338942.33.0.237285127476.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 43577c01a2ab49122db696e9eaec6cb31d11cc81 by Victor Stinner in branch 'master': bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858) https://github.com/python/cpython/commit/43577c01a2ab49122db696e9eaec6cb31d11cc81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:16:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 17:16:05 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597338965.59.0.616404462291.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 46d10b1237c67ff8347f533eda6a5468d098f7eb by Victor Stinner in branch 'master': bpo-40204: Fix duplicates in the documentation (GH-21857) https://github.com/python/cpython/commit/46d10b1237c67ff8347f533eda6a5468d098f7eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:18:57 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Aug 2020 17:18:57 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597339137.89.0.975508163854.issue41520@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset c818b15fa59039de67022c29085d439fa5d3ef95 by Terry Jan Reedy in branch 'master': bpo-41520: Fix second codeop regression (GH-21848) https://github.com/python/cpython/commit/c818b15fa59039de67022c29085d439fa5d3ef95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:20:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 17:20:35 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597339235.38.0.922253888108.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 20ae565bd2d79425d5567c001ed8f89848d7d907 by Victor Stinner in branch 'master': bpo-41521: Replace denylist with blocklist is http.cookiejar doc (GH-21826) https://github.com/python/cpython/commit/20ae565bd2d79425d5567c001ed8f89848d7d907 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:22:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 17:22:42 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597339362.1.0.270715580158.issue41520@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset c818b15fa59039de67022c29085d439fa5d3ef95 by Terry Jan Reedy in branch 'master': > bpo-41520: Fix second codeop regression (GH-21848) https://github.com/python/cpython/commit/c818b15fa59039de67022c29085d439fa5d3ef95 I confirm that this change fixed the "test altered the execution environment" issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:35:45 2020 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Thu, 13 Aug 2020 17:35:45 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597340145.62.0.954360696211.issue40994@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: English is my second language and I am familiar with the expression ?respectively? since it is used very often in high school mathematics. ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:37:00 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 13 Aug 2020 17:37:00 +0000 Subject: [issue41541] Make pty.spawn set window size, make code more readable Message-ID: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> New submission from Soumendra Ganguly : The example in https://docs.python.org/3/library/pty.html that mimics script(1) can be used to reproduce the problem: since window size is not set by pty.spawn, output of "ls" becomes scattered and hard to visually parse if xterm window is not in fullscreen mode. To fix the above issue, this patch makes pty.spawn set window size ( TIOCSWINSZ ). Also, this patch makes the code of pty.fork() more readable by defining _login_pty(); the latter is reused in spawn(). ---------- components: Library (Lib) files: pty.diff keywords: patch messages: 375326 nosy: soumendra priority: normal severity: normal status: open title: Make pty.spawn set window size, make code more readable type: behavior versions: Python 3.10, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49386/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:41:08 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Aug 2020 17:41:08 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597340468.92.0.263468184592.issue41520@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +20987 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:43:34 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 13 Aug 2020 17:43:34 +0000 Subject: [issue41541] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597340614.21.0.593830319976.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: Make pty.spawn set window size, make code more readable -> Make pty.spawn set window size _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:44:23 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Thu, 13 Aug 2020 17:44:23 +0000 Subject: [issue41541] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597340663.43.0.679519448456.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- pull_requests: +20988 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 13:54:20 2020 From: report at bugs.python.org (Irit Katriel) Date: Thu, 13 Aug 2020 17:54:20 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597341260.12.0.388469294168.issue40994@roundup.psfhosted.org> Irit Katriel added the comment: Sydney, is the issue related to how Jupyter notebook displays the documentation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 14:21:56 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 18:21:56 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597342916.12.0.696934204624.issue41520@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20989 pull_request: https://github.com/python/cpython/pull/21862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 14:21:40 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Aug 2020 18:21:40 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597342900.2.0.0687377317212.issue41520@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset f24430f1542ea2768793b48704ae2d4e241892ae by Terry Jan Reedy in branch '3.9': [3.9] bpo-41520: Fix second codeop regression (GH-21848) https://github.com/python/cpython/commit/f24430f1542ea2768793b48704ae2d4e241892ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 14:39:03 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 18:39:03 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597343943.03.0.52883109785.issue41520@roundup.psfhosted.org> miss-islington added the comment: New changeset a3416c13b51af25675e175d4ffe07d8b925e7dbf by Miss Islington (bot) in branch '3.8': [3.9] bpo-41520: Fix second codeop regression (GH-21848) https://github.com/python/cpython/commit/a3416c13b51af25675e175d4ffe07d8b925e7dbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 14:46:53 2020 From: report at bugs.python.org (Tianrui Luo) Date: Thu, 13 Aug 2020 18:46:53 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= Message-ID: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> New submission from Tianrui Luo : Fairly easy to reproduce. `__all__` in a module seems unable to track name with `?`. The following minimal reproducing example also fails for function name of `a?` or `?b`. ```python3 Python 3.7.7 (default, May 7 2020, 21:25:33) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> from tmp import * Traceback (most recent call last): File "", line 1, in AttributeError: module 'tmp' has no attribute '?' ``` The `tmp.py` file. ```python # tmp.py __all__ = ['?'] def ?(): print('"__all__" doesn\'t like me') return ``` ---------- components: Unicode messages: 375330 nosy: ezio.melotti, tianrluo, vstinner priority: normal severity: normal status: open title: module `__all__` cannot detect function name with `?` type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:23:48 2020 From: report at bugs.python.org (Seth Woodworth) Date: Thu, 13 Aug 2020 19:23:48 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> Message-ID: <1597346628.85.0.809706598799.issue41542@roundup.psfhosted.org> Seth Woodworth added the comment: As described in PEP3131, unicode identifiers are normalized via NFKC before being added to the globals, and presumably __all__ as in your example. You can see what python _did_ add via unicodedata.normalize('NFKC', '?') which returns '?' [ins] In [8]: bytes('?', 'utf8') Out[8]: b'\xcf\x86' [ins] In [9]: bytes('?', 'utf8') Out[9]: b'\xcf\x95' The normalized version of Phi, I _can_ add to my globals: globals()['?'] = 'foo' ---------- nosy: +sethwoodworth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:27:23 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 13 Aug 2020 19:27:23 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1597346843.85.0.508795505523.issue41109@roundup.psfhosted.org> Jeffrey Kintscher added the comment: Adding __init__() to PurePath complicates things and doesn't provide any benefit. A subclass that calls super.__init__() ends up invoking object.__init__(), which is perfectly fine. I was able to find a solution by calling type(self)() instead of object.__new__() in most cases. I am working on a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:31:25 2020 From: report at bugs.python.org (Louis-Vincent Boudreault) Date: Thu, 13 Aug 2020 19:31:25 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1597346843.85.0.508795505523.issue41109@roundup.psfhosted.org> Message-ID: Louis-Vincent Boudreault added the comment: This is not true, because the classmethod use the library shortcuts the class mro order, to prevent infinite loop inthe __new__. However, it was using __init__ before hand, we would Not have this issue Le jeu. 13 ao?t 2020 ? 15:27, Jeffrey Kintscher a ?crit : > > Jeffrey Kintscher added the comment: > > Adding __init__() to PurePath complicates things and doesn't provide any > benefit. A subclass that calls super.__init__() ends up invoking > object.__init__(), which is perfectly fine. > > I was able to find a solution by calling type(self)() instead of > object.__new__() in most cases. I am working on a PR. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:33:20 2020 From: report at bugs.python.org (Louis-Vincent Boudreault) Date: Thu, 13 Aug 2020 19:33:20 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: Message-ID: Louis-Vincent Boudreault added the comment: This is not true, because the classmethod used the library shortcuts the class mro order, this is to prevent infinite loop inthe __new__. However, If it was using __init__ before hand, we would Not have this issue Le jeu. 13 ao?t 2020 ? 15:31, Louis-Vincent Boudreault < lv.boudreault95 at gmail.com> a ?crit : > This is not true, because the classmethod use the library shortcuts the > class mro order, to prevent infinite loop inthe __new__. However, it was > using __init__ before hand, we would > Not have this issue > > > Le jeu. 13 ao?t 2020 ? 15:27, Jeffrey Kintscher > a ?crit : > >> >> Jeffrey Kintscher added the comment: >> >> Adding __init__() to PurePath complicates things and doesn't provide any >> benefit. A subclass that calls super.__init__() ends up invoking >> object.__init__(), which is perfectly fine. >> >> I was able to find a solution by calling type(self)() instead of >> object.__new__() in most cases. I am working on a PR. >> >> ---------- >> >> _______________________________________ >> Python tracker >> >> _______________________________________ >> > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:42:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 19:42:01 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597347721.65.0.124931632824.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d3ded080482beae578faa704b13534a62d066f9f by Victor Stinner in branch 'master': bpo-40204: Add :noindex: in the documentation (GH-21859) https://github.com/python/cpython/commit/d3ded080482beae578faa704b13534a62d066f9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:52:13 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 Aug 2020 19:52:13 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597348333.17.0.00966041559992.issue41066@roundup.psfhosted.org> Antoine Pitrou added the comment: New changeset 0eb9deb4a62e6d9daa82bc2f67d1075864ca8ece by Srinivas Reddy Thatiparthy (?????????? ?????? ?????????) in branch 'master': bpo-41066: Update the comparison section for os vs pathlib (GH-21261) https://github.com/python/cpython/commit/0eb9deb4a62e6d9daa82bc2f67d1075864ca8ece ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:52:22 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 19:52:22 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597348342.37.0.0343129922697.issue41066@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20990 pull_request: https://github.com/python/cpython/pull/21863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:55:55 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 Aug 2020 19:55:55 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597348555.16.0.668197632851.issue41066@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- pull_requests: +20991 pull_request: https://github.com/python/cpython/pull/21864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:59:10 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 19:59:10 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597348750.87.0.66020616493.issue41066@roundup.psfhosted.org> miss-islington added the comment: New changeset 3dd1153b9963cc7fc74ba2fa5bf2be46f154c613 by Miss Islington (bot) in branch '3.9': bpo-41066: Update the comparison section for os vs pathlib (GH-21261) https://github.com/python/cpython/commit/3dd1153b9963cc7fc74ba2fa5bf2be46f154c613 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 15:59:40 2020 From: report at bugs.python.org (Sydney Pemberton) Date: Thu, 13 Aug 2020 19:59:40 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1597341260.12.0.388469294168.issue40994@roundup.psfhosted.org> Message-ID: Sydney Pemberton added the comment: Nothing to do with Jupyter itself. When I'm reading the documentation I don't necessarily think that a sibling "node" in the document structure is going to have anything to do with my current section. So it was weird to see the section entirely empty. Also, I'm not saying that all non-native speakers are going to be unfamiliar with the construction, but it is certainly more widely understandable if the definitions are kept separate. On Thu, Aug 13, 2020 at 12:54 PM Irit Katriel wrote: > > Irit Katriel added the comment: > > Sydney, is the issue related to how Jupyter notebook displays the > documentation? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- Sydney Pemberton Software Engineer 512.740.6591 spemberton at auntbertha.com Aunt Bertha | The Social Care Network ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:03:25 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 20:03:25 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597349005.61.0.762019632569.issue41066@roundup.psfhosted.org> miss-islington added the comment: New changeset 43b3e4c32976bf069241ad8bb174929a816ee7ba by Antoine Pitrou in branch '3.8': [3.8] bpo-41066: Update the comparison section for os vs pathlib (GH-21261) (GH-21864) https://github.com/python/cpython/commit/43b3e4c32976bf069241ad8bb174929a816ee7ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:05:44 2020 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Thu, 13 Aug 2020 20:05:44 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597349144.18.0.141878396728.issue41066@roundup.psfhosted.org> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:06:15 2020 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 13 Aug 2020 20:06:15 +0000 Subject: [issue41066] Update documentation for Pathlib In-Reply-To: <1592756539.0.0.672795473082.issue41066@roundup.psfhosted.org> Message-ID: <1597349175.97.0.237334852266.issue41066@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:09:46 2020 From: report at bugs.python.org (Tianrui Luo) Date: Thu, 13 Aug 2020 20:09:46 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> Message-ID: <1597349386.41.0.852332722798.issue41542@roundup.psfhosted.org> Tianrui Luo added the comment: Thanks! I am closing this bug. I wonder if it worth prompting warnings when unnormalized unicode characters are used. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:11:58 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 20:11:58 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597349518.04.0.729601263509.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 474652fe9346382dbf793f20b671eb74668bebde by Victor Stinner in branch 'master': bpo-40204, doc: Fix syntax of C variables (GH-21846) https://github.com/python/cpython/commit/474652fe9346382dbf793f20b671eb74668bebde ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:24:51 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Aug 2020 20:24:51 +0000 Subject: [issue41536] pathlib's Path("NUL:").resolve() throws an error on windows In-Reply-To: <1597285797.92.0.269181951645.issue41536@roundup.psfhosted.org> Message-ID: <1597350291.98.0.517032043662.issue41536@roundup.psfhosted.org> Steve Dower added the comment: The trailing colon is unnecessary, and likely to cause more issues, but the same thing occurs for Path('NUL').resolve() This is probably best handled as issue37517, where you'll find more background on the error messages. But I believe that p.resolve(strict=True) should not raise when open(p) will succeed, and p.resolve(strict=False) should not raise when open(p) will succeed or raise a *NotFoundError subclass of OSError. ---------- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:31:51 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 20:31:51 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597350711.85.0.68021396854.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +20992 pull_request: https://github.com/python/cpython/pull/21865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:35:38 2020 From: report at bugs.python.org (Seth Woodworth) Date: Thu, 13 Aug 2020 20:35:38 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> Message-ID: <1597350938.41.0.153512634007.issue41542@roundup.psfhosted.org> Seth Woodworth added the comment: I don't think it is worth throwing a warning. This might be the desired, or at least allowed, behavior. I'm relying on the behavior in a toy library I'm working on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:35:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 20:35:01 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597350901.51.0.857104135429.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: With PR 21865, there are only two remaining warnings: Doc/library/string.rst:311: WARNING: duplicate token description of sf:format_spec, other instance in library/string Doc/reference/introduction.rst:96: WARNING: duplicate token description of *:name, other instance in reference/expressions See bpo-35293 for RemovedInSphinx40Warning (which are already prevent with Sphinx 2). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:52:09 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Aug 2020 20:52:09 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597351929.64.0.722064280575.issue41526@roundup.psfhosted.org> Steve Dower added the comment: So it'll take a bit more rearranging to get everything to fit - I've attached one proposal that shuffles the thanks to Mark Hammond down below the "enable long path names" button. (It's grey text in the screenshot, but I've switched it to black already.) Alternatively, we could drop that note completely. It's entirely possible that Mark feels he's been thanked enough, and is now just embarrassed that we keep it around :) There are certainly enough other people with significant contributions on Windows who also deserve thanks. One final option would be to move the "fix long paths" button to earlier in the install, though I'm not doing that during RC. The reason it's not part of the regular install is because it always requires Admin, and while it would be great to have it enabled by default, we already have enough people getting confused about whether admin is required to install or not (it's not, but you have to change the default launcher option on the front page). Anyone have any thoughts? ---------- nosy: +mhammond Added file: https://bugs.python.org/file49387/NewInstallSuccessPage.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 16:58:48 2020 From: report at bugs.python.org (Tom Gringauz) Date: Thu, 13 Aug 2020 20:58:48 +0000 Subject: [issue41543] contextlib.nullcontext doesn't work with async context managers Message-ID: <1597352328.6.0.811344048873.issue41543@roundup.psfhosted.org> New submission from Tom Gringauz : `contextlib.nullcontext` cannot be used with async conetext managers, because it implements only `__enter__` and `__exit__`, and doesn't implement `__aenter__` and `__aexit__`. ---------- components: Library (Lib), asyncio messages: 375346 nosy: asvetlov, tomgrin10, yselivanov priority: normal severity: normal status: open title: contextlib.nullcontext doesn't work with async context managers type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:00:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 13 Aug 2020 21:00:45 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> Message-ID: <1597352445.42.0.846565464806.issue41542@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:08:33 2020 From: report at bugs.python.org (Martin) Date: Thu, 13 Aug 2020 21:08:33 +0000 Subject: [issue41544] multiprocessing.dummy.Process lacks daemon parameter Message-ID: <1597352913.9.0.790175794398.issue41544@roundup.psfhosted.org> New submission from Martin : Although multiprocessing.Process has a `daemon` parameter, multiprocessing.dummy.Process doesn't. As multiprocessing.dummy is meant to replicate the API of multiprocessing and the daemon parameter is readily available in threading.Thread, it should also be available in multiprocessing.dummy.Process. ---------- messages: 375347 nosy: moi90 priority: normal severity: normal status: open title: multiprocessing.dummy.Process lacks daemon parameter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:09:41 2020 From: report at bugs.python.org (Martin) Date: Thu, 13 Aug 2020 21:09:41 +0000 Subject: [issue41544] multiprocessing.dummy.Process lacks daemon parameter In-Reply-To: <1597352913.9.0.790175794398.issue41544@roundup.psfhosted.org> Message-ID: <1597352981.21.0.00807904315127.issue41544@roundup.psfhosted.org> Change by Martin : ---------- keywords: +patch pull_requests: +20993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:16:13 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 13 Aug 2020 21:16:13 +0000 Subject: [issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise. In-Reply-To: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> Message-ID: <1597353373.88.0.977875295337.issue41520@roundup.psfhosted.org> Terry J. Reedy added the comment: Lukasz, please cherry-pick the 3.9 commits for this issue 90eff4ed4445a0fa9d8cdf74c0f86c50ed510dad f24430f1542ea2768793b48704ae2d4e241892ae into 3.9.0rc2 before release. They fix a regression introduced by a bug fix last June. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:19:20 2020 From: report at bugs.python.org (Tom Gringauz) Date: Thu, 13 Aug 2020 21:19:20 +0000 Subject: [issue41543] contextlib.nullcontext doesn't work with async context managers In-Reply-To: <1597352328.6.0.811344048873.issue41543@roundup.psfhosted.org> Message-ID: <1597353560.17.0.20748542001.issue41543@roundup.psfhosted.org> Change by Tom Gringauz : ---------- keywords: +patch pull_requests: +20995 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:25:54 2020 From: report at bugs.python.org (Mark Hammond) Date: Thu, 13 Aug 2020 21:25:54 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597353954.71.0.622592396351.issue41526@roundup.psfhosted.org> Mark Hammond added the comment: Yes, while I appreciate the gesture, I am somewhat embarrassed these days - as you say, many others deserve this more than me these days. So please remove it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:35:36 2020 From: report at bugs.python.org (Martin) Date: Thu, 13 Aug 2020 21:35:36 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1597354536.35.0.485495099925.issue41539@roundup.psfhosted.org> Martin added the comment: While I appreciate your suggestion, it does not help me much. The problem that people usually have is that the output is scrambled. That is not the problem I'm dealing with. I'm experiencing a deadlock caused by the print statement which seems like a python bug to me. Furthermore, the problem appears in a library that is supposed to be used by other people and I have no control over their use of IO. The particular behavior seems to be specific to using threading and multiprocessing together: - If I use multiprocessing.dummy (multiprocessing API implemented with threads; so only a single processes are involved), my example works fine. - If I use a process instead of a thread to fill the queue (filler = multiprocessing.Process(...); so no threads are involved), my example also works fine. - Only if I have two threads in the main process and additional processes, the example fails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:37:37 2020 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 13 Aug 2020 21:37:37 +0000 Subject: [issue41543] contextlib.nullcontext doesn't work with async context managers In-Reply-To: <1597352328.6.0.811344048873.issue41543@roundup.psfhosted.org> Message-ID: <1597354657.6.0.614518234041.issue41543@roundup.psfhosted.org> Yury Selivanov added the comment: I typically don't like objects that support both `with` and `async with`, but in this case I think that's appropriate. Nathaniel, Andrew, what do you think? ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:41:57 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Aug 2020 21:41:57 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597354917.44.0.761466701767.issue41526@roundup.psfhosted.org> Steve Dower added the comment: Thanks, Mark. We shall not hold you solely responsible for the port any longer ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 17:42:49 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Aug 2020 21:42:49 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597354969.04.0.327931089893.issue41526@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +20996 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 19:36:01 2020 From: report at bugs.python.org (Steve Dower) Date: Thu, 13 Aug 2020 23:36:01 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597361761.18.0.800035115372.issue41526@roundup.psfhosted.org> Steve Dower added the comment: New changeset 6444ca946984c638c67a72aac22fd6d3cc650c16 by Steve Dower in branch 'master': bpo-41526: Fixed layout of final page of the installer (GH-21871) https://github.com/python/cpython/commit/6444ca946984c638c67a72aac22fd6d3cc650c16 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 19:36:09 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 23:36:09 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597361769.93.0.914124288023.issue41526@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +20997 pull_request: https://github.com/python/cpython/pull/21872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 19:45:12 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 13 Aug 2020 23:45:12 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> Message-ID: <1597362312.45.0.295738095305.issue41542@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi Seth, Surely you aren't relying on the behaviour that names in `__all__` *aren't* normalised but others are? Rather than a warning, I think the right solution here is to normalise the names in `__all__`. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 19:52:22 2020 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Thu, 13 Aug 2020 23:52:22 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls Message-ID: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> New submission from Yonatan Goldschmidt : I have a construct in my code where I wrap a function's logic with `gc.disable()` to prevent GC from triggering some race condition. Today this construct got a bit more complicated, and another function had to use this "trick". Now there are 2 flows: foo(): gc.disable() .... gc.enable() bar() .... gc.disable() ... # bar calls foo, which also messes with the gc foo() gc.disable() ... gc.enable() ... gc.enable() ... I'd expected the GC to be truly enabled only on the second call to `enable()`, but apparently it's enabled on the first call :( Both `gc.enable()` and `gc.disable()` just write `1`/`0` to `gcstate->enabled`, respectively. For the meantime I wrote a simple wrapper class to do this counting (finally calling `enable()` only when necessary). Another option is for the code to check first "is GC enabled?" before disabling, and before enabling again, remember whether it really disabled it or not. But I think those manual workarounds are more error prone, and it's easier to forget to use it them in all sites (compared to using the "right" API from the standard module), so I was considering if we can add an API that encapsulate this counting: an enable-disable pair that makes sure GC is only enabled back when the number of "enable" calls matches the number of "disable" calls. ---------- components: Interpreter Core messages: 375355 nosy: Yonatan Goldschmidt priority: normal severity: normal status: open title: gc API requiring matching number of gc.disable - gc.enable calls type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 19:55:44 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 13 Aug 2020 23:55:44 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597362944.39.0.053196973503.issue41526@roundup.psfhosted.org> miss-islington added the comment: New changeset 75c2281762932c4e5f0bd7deae40ef014f704de2 by Miss Islington (bot) in branch '3.9': bpo-41526: Fixed layout of final page of the installer (GH-21871) https://github.com/python/cpython/commit/75c2281762932c4e5f0bd7deae40ef014f704de2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 19:59:43 2020 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 13 Aug 2020 23:59:43 +0000 Subject: [issue41543] contextlib.nullcontext doesn't work with async context managers In-Reply-To: <1597352328.6.0.811344048873.issue41543@roundup.psfhosted.org> Message-ID: <1597363183.45.0.516961683807.issue41543@roundup.psfhosted.org> Nathaniel Smith added the comment: It does seem pretty harmless in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 20:10:04 2020 From: report at bugs.python.org (Luiz) Date: Fri, 14 Aug 2020 00:10:04 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw Message-ID: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> New submission from Luiz : If you use the pprint function when running on windowed mode (either by using the .pyw extension or running the file with pythonw) a "AttributeError" exception occurs, saying that "'NoneType' object has no attribute 'write'". Looking at the source code (Lib/pprint.py), it happens because in this mode sys.stdout is set to None, therefore it has no write attribute. I think intended behavior is to simply ignore any console output when in this mode, since many programs have loads of print statements for debugging with a console window; it shouldn't crash because of a extension change. There's two solutions I can think of. One is to check if sys.stdout is None, not printing anything in case it is. Another is, when in windowed mode, setting sys.stdout to some dummy null file. This has the advantage of automatically fixing this in other parts of Python where this error might also occur. This error is particularly hard to find, since in windowed mode there's no console to show the exception - it simply closes. In the attached file, where I showcase the error, I have to log to a file to see the problem. I'm not sure how can this be unnoticed for so much time, it can't possibly be intended, or maybe it is and it's print() that actually has a problem, lol. ---------- components: Library (Lib) files: pprint_error_showcase.py messages: 375358 nosy: luizeldorado priority: normal severity: normal status: open title: pprint() gives exception when ran from pythonw type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49388/pprint_error_showcase.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 20:36:47 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 14 Aug 2020 00:36:47 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597365407.33.0.161079415843.issue41526@roundup.psfhosted.org> Steve Dower added the comment: Fixes merged, just need ?ukasz to confirm it'll be in 3.9.0 and we can resolve this. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 20:55:12 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 14 Aug 2020 00:55:12 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597366512.83.0.513894119796.issue41545@roundup.psfhosted.org> Steven D'Aprano added the comment: > I wrap a function's logic with `gc.disable()` to prevent GC from triggering some race condition. If this race condition is a bug in gc, then we should fix that. If it is a bug in your code, surely you should fix that rather than disable gc. Either way, I don't think we should complicate the gc iterface by adding a second way to enable and disable the cyclic gc. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:33:17 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 01:33:17 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597368797.79.0.859424435811.issue41410@roundup.psfhosted.org> miss-islington added the comment: New changeset e55de68be3e5b977a17d3c0ac9805b0feff8fedc by Rishav Kundu in branch 'master': bpo-41410: Fix outdated info in mkstemp docs (GH-21701) https://github.com/python/cpython/commit/e55de68be3e5b977a17d3c0ac9805b0feff8fedc ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:33:38 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 01:33:38 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597368818.21.0.156524388204.issue41410@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20999 pull_request: https://github.com/python/cpython/pull/21874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:33:29 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 01:33:29 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597368809.22.0.517972120831.issue41410@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +20998 pull_request: https://github.com/python/cpython/pull/21873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:33:46 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 01:33:46 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597368826.87.0.726341832449.issue41410@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21000 pull_request: https://github.com/python/cpython/pull/21875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:51:28 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 01:51:28 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597369888.51.0.958993089952.issue41410@roundup.psfhosted.org> miss-islington added the comment: New changeset 2a9f709ba23c8f6aa2bed821aacc4e7baecde383 by Miss Islington (bot) in branch '3.8': bpo-41410: Fix outdated info in mkstemp docs (GH-21701) https://github.com/python/cpython/commit/2a9f709ba23c8f6aa2bed821aacc4e7baecde383 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:53:46 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 01:53:46 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597370026.64.0.882981357174.issue41410@roundup.psfhosted.org> miss-islington added the comment: New changeset 7c288413db8c2b84dd476b0c8a19f85110d99a2f by Miss Islington (bot) in branch '3.9': bpo-41410: Fix outdated info in mkstemp docs (GH-21701) https://github.com/python/cpython/commit/7c288413db8c2b84dd476b0c8a19f85110d99a2f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 21:58:30 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 14 Aug 2020 01:58:30 +0000 Subject: [issue41410] Opening a file in binary mode makes a difference on all platforms in Python 3 In-Reply-To: <1595863285.0.0.72970010693.issue41410@roundup.psfhosted.org> Message-ID: <1597370310.88.0.126986983015.issue41410@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 22:12:51 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 14 Aug 2020 02:12:51 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1597371171.14.0.887450602721.issue41109@roundup.psfhosted.org> Jeffrey Kintscher added the comment: The current implementation calls object.__new__(cls), where cls is the child class type, from within a class method (@classmethod). This is fine for Path.__new__() and PurePath.__new__(), which are called by the child class's __new__(), because we don't want them to recursively call the child class's __new__() when the child class is created. This all works as expected when the child class is instantiated outside of Path and PurePath, and the child's __init__() gets called as expected. I don't see any point in making changes to this behavior. When one of approximately 20 PurePath and Path functions and properties instantiate a new child class object the same way PurePath.__new__() and Path.__new__() do, the child class's __new__() and __init__() functions are not called. This is the problem we are trying to solve. My fix is to add normal functions (i.e. not decorated with @classmethod) to instantiate child class objects using obj = type(self)() This creates a child class instance, and the child's __new__() and __init__() functions get called. Once I have finished re-plumbing Path and PurePath to use the new functions and created the necessary unit tests (to make sure I didn't break anything), I will also look at adding a proper __init__() function to the two classes instead of having __new__() initialize the member variables. I didn't mean to imply that __init__() isn't useful. It is required to allow the child class to initialize its own variable. I just meant it isn't required to force calling __init__() and __new__() in the child class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 22:38:45 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 02:38:45 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597372725.04.0.828324412924.issue41025@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +21001 pull_request: https://github.com/python/cpython/pull/21876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 13 22:38:39 2020 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 14 Aug 2020 02:38:39 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597372719.46.0.442509207162.issue41025@roundup.psfhosted.org> Paul Ganssle added the comment: New changeset 87d8287865e5c9f137f6b5cf8c34c2c509eb5e9d by Paul Ganssle in branch 'master': bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) https://github.com/python/cpython/commit/87d8287865e5c9f137f6b5cf8c34c2c509eb5e9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 00:23:10 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 14 Aug 2020 04:23:10 +0000 Subject: [issue41541] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597378990.94.0.904800285564.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: OS: Linux 4.19.0-9-amd64 Debian 10 GNU/Linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 00:42:30 2020 From: report at bugs.python.org (hai shi) Date: Fri, 14 Aug 2020 04:42:30 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597380150.6.0.934761851844.issue40275@roundup.psfhosted.org> hai shi added the comment: If someone wants to continue the effort in libregrtest, I suggest to open a new issue. +1. And if there have any other test cases blocked by test.support, I suggest this bpo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 00:56:35 2020 From: report at bugs.python.org (hai shi) Date: Fri, 14 Aug 2020 04:56:35 +0000 Subject: [issue40275] test.support has way too many imports In-Reply-To: <1586816691.28.0.874442798421.issue40275@roundup.psfhosted.org> Message-ID: <1597380995.26.0.379397167661.issue40275@roundup.psfhosted.org> hai shi added the comment: oh, sorry, missing a word: I suggest this bpo.->I suggest close this bpo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 00:57:50 2020 From: report at bugs.python.org (youkaichao) Date: Fri, 14 Aug 2020 04:57:50 +0000 Subject: [issue41547] Expose default __getstate__ and __setstate__ Message-ID: <1597381070.63.0.19953658002.issue41547@roundup.psfhosted.org> New submission from youkaichao : According to the doc ( https://docs.python.org/3/library/pickle.html#object.__getstate__ ), an object may not have a __getstate__ method. During pickling and unpickling, python first finds __getstate__ and __setstate__, which may invoke a customed __getattr__. I think this is unnecessary if python just provides a default implementation for __getstate__ / __setstate__ . An additional benefit of this is that __setstate__ and __getstate__ becomes available for every object and it is possible to do something like ``getstate(obj)``. For people who customize __getattr__, I think no one intends to deal with ``obj.__getattr__??__getstate__??``, so it makes sense not to invoke ``__getattr__`` during pickling and unpickling. ---------- messages: 375369 nosy: youkaichao priority: normal severity: normal status: open title: Expose default __getstate__ and __setstate__ type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 01:05:10 2020 From: report at bugs.python.org (Georg Brandl) Date: Fri, 14 Aug 2020 05:05:10 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597381510.07.0.115416292721.issue40994@roundup.psfhosted.org> Georg Brandl added the comment: FWIW, I think Sydney's right. Shared entries should only be used for closely related, or interdependent, APIs, which those here are not. ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 01:22:11 2020 From: report at bugs.python.org (Tony Reix) Date: Fri, 14 Aug 2020 05:22:11 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597382531.79.0.90042184771.issue41540@roundup.psfhosted.org> Tony Reix added the comment: I forgot to say that this behavior was not present in stable version 3.8.5 . Sorry. On 2 machines AIX 7.2, testing Python 3.8.5 with: + cd /opt/freeware/src/packages/BUILD/Python-3.8.5 + ulimit -d unlimited + ulimit -m unlimited + ulimit -s unlimited + export LIBPATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/64bit:/usr/lib64:/usr/lib:/opt/lib + export PYTHONPATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/64bit/Modules + ./python Lib/test/regrtest.py -v test_decimal ... gave: 507 tests in 227 items. 507 passed and 0 failed. Test passed. So, this issue with v3.10 (master) appeared to me as a regression. However, after hours debugging the issue, I forgot to say it in this defect, sorry. (Previously, I was using limits for -d -m and -s : max 4GB. However, that appeared to be an issue when running tests with Python test option -M12Gb, which requires up and maybe more than 12GB of my 16GB memory machine in order to be able to run a large part of the Python Big Memory tests. And thus I unlimited these 3 resources, with no problem at all with version 3.8.5 .) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 02:25:45 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Aug 2020 06:25:45 +0000 Subject: [issue41547] Expose default __getstate__ and __setstate__ In-Reply-To: <1597381070.63.0.19953658002.issue41547@roundup.psfhosted.org> Message-ID: <1597386345.66.0.947159511131.issue41547@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is virtually a duplicate of isssue26579. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Support pickling slots in subclasses of common classes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 02:37:07 2020 From: report at bugs.python.org (Roger Meier) Date: Fri, 14 Aug 2020 06:37:07 +0000 Subject: [issue41548] IDLE Window rendering on macOS Big Sur Message-ID: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> New submission from Roger Meier : macOS Big Sur, Public Beta (20A5343j) There is noticeable window flickering when the IDLE window is being resized manually. It sometimes become translucent, and sometimes the window frame isn't properly refreshed after resizing, but simply by switching to another app (i.e. removing focus from the IDLE window) the contents are refreshed. This was not the case prior to Big Sur. ---------- assignee: terry.reedy components: IDLE messages: 375373 nosy: roger.meier, terry.reedy priority: normal severity: normal status: open title: IDLE Window rendering on macOS Big Sur 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 Aug 14 02:47:33 2020 From: report at bugs.python.org (Roger Meier) Date: Fri, 14 Aug 2020 06:47:33 +0000 Subject: [issue41548] IDLE Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1597387653.74.0.108487308658.issue41548@roundup.psfhosted.org> Roger Meier added the comment: I have screen capture demonstrating the issue, which I posted here: https://groups.google.com/g/thonny/c/529A5zEsuWg/m/xHVCny8OBwAJ ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 03:48:16 2020 From: report at bugs.python.org (James Barrett) Date: Fri, 14 Aug 2020 07:48:16 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597391296.84.0.369804405492.issue40782@roundup.psfhosted.org> James Barrett added the comment: https://github.com/python/cpython/pull/21852 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:04:36 2020 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Fri, 14 Aug 2020 08:04:36 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597392276.08.0.26916699192.issue41545@roundup.psfhosted.org> Yonatan Goldschmidt added the comment: > If this race condition is a bug in gc, then we should fix that. > If it is a bug in your code, surely you should fix that rather than disable gc. It's neither: it is something related to the combination of some 3rd party libraries I'm using (if you're interested, I have described it here: https://github.com/paramiko/paramiko/issues/1634). > Either way, I don't think we should complicate the gc iterface by adding a second way to enable and disable the cyclic gc. I see what you're saying. I wasn't thinking of of this idea as complicating it, I had in mind existing interfaces which have these 2 sets of functions (for example, Linux's local_irq_enable/disable and local_irq_save/restore). Another approach, only modifying the existing API in a compatible way, will be as follows: --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1489,9 +1489,10 @@ static PyObject * gc_disable_impl(PyObject *module) /*[clinic end generated code: output=97d1030f7aa9d279 input=8c2e5a14e800d83b]*/ { + int was_enabled = gcstate->enabled GCState *gcstate = get_gc_state(); gcstate->enabled = 0; - Py_RETURN_NONE; + return was_enabled ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False); } Then I can write code this way: foo(): disabled = gc.disable() .... if disabled: gc.enable() It can be taken ahead to change `gc.enable()` to `gc.enable(disabled=True)` so I can just call it as `gc.enable(disabled)`: foo(): disabled = gc.disable() .... gc.enable(disabled) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:22:19 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 08:22:19 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597393339.49.0.164735096426.issue40994@roundup.psfhosted.org> Irit Katriel added the comment: Looks like this is not the first time this has come up: https://stackoverflow.com/questions/39789876/why-collections-callable-provides-contains-hash-len-and-ca The link directly to the #collections.abc.Callable section is what makes it confusing: https://python.readthedocs.io/en/latest/library/collections.abc.html#collections.abc.Callable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:22:51 2020 From: report at bugs.python.org (Stefan Krah) Date: Fri, 14 Aug 2020 08:22:51 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597393371.14.0.665784970249.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: > Core developers have full access to AIX system for the asking. Back to you, Stefan. That sounds great. Can we contact you directly, or have I missed an earlier announcement from someone else giving out AIX access? Or are you working on it and I misunderstand the idiomatic English? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:23:50 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 08:23:50 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597393430.85.0.608450126573.issue40994@roundup.psfhosted.org> Irit Katriel added the comment: Sydney, do you want to create a PR for this? I'm happy to if you don't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:29:03 2020 From: report at bugs.python.org (Stefan Krah) Date: Fri, 14 Aug 2020 08:29:03 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597393743.43.0.146905772915.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: > So, this issue with v3.10 (master) appeared to me as a regression. I understand that from your point of view it appears as a regression. However, quoting the C standard, 7.20.3 Memory management functions: "The pointer returned points to the start (lowest byte address) of the allocated space. If the space cannot be allocated, a null pointer is returned." So, for a system that is not currently officially supported, I don't consider it my problem if AIX thinks the space can be allocated. But as I said, I can disable that test on AIX. If I get AIX access, I can look at this more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:40:46 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 08:40:46 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597394446.38.0.376104399827.issue40782@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +asyncio _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:45:14 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 08:45:14 +0000 Subject: [issue41548] IDLE Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1597394714.76.0.577881601279.issue41548@roundup.psfhosted.org> Ned Deily added the comment: Thanks for your report. The screen capture link is not publically available (requires a login). Please find another way to provide it; you can upload and attach an image file to this issue ("Choose File" button). Also, please provide the complete Python version information from the IDLE shell window. And note we do not officially support Big Sur yet. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:49:00 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 08:49:00 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597394940.56.0.480303820782.issue41546@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. Just to be clear, this is running on Windows? And, if so, which version? ---------- components: +Windows nosy: +ned.deily, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:51:51 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 08:51:51 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1597395111.07.0.550591094479.issue41539@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 04:51:48 2020 From: report at bugs.python.org (wyz23x2) Date: Fri, 14 Aug 2020 08:51:48 +0000 Subject: [issue41549] IDLE leaks `_` into hint box Message-ID: <1597395108.67.0.477230529042.issue41549@roundup.psfhosted.org> New submission from wyz23x2 : Reproduce: 1. Open shell and enter an expression, say 1+1. 2. Create a new file and save. 3. Enter a letter and press Tab. `_` appears in the box. ---------- assignee: terry.reedy components: IDLE messages: 375383 nosy: terry.reedy, wyz23x2 priority: normal severity: normal status: open title: IDLE leaks `_` into hint box type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:07:28 2020 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 14 Aug 2020 09:07:28 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1597396048.8.0.937669202492.issue40468@roundup.psfhosted.org> Cheryl Sabella added the comment: See also issue #33051. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:11:34 2020 From: report at bugs.python.org (Vinay Sharma) Date: Fri, 14 Aug 2020 09:11:34 +0000 Subject: [issue39584] multiprocessing.shared_memory: MacOS crashes by running attached Python code In-Reply-To: <1581171504.91.0.0818206259105.issue39584@roundup.psfhosted.org> Message-ID: <1597396294.53.0.53015161404.issue39584@roundup.psfhosted.org> Change by Vinay Sharma : ---------- keywords: +patch pull_requests: +21002 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:23:11 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 14 Aug 2020 09:23:11 +0000 Subject: [issue33786] @asynccontextmanager doesn't work well with async generators In-Reply-To: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> Message-ID: <1597396991.89.0.325068485163.issue33786@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +21003 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/21878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:36:36 2020 From: report at bugs.python.org (Raphael Grewe) Date: Fri, 14 Aug 2020 09:36:36 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars Message-ID: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> New submission from Raphael Grewe : Hi at all, Maybe I am using the put function incorrectly, but it is not possible to add larger strings there. The programm keeps locked and is doing nothing. I tested it on latest Debian Buster. Python 3.7.3 (default, Jul 25 2020, 13:03:44) Please check the example script. python3 test_simple_queue_put.py 2**16-13 ---------- files: test_simple_queue_put.py messages: 375385 nosy: rgrewe priority: normal severity: normal status: open title: SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars versions: Python 3.7 Added file: https://bugs.python.org/file49389/test_simple_queue_put.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:37:24 2020 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 14 Aug 2020 09:37:24 +0000 Subject: [issue41551] test.support has way too many imports in libregrtest Message-ID: <1597397844.25.0.450972102548.issue41551@roundup.psfhosted.org> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- components: Tests nosy: thatiparthy priority: normal severity: normal status: open title: test.support has way too many imports in libregrtest versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:38:49 2020 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 14 Aug 2020 09:38:49 +0000 Subject: [issue41551] test.support has way too many imports in libregrtest Message-ID: <1597397929.74.0.568680866086.issue41551@roundup.psfhosted.org> New submission from Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : This issue is inspired from this comment - https://bugs.python.org/msg375367 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:43:58 2020 From: report at bugs.python.org (Terry Greeniaus) Date: Fri, 14 Aug 2020 09:43:58 +0000 Subject: [issue41552] uuid.uuid1() on macOS doesn't generate unique IDs Message-ID: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> New submission from Terry Greeniaus : I'm using Python 3.8.5 on a 2016 MacBook Pro running macOS Catalina 10.15.3. This model has a touch bar and macOS communicates with the touch bar via a dedicated "iBridge" network interface. The iBridge network interface uses a fixed MAC address that is common across all MacBook Pro models (ac:de:48:00:11:22). Normally uuid.uuid1() picks up my WiFi MAC address (which is obviously unique), but this evening I noticed it was generating UUIDs based on the iBridge MAC address. Since the iBridge MAC is shared across all MacBook Pro laptops, there's no way to guarantee that the UUIDs are now universally unique. I'm not sure what triggered uuid.uuid1() to start using my iBridge interface although there was an Internet outage here at some point so maybe the network interfaces got reordered. The iBridge interface (en5) does appear before my WiFi interface (en0) in the output of ifconfig now. Here's a quick example of the problem: greent7 at avocado:~$ python3 Python 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import uuid >>> uuid.uuid1() UUID('32bbad32-de12-11ea-a0ee-acde48001122') And here's the output from ifconfig: greent7 at avocado:~$ ifconfig lo0: flags=8049 mtu 16384 options=1203 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201 gif0: flags=8010 mtu 1280 stf0: flags=0<> mtu 1280 en5: flags=8863 mtu 1500 ether ac:de:48:00:11:22 inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x4 nd6 options=201 media: autoselect status: active en0: flags=8863 mtu 1500 options=400 ether 78:4f:43:5e:b9:86 inet6 fe80::1c4b:d303:b374:c2f3%en0 prefixlen 64 secured scopeid 0x5 inet6 fd00:1cab:c0ac:fc82:80e:f701:8302:6287 prefixlen 64 autoconf secured inet6 fd00:1cab:c0ac:fc82:1c38:9f17:2073:8eb prefixlen 64 autoconf temporary inet 192.168.0.11 netmask 0xffffff00 broadcast 192.168.0.255 nd6 options=201 media: autoselect status: active en3: flags=8963 mtu 1500 options=460 ether 82:46:1a:46:5c:01 media: autoselect status: inactive en1: flags=8963 mtu 1500 options=460 ether 82:46:1a:46:5c:00 media: autoselect status: inactive en4: flags=8963 mtu 1500 options=460 ether 82:46:1a:46:5c:05 media: autoselect status: inactive en2: flags=8963 mtu 1500 options=460 ether 82:46:1a:46:5c:04 media: autoselect status: inactive bridge0: flags=8822 mtu 1500 options=63 ether 82:46:1a:46:5c:00 Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200 root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0 ipfilter disabled flags 0x2 member: en1 flags=3 ifmaxaddr 0 port 7 priority 0 path cost 0 member: en2 flags=3 ifmaxaddr 0 port 9 priority 0 path cost 0 member: en3 flags=3 ifmaxaddr 0 port 6 priority 0 path cost 0 member: en4 flags=3 ifmaxaddr 0 port 8 priority 0 path cost 0 media: status: inactive p2p0: flags=8843 mtu 2304 options=400 ether 0a:4f:43:5e:b9:86 media: autoselect status: inactive awdl0: flags=8943 mtu 1484 options=400 ether f6:38:1e:e0:6c:3f inet6 fe80::f438:1eff:fee0:6c3f%awdl0 prefixlen 64 scopeid 0xc nd6 options=201 media: autoselect status: active llw0: flags=8863 mtu 1500 options=400 ether f6:38:1e:e0:6c:3f inet6 fe80::f438:1eff:fee0:6c3f%llw0 prefixlen 64 scopeid 0xd nd6 options=201 media: autoselect status: active utun0: flags=8051 mtu 1380 inet6 fe80::afc9:f21a:4d82:2c8d%utun0 prefixlen 64 scopeid 0xe nd6 options=201 utun1: flags=8051 mtu 2000 inet6 fe80::4b52:18b4:5f46:4edf%utun1 prefixlen 64 scopeid 0xf nd6 options=201 ---------- components: macOS messages: 375387 nosy: ned.deily, ronaldoussoren, terrygreeniaus priority: normal severity: normal status: open title: uuid.uuid1() on macOS doesn't generate unique IDs type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:44:12 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 09:44:12 +0000 Subject: [issue33786] @asynccontextmanager doesn't work well with async generators In-Reply-To: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> Message-ID: <1597398252.68.0.619166974337.issue33786@roundup.psfhosted.org> Ned Deily added the comment: New changeset cf79cbf4479e395bf7c4df2907f5a444639b4f6f by Miss Islington (bot) in branch '3.7': bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() (GH-7467) (GH-21878) https://github.com/python/cpython/commit/cf79cbf4479e395bf7c4df2907f5a444639b4f6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:53:24 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 09:53:24 +0000 Subject: [issue33786] @asynccontextmanager doesn't work well with async generators In-Reply-To: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> Message-ID: <1597398804.17.0.606961431312.issue33786@roundup.psfhosted.org> Ned Deily added the comment: I'm still not sure exactly what happened here but it looks like the backport to 3.7 (PR 7506) from the original fix in master (pre-3.8) (PR 7467) failed but the backport to 3.6 (PR 7507) succeeded. And then it was backported a second time to 3.6 (PR 7514) which also succeeded but had no effect since there were no intervening changes to those files. So it may be that PR 7514 was intended to be for 3.7 instead of 3.6. In any case, a fresh backport from master to 3.7 (PR 21878) succeeded and tests pass, so into 3.7 it goes for release in 3.7.9. ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 05:54:49 2020 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 14 Aug 2020 09:54:49 +0000 Subject: [issue33786] @asynccontextmanager doesn't work well with async generators In-Reply-To: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> Message-ID: <1597398889.94.0.403002854582.issue33786@roundup.psfhosted.org> Andrew Svetlov added the comment: Thank you very much, Ned! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 06:19:51 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 10:19:51 +0000 Subject: [issue41548] IDLE Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1597400391.03.0.932470518616.issue41548@roundup.psfhosted.org> Ned Deily added the comment: OK, I can reproduce the window resizing stuttering on macOS 11 Big Sur (Intel) Developer Beta 4 using the most recent python.org Python 3.8.5 binary installer; the stuttering does not occur with macOS 10.5.6 Catalina or earlier systems. We have been using an older version of Tk (8.6.8 built on macOS 10.9) that has proved to be reasonably stable across recent versions of macOS but, for full Big Sur and native Apple Silicon support, we'll have to move to a version of Tk that also fully supports Big Sur (most likely 8.6.11 which has not been released yet). I'll keep this open for now. ---------- assignee: terry.reedy -> ned.deily components: +macOS nosy: +ronaldoussoren versions: +Python 3.10 -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 06:20:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Aug 2020 10:20:36 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597400436.0.0.0584133896537.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bb0b08540cc93e56f3f1bde1b39ce086d9e35fe1 by Victor Stinner in branch 'master': bpo-40204: Fix reference to terms in the doc (GH-21865) https://github.com/python/cpython/commit/bb0b08540cc93e56f3f1bde1b39ce086d9e35fe1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 06:24:06 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 10:24:06 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars In-Reply-To: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> Message-ID: <1597400646.81.0.893623623011.issue41550@roundup.psfhosted.org> Irit Katriel added the comment: On windows 10 it's hanging for me from string length of 8175. Stepping through the code, the hang is in the call to _winapi.WaitForMultipleObjects, in PipeConnection._send_bytes, Lib/multiprocessing/connection.py:288 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 07:01:19 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 11:01:19 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597402879.51.0.618296009356.issue41552@roundup.psfhosted.org> Ned Deily added the comment: FWIW, I see similar behavior on a 2017 MBP running with 10.15.6 or 11.0 (Big Sur) beta 4. That's ... odd that there is a non-unique MAC address. (Not surprisingly, there is no such problem on an iMac that doesn't have the touchbar subsystem.) That particular interface doesn't show up in the user-visible Network panel of System Preferences so it can't even be easily reordered there. I suppose there is a good reason why it appears at the top of the interface list but, yes, we don't want to be using a non-unique MAC address to generate UUIDs. The question then is: is there any way for the uuid module to recognize and ignore such interfaces other than by the hardcoded MAC address? ---------- stage: -> needs patch title: uuid.uuid1() on macOS doesn't generate unique IDs -> uuid.uuid1() on certain Macs does not generate unique IDs versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 07:21:27 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 11:21:27 +0000 Subject: [issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs In-Reply-To: <1588884932.92.0.367303002443.issue40553@roundup.psfhosted.org> Message-ID: <1597404087.1.0.619987620258.issue40553@roundup.psfhosted.org> Ned Deily added the comment: James, thanks very much for your detailed instructions. Alas, once again, I am unable to reproduce the hanging behavior under apparently similar conditions (10.5.6, Documents folder on iCloud, etc). I know this is frustrating to all of us. I have one new concrete suggestion: if someone who can reproduce this behavior at will is willing to allow me to screen share into their system (via Apple's Messages app) so they can demonstrate it live, perhaps that will allow us to better isolate the problem. If anyone is interested in helping with this, contact me via email (nad at python dot org) and we can set up a time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 07:23:11 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 Aug 2020 11:23:11 +0000 Subject: [issue41548] Tk Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1597404191.85.0.512430652063.issue41548@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: -IDLE title: IDLE Window rendering on macOS Big Sur -> Tk Window rendering on macOS Big Sur _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 07:36:35 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 14 Aug 2020 11:36:35 +0000 Subject: [issue41541] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597404995.53.0.397009874559.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Note that defining _login_pty() was not a cosmetic change; it is reused in spawn(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 07:53:18 2020 From: report at bugs.python.org (Erik Quaeghebeur) Date: Fri, 14 Aug 2020 11:53:18 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation Message-ID: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> New submission from Erik Quaeghebeur : Encoded-word is apparently used for header line folding sometimes. This appears to me as an abuse of this encoding technique. However, that is not the main issue: it also causes a violation of RFC 2074, as it also encodes message id's: https://tools.ietf.org/html/rfc2047#section-5 says ?An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.? and https://tools.ietf.org/html/rfc5322#section-3.6.4 says ?The message identifier (msg-id) syntax is a limited version of the addr-spec construct enclosed in the angle bracket characters, "<" and ">".? This causes actual problems. Namely, email clients cannot parse the message id and so have trouble with generation of In-Reply-To and References headers or problems with thread reconstruction using these headers containing encoded-word versions of message ids. Minimal example: --- >>>?import email >>>?import email.policy >>> msg = email.message_from_string("""From: test at example.com To: test at example.org Subject: Test Date: Mon, 10 Aug 2020 22:52:53 +0000 Message-ID: X-Some-Blobby-Custom-Header: DIZEglcw6TIh1uC2UrnNjWYqe8l/bYo0oxKG7mBX38s1urzvCwQD30Q07DDJFgTVZWKbThu6hVjR53MTYAHYClHPt8UvyFPkAUIc8Ps1/R+HuSQ8gbR1R03sKoFAgPZKO+FKJ9bNbBb60THl81zSCsZiALwi4LLOqnf9ZIB111G4/shFuWxRlPcsPJt72sn+tTHZqK9fRAyoK1OZCZMJmjQGysovicz1Xc6nOXHMQr2+suRwOJwSUqvsfkj8EEtzJGj7ICQ2GbgBaOjcof1AML4RCFy/vD5bG0Y8HQ2KET3SraTki4dPo+xMYSZVFEy/va4rYeynOXPfxXfHSyIFwB6gnH74Ws/XPk8ZxhAQ2wSy7Hvgg3tZ7HOmlLWg4A/vUGN+8RJlgn+hHtuCXnglv+fIKEhW36wcFotngSrcXULbTlqdE5zjuV5O7wNfgIShZnNhnPdLipslmZJGaa6RQpIonZbwUWCM8g9DZmSwo8g0On0l20IVS9s6bUCddwRZ5erHx4eUZ4DGh4YyR2fgm0WsNVW8pVsAdFMClfAJYqyPEqrDN91djfPYRZPMvzYWTAm8MAip6vDa1ZvzywDpGJYD3VwapLfgFy+AR0S/q/V1HHRmSXx1oNLEedhAt0OkIxWxO8FvqNeEfMLVhxTk1g== MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" BODY """) >>> print(msg.as_bytes(policy=email.policy.SMTPUTF8).decode()) From: test at example.com To: test at example.org Subject: Test Date: Mon, 10 Aug 2020 22:52:53 +0000 Message-ID: =?utf-8?q?=3CVI1PR09MB41911D8371E899C1FE78EE48FA440=40abcdefghij?= =?utf-8?q?klm=2Enmopqrst=2Euvwx=2Eexample=2Ecom=3E?= X-Some-Blobby-Custom-Header: =?utf-8?q?DIZEglcw6TIh1uC2UrnNjWYqe8l/bYo0oxKG7?= =?utf-8?q?mBX38s1urzvCwQD30Q07DDJFgTVZWKbThu6hVjR53MTYAHYClHPt8UvyFPkAUIc8P?= =?utf-8?q?s1/R+HuSQ8gbR1R03sKoFAgPZKO+FKJ9bNbBb60THl81zSCsZiALwi4LLOqnf9ZIB?= =?utf-8?q?111G4/shFuWxRlPcsPJt72sn+tTHZqK9fRAyoK1OZCZMJmjQGysovicz1Xc6nOXHM?= =?utf-8?q?Qr2+suRwOJwSUqvsfkj8EEtzJGj7ICQ2GbgBaOjcof1AML4RCFy/vD5bG0Y8HQ2KE?= =?utf-8?q?T3SraTki4dPo+xMYSZVFEy/va4rYeynOXPfxXfHSyIFwB6gnH74Ws/XPk8ZxhAQ2w?= =?utf-8?q?Sy7Hvgg3tZ7HOmlLWg4A/vUGN+8RJlgn+hHtuCXnglv+fIKEhW36wcFotngSrcXUL?= =?utf-8?q?bTlqdE5zjuV5O7wNfgIShZnNhnPdLipslmZJGaa6RQpIonZbwUWCM8g9DZmSwo8g0?= =?utf-8?q?On0l20IVS9s6bUCddwRZ5erHx4eUZ4DGh4YyR2fgm0WsNVW8pVsAdFMClfAJYqyPE?= =?utf-8?q?qrDN91djfPYRZPMvzYWTAm8MAip6vDa1ZvzywDpGJYD3VwapLfgFy+AR0S/q/V1HH?= =?utf-8?q?RmSXx1oNLEedhAt0OkIxWxO8FvqNeEfMLVhxTk1g=3D=3D?= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" BODY --- ---------- components: email messages: 375397 nosy: barry, equaeghe, r.david.murray priority: normal severity: normal status: open title: encoded-word abused for header line folding causes RFC 2047 violation type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 08:18:55 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 14 Aug 2020 12:18:55 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597407535.61.0.194270531961.issue41552@roundup.psfhosted.org> Vedran ?a?i? added the comment: I'd like to point out that _even_ if you do reuse MAC address: 1. node IDs don't have to be derived from MAC addresses only (though in practice they usually are - I'm just saying the RFC gives you permission to include other information in it). 2. The time resolution is 100ns. As long as your UUID generations are more than 0.2?s apart, you're safe from collisions. 3. There is still a clock sequence, which for these purposes can be viewed as random. Even if you _do_ generate UUIDs on different machines with same MAC and naive nodeID-deriving algorithm, two or more of them within the same 100ns-interval, there is still only a probability of 1/16384 (62ppm) of collision. In short, it's probably not a problem, though if there is an easy fix, of course it should be applied. Currently, there are two ways to indicate "this is not a real unique MAC address" that UUID recognizes: # Virtual interfaces, such as those provided by # VPNs, do not have a colon-delimited MAC address # as expected, but a 16-byte HWAddr separated by # dashes. These should be ignored in favor of a # real MAC address and the 41st bit test /More details at #32107/. Maybe there is a third way, but if the above address doesn't play by these rules, maybe hardcoding it isn't so bad an idea. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 08:41:07 2020 From: report at bugs.python.org (David Edelsohn) Date: Fri, 14 Aug 2020 12:41:07 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597408867.41.0.851013688117.issue41540@roundup.psfhosted.org> David Edelsohn added the comment: AIX systems at OSUOSL have been part of the GNU Compile Farm for a decade. It also is the system on which I have been running the Python Buildbot. Any Compile Farm user has access to AIX. https://cfarm.tetaneutral.net/users/new/ Also, IBM is in the process of creating a dedicated VM at OSUOSL for the Python Buildbot to support more builders. We probably can provide access to Python core members to log in to that system as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:06:56 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 14 Aug 2020 13:06:56 +0000 Subject: [issue37296] pdb next vs __next__ In-Reply-To: <1560626859.25.0.0533027405715.issue37296@roundup.psfhosted.org> Message-ID: <1597410416.9.0.909658264555.issue37296@roundup.psfhosted.org> Ronald Oussoren added the comment: Please add more information on how to reproduce the problem. The current description is not complete enough to be able to determine if there is a bug and if so where that bug is. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:22:41 2020 From: report at bugs.python.org (Luiz) Date: Fri, 14 Aug 2020 13:22:41 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597411361.5.0.0143428670407.issue41546@roundup.psfhosted.org> Luiz added the comment: I'm on Windows 7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:28:16 2020 From: report at bugs.python.org (Sydney Pemberton) Date: Fri, 14 Aug 2020 13:28:16 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1597393430.85.0.608450126573.issue40994@roundup.psfhosted.org> Message-ID: Sydney Pemberton added the comment: Yes, that would be great. I will figure out how to do that shortly. On Fri, Aug 14, 2020 at 3:23 AM Irit Katriel wrote: > > Irit Katriel added the comment: > > Sydney, do you want to create a PR for this? I'm happy to if you don't. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- Sydney Pemberton Software Engineer 512.740.6591 spemberton at auntbertha.com Aunt Bertha | The Social Care Network ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:30:20 2020 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Fri, 14 Aug 2020 13:30:20 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597411820.41.0.961346918462.issue41552@roundup.psfhosted.org> R?mi Lapeyre added the comment: > The question then is: is there any way for the uuid module to recognize and ignore such interfaces other than by the hardcoded MAC address? Could uuid1 xor all mac addresses on MacOS? The result would be deterministic and unique as long as there is at least one mac address that is unique. ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:41:49 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 13:41:49 +0000 Subject: [issue41554] PR proceeds to "awaiting core review" when changes are requested Message-ID: <1597412509.05.0.639537821302.issue41554@roundup.psfhosted.org> New submission from Irit Katriel : When I click on "review" I get three options: comment, approve, and request changes. I assumed that "request changes" would block the PR until the changes were made, but instead in the case of PR 19046 it proceeded to "awaiting core review", which seems to imply that it passed the first review. ---------- messages: 375404 nosy: iritkatriel priority: normal severity: normal status: open title: PR proceeds to "awaiting core review" when changes are requested type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:43:54 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 14 Aug 2020 13:43:54 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597412634.43.0.276275786867.issue41552@roundup.psfhosted.org> Ronald Oussoren added the comment: Note that recent commits to the trunk and 3.8 and 3.9 branches have added a _uuid module using libuuid (and the comparable Windows API). I'd expect that this extension will also be used on macOS. I'd advise to check if this issue is still present when using that extension before spending too much time on a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:47:45 2020 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 14 Aug 2020 13:47:45 +0000 Subject: [issue41554] PR proceeds to "awaiting core review" when changes are requested In-Reply-To: <1597412509.05.0.639537821302.issue41554@roundup.psfhosted.org> Message-ID: <1597412865.58.0.148388673521.issue41554@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:48:19 2020 From: report at bugs.python.org (Tom) Date: Fri, 14 Aug 2020 13:48:19 +0000 Subject: [issue33727] Server.wait_closed() doesn't always wait for its transports to fihish In-Reply-To: <1527829909.37.0.682650639539.issue33727@psf.upfronthosting.co.za> Message-ID: <1597412899.9.0.800154529598.issue33727@roundup.psfhosted.org> Tom added the comment: I ran into this while working on an asyncio application using asyncio.start_server. >From the documentation, I expected the combination of `close` and `wait_closed` to wait until all connection handlers have finished. Instead, handlers remaining running with open connections as background tasks. I wanted to be able to "gracefully" close the server, with all processing done, so I could inspect some results for a test case. Could there be a method for this? One suggestion would be: * Clarify the current behaviour of `close` and `wait_closed` (https://bugs.python.org/issue34852) * Add new coro `wait_finished` which waits until all handler tasks are done I'm afraid I'm not familiar with low-level asyncio APIs like transports and protocols, so I don't know how/if this fits in with those. ---------- nosy: +tmewett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 09:58:32 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 14 Aug 2020 13:58:32 +0000 Subject: [issue41554] PR proceeds to "awaiting core review" when changes are requested In-Reply-To: <1597412509.05.0.639537821302.issue41554@roundup.psfhosted.org> Message-ID: <1597413512.39.0.319307878653.issue41554@roundup.psfhosted.org> Eric V. Smith added the comment: I think this belongs under https://github.com/python/bedevere ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 10:03:37 2020 From: report at bugs.python.org (Seth Woodworth) Date: Fri, 14 Aug 2020 14:03:37 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597344413.55.0.876960006552.issue41542@roundup.psfhosted.org> Message-ID: <1597413817.92.0.472445857575.issue41542@roundup.psfhosted.org> Seth Woodworth added the comment: @Steven, I'm exploring what unicode code points can be used as valid starting characters for identifiers. I'm looping over the code point ranges with the XID_START property and attempting to add them to globals() to see if they maintain the same representation. Now that I think about it, I could just check if unicode.normalize('NFKC', character) == character before adding it, and I wouldn't see a warning if one existed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 10:08:50 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 14 Aug 2020 14:08:50 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597414130.33.0.440160293762.issue40994@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +21004 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 10:09:32 2020 From: report at bugs.python.org (R. David Murray) Date: Fri, 14 Aug 2020 14:09:32 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation In-Reply-To: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> Message-ID: <1597414172.41.0.76670593834.issue41553@roundup.psfhosted.org> R. David Murray added the comment: It's not really an abuse. It is, however, buggy. It should be being applied *only* when the header contains unstructured text. Unfortunately I made the choice to treat any header that doesn't have a specific parser as unstructured, and that was a wrong choice which should be fixed. It is an interesting question what should be used as the default parser, though. Suggestions and code are welcome :) There should be specific header parsers for headers that contain message ids. That was on my todo list but did not get done before my circumstances changed and my free-time focus moved away from python development work :( The message_id parser exists. In-Reply-To just needs to be declared in the header registry as a MessageIDHeader (not sure how that got missed). Writing a Header class for References should be trivial, it's just a list of message ids. That will fix those headers, and I suggest we do that asap. Fixing the default-to-unstructured will take a bit more thought and should probably be split out into a separate issue. I can review and give advice (though you may have to ping me directly) but I won't have time to write any code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 10:26:44 2020 From: report at bugs.python.org (Aivar Annamaa) Date: Fri, 14 Aug 2020 14:26:44 +0000 Subject: [issue41548] Tk Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1597415204.27.0.776673890106.issue41548@roundup.psfhosted.org> Aivar Annamaa added the comment: A related discussion is here: https://core.tcl-lang.org/tk/tktview/dcb35fbd78a0bc31ad409cf717f16a472ca3f627 ---------- nosy: +Aivar.Annamaa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 10:47:08 2020 From: report at bugs.python.org (Erik Quaeghebeur) Date: Fri, 14 Aug 2020 14:47:08 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation In-Reply-To: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> Message-ID: <1597416428.48.0.247837593977.issue41553@roundup.psfhosted.org> Erik Quaeghebeur added the comment: Note that In-Reply-To can also contain multiple message ids: . It should be treated the same as References. When you say that a message_id parser exists, then that means it is not applied to the Message-Id header by default yet, because my example shows that the Message-Id header gets mangled. Applying encoded-word encoding to (unknown) unstructured fields may break workflows. These are often X-? headers and one cannot assume that the application generating and consuming them apply decoding. (Just as with message ids.) The most reliable approach would be to not encode them, but apply white-space folding and then leave them to go beyond the limit set (78 characters, typically). As headers, the increased line length is not that big of a problem. (The 78 limit is for visual reasons.) In case the lines still go beyond 998 characters, an error should be raised, as that is an RFC violation. Tools generating such headers are severely broken and should not get a free pass. Users could get the option to allow such lines and take their chances when the message is submitted and transported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 11:18:45 2020 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 14 Aug 2020 15:18:45 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597418325.89.0.764086601442.issue41025@roundup.psfhosted.org> Paul Ganssle added the comment: New changeset 33d3c64095bcdf9066a3441f6dda5d2e2f4118a8 by Miss Islington (bot) in branch '3.9': bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) (GH-21876) https://github.com/python/cpython/commit/33d3c64095bcdf9066a3441f6dda5d2e2f4118a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 11:19:08 2020 From: report at bugs.python.org (Steve Dower) Date: Fri, 14 Aug 2020 15:19:08 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597418348.67.0.574294369068.issue41546@roundup.psfhosted.org> Steve Dower added the comment: This is normal, if obscure, behaviour. Pythonw starts without a console, and so stdout is not connected to anything. As a result, you can't print (or pprint). You'll need to set sys.stdout to something or provide a file if you want to print output. If someone wants to contribute a specialised sys.stdout implementation that can raise a more helpful error message in this case, that would be helpful. But as it's a breaking change it would only go into 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 11:47:19 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 15:47:19 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars In-Reply-To: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> Message-ID: <1597420039.53.0.0669645178549.issue41550@roundup.psfhosted.org> Irit Katriel added the comment: I've now reproduced it on osX, with string length of 65515. It takes a different code path than the windows version, and I was able to see more. This seems to be the sequence of events that leads to the hang: import multiprocessing.reduction import struct import os string_length = 65515 obj = "a"*string_length obj = multiprocessing.reduction.ForkingPickler.dumps(obj) m = memoryview(obj) n = 65533 mm = m[0:n] _, writer = os.pipe() header = struct.pack("!i", n) os.write(writer, header) os.write(writer, mm) I think what's happening is that the os.pipe that the queue is writing to has filled up, and then write blocks until any of it has been consumed. This version of your script seems to confirm that: import multiprocessing import sys q = multiprocessing.SimpleQueue() string_length = eval(sys.argv[1]) print(string_length) long_string = "a"*(string_length//2) q.put(long_string) q.get() <---- comment this out and it hangs again q.put(long_string) print("Never reach this line :-(") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 11:55:36 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 14 Aug 2020 15:55:36 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597420536.82.0.893143962164.issue41552@roundup.psfhosted.org> Vedran ?a?i? added the comment: +1 on xoring all MAC addresses to get NodeID. Since it is only done once at import time, it shouldn't be too expensive (many other things including OS calls are done at initialization). But yes, if the problem goes away with new version of _uuid, then the fix isn't needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:01:35 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 16:01:35 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars In-Reply-To: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> Message-ID: <1597420895.81.0.899397945614.issue41550@roundup.psfhosted.org> Irit Katriel added the comment: You probably need to use Queue instead of SimpleQueue: https://docs.python.org/3.8/library/multiprocessing.html#multiprocessing.Queue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:02:50 2020 From: report at bugs.python.org (Joshua Merchant) Date: Fri, 14 Aug 2020 16:02:50 +0000 Subject: [issue14527] How to link with a non-system libffi? In-Reply-To: <1333851935.11.0.629390980004.issue14527@psf.upfronthosting.co.za> Message-ID: <1597420970.73.0.959277210592.issue14527@roundup.psfhosted.org> Change by Joshua Merchant : ---------- nosy: +Joshua Merchant _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:35:58 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 14 Aug 2020 16:35:58 +0000 Subject: [issue41510] Mentions of pdb.set_trace() in library/functions and library/sys incorrectly states that set_trace expects no arguments In-Reply-To: <1596932075.04.0.305444661582.issue41510@roundup.psfhosted.org> Message-ID: <1597422958.21.0.793741341631.issue41510@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:47:33 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 14 Aug 2020 16:47:33 +0000 Subject: [issue41554] PR proceeds to "awaiting core review" when changes are requested In-Reply-To: <1597412509.05.0.639537821302.issue41554@roundup.psfhosted.org> Message-ID: <1597423653.39.0.532623887502.issue41554@roundup.psfhosted.org> Irit Katriel added the comment: It appears (as per core-mentoring list) that this is the intended behavior. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:50:25 2020 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 14 Aug 2020 16:50:25 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597423825.38.0.731446356715.issue41025@roundup.psfhosted.org> Paul Ganssle added the comment: ?ukasz: Would it be possible to backport / cherry-pick the changes from PR GH-21876 (https://github.com/python/cpython/pull/21876) into the 3.9.0 branch? I think this is a fairly severe issue considering that pendulum is planning to use a zoneinfo subclass. It was merged as commit 33d3c64095bcdf9066a3441f6dda5d2e2f4118a8. Thanks! ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:51:18 2020 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 14 Aug 2020 16:51:18 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597423878.14.0.396892354584.issue41025@roundup.psfhosted.org> Paul Ganssle added the comment: Marking as release blocker to put it on the checklist. Feel free to demote it if you decide it should be deferred to 3.9.1. ---------- priority: high -> release blocker resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 12:51:29 2020 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 14 Aug 2020 16:51:29 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597423889.52.0.0385045326116.issue41025@roundup.psfhosted.org> Change by Paul Ganssle : ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 13:12:29 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 Aug 2020 17:12:29 +0000 Subject: [issue41549] IDLE leaks `_` into hint box In-Reply-To: <1597395108.67.0.477230529042.issue41549@roundup.psfhosted.org> Message-ID: <1597425149.35.0.94690189495.issue41549@roundup.psfhosted.org> Terry J. Reedy added the comment: I cannot reproduce from the description. More details: OS and maybe version, exact Python version (only most recent releases count as completions have been touched recently), exact key presses and click in which windows. Step 2 should be irrelevant. Step 3 gives me a box with keywords and builtins. Backspace and hitting '_' adds entries beginning with '_', including '_' when defined. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 13:52:20 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Aug 2020 17:52:20 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597427540.63.0.916877187246.issue41521@roundup.psfhosted.org> Raymond Hettinger added the comment: > I would prefer avoiding python-dev, since there are many > trolls there who like to argue but not try to fix problem. It's not a good precedent to define as trolls anyone who might legitimately disagree, nor is it a good precedent to bypass discussion entirely. IMO, Serhiy's request was reasonable and shouldn't be dismissed. For this particular change, I'm +1 because it represents an industrywide terminology shift, because it makes a proactive effort to be responsive to cultural problems, and because the change doesn't impair clarity. That said, I concur with Serhiy that there should be a discussion before making a unilateral and stealthy change to the rules about how people are allowed to write technical prose. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 14:25:01 2020 From: report at bugs.python.org (Luiz) Date: Fri, 14 Aug 2020 18:25:01 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597429501.63.0.301940833668.issue41546@roundup.psfhosted.org> Luiz added the comment: If this is normal behavior, then why does print() not produce any error? Shouldn't it say that it can't print because there's no stdout? That's not very consistent, both functions have almost the same name yet produce very different results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 14:29:37 2020 From: report at bugs.python.org (Ammar Askar) Date: Fri, 14 Aug 2020 18:29:37 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597429777.64.0.387943015899.issue41545@roundup.psfhosted.org> Ammar Askar added the comment: > I'd expected the GC to be truly enabled only on the second call to `enable()`, but apparently it's enabled on the first call :( Both `gc.enable()` and `gc.disable()` just write `1`/`0` to `gcstate->enabled`, respectively. I don't think this API makes much sense. I would expect `enable()` to enable the GC regardless of how many disable calls have been made. This is also in line with other functions like `faulthandler.enable()` / `bdb.Breakpoint.enable()` I think the proper solution if you want to do this would be to wrap the disabling/enabling and keep track of the number of calls yourself. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 14:54:30 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 18:54:30 +0000 Subject: [issue41527] smart quotes in Lib/pydoc_data/topics.py file In-Reply-To: <1597213866.96.0.245351837241.issue41527@roundup.psfhosted.org> Message-ID: <1597431270.84.0.581367785107.issue41527@roundup.psfhosted.org> Ned Deily added the comment: The topics file is regenerated by the release manager immediately before tagging a new release. That's what all those commits are. The commands to do so are: cd Doc make venv pydoc-topcs cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py So, once the smart quotes are removed from the source files (Issue41525), the smart quotes will disappear from the topics file at the next (pre-)release. You can hurry things along by running and merging the topics file manually. ---------- nosy: +ned.deily resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python '--help' has corrupted text. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 14:57:10 2020 From: report at bugs.python.org (Mariatta) Date: Fri, 14 Aug 2020 18:57:10 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597431430.08.0.0997242509612.issue39994@roundup.psfhosted.org> Mariatta added the comment: @Palak Kumar Jha, you created a PR for this ticket but it seems that your GitHub account is inactive/has been removed. Do you have a new GitHub account? Are you still interested in continuing on this PR? ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 14:57:56 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 14 Aug 2020 18:57:56 +0000 Subject: [issue41549] IDLE leaks `_` into hint box In-Reply-To: <1597395108.67.0.477230529042.issue41549@roundup.psfhosted.org> Message-ID: <1597431476.72.0.785847262795.issue41549@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think that I understood what is the issue. 1. Open the IDLE editor, type "foo" and press . The pop-up list does not contain "foo". 2. Switch to the IDLE shell, type "foo = 1" and press . 3. Switch back to the IDLE editor (the cursor points after "foo") and press again. The pop-up list contains now "foo". The problem is that the completion list for editor contains names from the shell instead of only from builtins. When you run the code from the editor, names from the shell are not automatically available. It can be a feature if you use the same star-import in the shell and editor, but it can also be considered as a bug. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 15:05:18 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 19:05:18 +0000 Subject: [issue41527] smart quotes in Lib/pydoc_data/topics.py file In-Reply-To: <1597213866.96.0.245351837241.issue41527@roundup.psfhosted.org> Message-ID: <1597431918.63.0.579683896754.issue41527@roundup.psfhosted.org> Ned Deily added the comment: Sorry, my previous response was incomplete and I closed this prematurely. Re-opening. ---------- resolution: duplicate -> stage: resolved -> status: closed -> open superseder: Python '--help' has corrupted text. -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 15:05:29 2020 From: report at bugs.python.org (Ned Deily) Date: Fri, 14 Aug 2020 19:05:29 +0000 Subject: [issue41527] smart quotes in Lib/pydoc_data/topics.py file In-Reply-To: <1597213866.96.0.245351837241.issue41527@roundup.psfhosted.org> Message-ID: <1597431929.23.0.143526170089.issue41527@roundup.psfhosted.org> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg375424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 15:54:15 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 14 Aug 2020 19:54:15 +0000 Subject: [issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures In-Reply-To: <1593614146.46.0.384684767233.issue41183@roundup.psfhosted.org> Message-ID: <1597434855.77.0.127642237813.issue41183@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- nosy: +hroncok nosy_count: 2.0 -> 3.0 pull_requests: +21005 pull_request: https://github.com/python/cpython/pull/21882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 16:09:18 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 Aug 2020 20:09:18 +0000 Subject: [issue41516] venv activate scripts do not pass ShellCheck In-Reply-To: <1597074770.49.0.0492267082511.issue41516@roundup.psfhosted.org> Message-ID: <1597435758.12.0.302079829587.issue41516@roundup.psfhosted.org> Terry J. Reedy added the comment: (3.6 only gets security fixes.) Please be more specific: venv produces 6 types of scripts. Which type(s) are seen as buggy? Can you paste a script produced by venv and its ShellCheck output? (The web site has a paste-in box.) Have you used ShellCheck? Can you sign the contributor agreement submit a PR? (Yes, we do sometimes create, review, and upon agreement merge patches based of various code and text checkers.) ---------- nosy: +terry.reedy, vinay.sajip versions: +Python 3.10 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 16:20:45 2020 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 14 Aug 2020 20:20:45 +0000 Subject: [issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures In-Reply-To: <1593614146.46.0.384684767233.issue41183@roundup.psfhosted.org> Message-ID: <1597436445.77.0.605791455648.issue41183@roundup.psfhosted.org> Miro Hron?ok added the comment: Does testing with the environment variable OPENSSL_CONF=/non-existing-file workaround the remaining issues? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 17:05:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 14 Aug 2020 21:05:36 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597439136.83.0.5298381468.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: > That said, I concur with Serhiy that there should be a discussion before making a unilateral and stealthy change to the rules about how people are allowed to write technical prose. I suggest you to join the discussion there: https://github.com/python/devguide/issues/605 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 17:25:54 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 14 Aug 2020 21:25:54 +0000 Subject: [issue41541] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597440354.14.0.927085012403.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: v0.2 moves _setwinsz block to parent after fork. ---------- Added file: https://bugs.python.org/file49390/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 18:06:51 2020 From: report at bugs.python.org (Erik Quaeghebeur) Date: Fri, 14 Aug 2020 22:06:51 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation In-Reply-To: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> Message-ID: <1597442811.48.0.272899879601.issue41553@roundup.psfhosted.org> Erik Quaeghebeur added the comment: We also shouldn't forget Resent-Message-Id. So in the header registry , 'message-id': MessageIDHeader, should be replaced by 'message-id': UniqueSingleMessageIDHeader, 'resent-message-id': SingleMessageIDHeader, 'in-reply-to': UniqueMessageIDHeader, 'references': UniqueMessageIDHeader, with Unique/Single used as for the other Headers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 18:15:33 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 14 Aug 2020 22:15:33 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597443333.4.0.228323350792.issue41546@roundup.psfhosted.org> Terry J. Reedy added the comment: If you run in windowed mode, you are expected to either not use sys.stdout or to provide a working sys.stdout object. I am not sure if that is explicitly documented as I cannot find python.exe and pythonw.exe or .py or .pyw in the index and https://docs.python.org/3/using/windows.html#python-launcher-for-windows does not mention the pyw version. But this is not really a windowed mode issue. In a Windows console: >>> print('hello') hello >>> import sys; sys.stdout = None >>> print('hello') >>> sys.stdout = sys.__stdout__ >>> print('hello') hello print and pprint act differently because pprint uses stream.write without try/except. Check the doc or code. So pprint users must run it with a stream with that method. Otherwise, failure is to be expected. If you try to print to None, print defaults to sys.stdout. The doc does not define what happens when the latter is None. On CPython, print passes. But maybe this is left undefined intentionally. It must either check that file is not None or catch the AttributeError. >Shouldn't it say that it can't print because there's no stdout? How could it if there is no channel to speak? I guess Guido decided to silently pass rather than silently exit. Debug prints should not crash a program. So closing as 'Not a bug' would be one appropriate resolution for this issue. ---------- nosy: +terry.reedy type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 18:28:33 2020 From: report at bugs.python.org (S. Zhang) Date: Fri, 14 Aug 2020 22:28:33 +0000 Subject: [issue41555] re.sub replaces twice Message-ID: <1597444113.99.0.353653909979.issue41555@roundup.psfhosted.org> New submission from S. Zhang : The following command produced "name.tsvtsv" with version 3.7.1 and 3.8.5 instead of the expected "name.tsv" from version 2.7.5, 3.5.6, and 3.6.7. Changing * to + produced expected "name.tsv". python -c 'import re; v="name.txt";v = re.sub("[^\.]*$", "tsv", v);print(v)' ---------- messages: 375436 nosy: spz1st priority: normal severity: normal status: open title: re.sub replaces twice type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 18:54:06 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Aug 2020 22:54:06 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597445646.68.0.05367263867.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: > While we're doing this, any chance we could special-case > the two-argument hypot to use the libm hypot directly? Yes, that is an easy amendment (see below). I just tried it out on the macOs build but didn't see a change in accuracy from the current PR which uses lossless power-of-two-scaling and Neumaier summation. In GCC's libquadmath implementation, the comments say that the error is less than 1 ulp, falling short of being correctly rounded within ?? ulp. If the platform hypots have the nearly the same accuracy as the current PR, it may make sense to skip the special case and opt for consistent cross-platform results. ================================================================== $ git diff diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index d0621f59df..3a42ea5318 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -2457,6 +2457,10 @@ vector_norm(Py_ssize_t n, double *vec, double max, int found_nan) if (max == 0.0 || n <= 1) { return max; } + if (n == 2) { + /* C library hypot() implementations tend to be very accurate */ + return hypot(vec[0], vec[1]); + } frexp(max, &max_e); if (max_e >= -1023) { scale = ldexp(1.0, -max_e) $ 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/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin $ ./python.exe test_hypot.py ======== 2 dimensions ======== platform hypot(): [(-1.0, 8398), (0.0, 83152), (1.0, 8450)] scaled-by-2 : [(-1.0, 8412), (0.0, 83166), (1.0, 8422)] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 19:18:24 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 14 Aug 2020 23:18:24 +0000 Subject: [issue41541] Make pty.spawn set window size [ + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597447104.64.0.754840736003.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Screenshot: output of "ls" before the patch is applied. ---------- title: Make pty.spawn set window size -> Make pty.spawn set window size [ + before, after screenshots ] Added file: https://bugs.python.org/file49391/before.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 19:19:04 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 14 Aug 2020 23:19:04 +0000 Subject: [issue41541] Make pty.spawn set window size [ + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597447144.84.0.668789584948.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Screenshot: output of "ls" after the patch is applied. ---------- Added file: https://bugs.python.org/file49392/after.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 19:23:48 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 14 Aug 2020 23:23:48 +0000 Subject: [issue41541] Make pty.spawn set window size [ patch + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597447428.36.0.3034808581.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: Make pty.spawn set window size [ + before, after screenshots ] -> Make pty.spawn set window size [ patch + before, after screenshots ] _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 19:29:18 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 14 Aug 2020 23:29:18 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597447758.21.0.957996869092.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: This paper addresses the topic directly: https://arxiv.org/pdf/1904.09481.pdf I tried to reproduce the results shown in Table 1 of the paper. For clib hypot(), they get 1 ulp errors 12.91% of the time. On my build, using the same gaussian distribution, I get 14.08% for both the clang hypot() and for the current version of the PR, showing that the two are fundamentally the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 19:33:12 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Fri, 14 Aug 2020 23:33:12 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation In-Reply-To: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> Message-ID: <1597447992.63.0.00199687092269.issue41553@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 20:20:55 2020 From: report at bugs.python.org (Terry Greeniaus) Date: Sat, 15 Aug 2020 00:20:55 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597450855.49.0.643694475026.issue41552@roundup.psfhosted.org> Terry Greeniaus added the comment: xoring does not guarantee uniqueness and has a good chance of discarding it, so it seems like a bad idea to me. Suppose I have exactly two adapters with MAC addresses 0 and 3. Suppose you have exactly two adapters with MAC addresses 1 and 2. We'll both xor all our addresses and both get 0 ^ 3 == 1 ^ 2. This trivially extends to 48 bits. Suppose I have exactly two adapters from the same manufacturer. The xor will throw away all of the "uniqueness" guaranteed by the manufacturer OUI and replace it with 0. Suppose you have exactly two adapters from a different manufacturer (and nothing else). The xor will throw away all of your "uniqueness" guaranteed by the manufacturer OUI and replace it with 0. Now the only uniqueness between your UUIDs and my UUIDs will be the timestamp and the low-order bits of the xor'd MAC, whereas without the xor your UUIDs and my UUIDs would have absolutely been guaranteed to be unique since they are from different manufacturers with different OUIs. I realize that the documentation for uuid1() states that it isn't guaranteed to give unique addresses if the time synchronization necessary isn't supported by the platform, so I suppose this could even be a documentation fix if no real solution can be found, but that would be really undesirable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 20:51:24 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Aug 2020 00:51:24 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597452684.65.0.425681842586.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Per the referenced paper, here's what is involved in further reducing error: def hypot(*coords): # Corrected, unfused: https://arxiv.org/pdf/1904.09481.pdf # Simplified version omits scaling and handling of wide ranges. # Only handle the 2-dimensional cases. # Has 1 ulp error 0.88% of the time (0.54% per the paper). # Can be reduced to 0.00% with a reliable fused multiply-add. a, b = map(fabs, coords) h = sqrt(a*a + b*b) if h <= 2*b: delta = h - b x = a*(2*delta - a) + (delta - 2*(a - b))*delta else: delta = h - a x = 2*delta*(a - 2*b) + (4*delta - b)*b + delta*delta return h - x/(2*h) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 21:08:45 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 15 Aug 2020 01:08:45 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597453725.43.0.333477951853.issue41552@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 21:33:36 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Sat, 15 Aug 2020 01:33:36 +0000 Subject: [issue35786] get_lock() method is not present for Values created using multiprocessing.Manager() In-Reply-To: <1547934632.93.0.223661167179.issue35786@roundup.psfhosted.org> Message-ID: <1597455216.61.0.518796023989.issue35786@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 21:55:10 2020 From: report at bugs.python.org (Ned Deily) Date: Sat, 15 Aug 2020 01:55:10 +0000 Subject: [issue35786] get_lock() method is not present for Values created using multiprocessing.Manager() In-Reply-To: <1547934632.93.0.223661167179.issue35786@roundup.psfhosted.org> Message-ID: <1597456510.14.0.950458840919.issue35786@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 22:22:04 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 02:22:04 +0000 Subject: [issue41541] Make pty.spawn set window size [ patch + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597458124.55.0.846715111749.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Adding the test program [ test.py ] as an attachment. It was taken from https://docs.python.org/3/library/pty.html. How to reproduce issue: 1. Notice that the xterm window in before.png is not too wide; this makes the output of "ls" wrap around the xterm window. 2. Run test.py. 3. Run "ls". Solution: 1. Apply latest version of the patch [ pty.diff ]. 2. Run test.pty and run "ls". 3. Run "ls". ---------- Added file: https://bugs.python.org/file49393/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 22:37:39 2020 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 Aug 2020 02:37:39 +0000 Subject: [issue41555] re.sub replaces twice In-Reply-To: <1597444113.99.0.353653909979.issue41555@roundup.psfhosted.org> Message-ID: <1597459059.77.0.141713288192.issue41555@roundup.psfhosted.org> Ma Lin added the comment: The re.sub() doc said: Changed in version 3.7: Empty matches for the pattern are replaced when adjacent to a previous non-empty match. IMO 3.7+ behavior is more reasonable, and it fixed a bug, see issue25054. ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 23:17:42 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 03:17:42 +0000 Subject: [issue41541] Make pty.spawn set window size [ patch + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597461462.95.0.537952310314.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: I am new to BPO. Just learned how to make someone nosy. @twouters, I have attached all resources. This is ready for a review. Thank you. ---------- nosy: +twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 23:43:23 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 03:43:23 +0000 Subject: [issue41541] Make pty.spawn set window size [ patch + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597463003.06.0.718506645286.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- nosy: +mark.dickinson, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 14 23:57:02 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 03:57:02 +0000 Subject: [issue41541] Make pty.spawn set window size [ patch + before, after screenshots ] In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597463822.1.0.167856888264.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Additional note: I am using the i3wm window manager. No desktop environment. ---------- nosy: -mark.dickinson, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 00:04:39 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 04:04:39 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597464279.62.0.207391883548.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: Make pty.spawn set window size [ patch + before, after screenshots ] -> [PATCH] Make pty.spawn set window size _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 00:54:40 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Aug 2020 04:54:40 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597467280.26.0.0596473264628.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Update: def hypot(*coords): # Corrected, unfused: https://arxiv.org/pdf/1904.09481.pdf # Simplified version omits scaling and handling of wide ranges # Has 1 ulp error 0.44% of the time (0.54% per the paper). # Can be reduced to 0% with a fused multiply-add. a, b = map(fabs, coords) if a < b: a, b = b, a h = sqrt(a*a + b*b) if h <= 2*b: delta = h - b x = a*(2*delta - a) + (delta - 2*(a - b))*delta else: delta = h - a x = 2*delta*(a - 2*b) + (4*delta - b)*b + delta*delta return h - x/(2*h) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 01:03:13 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 15 Aug 2020 05:03:13 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597467793.66.0.844122798394.issue41513@roundup.psfhosted.org> Tim Peters added the comment: Cute: for any number of arguments, try computing h**2, then one at a time subtract a**2 (an argument squared) in descending order of magnitude. Call that (h**2 - a1**2 - a2**2 - ...) x. Then h -= x/(2*h) That should reduce errors too, although not nearly so effectively, since it's a cheap way of estimating (& correcting for) the discrepancy between sum(a**2) and h**2. Note that "descending order" is important: it's trying to cancel as many leading bits as possible as early as possible, so that lower-order bits come into play. Then again ... why bother? ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 01:31:31 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 15 Aug 2020 05:31:31 +0000 Subject: =?utf-8?q?=5Bissue41542=5D_module_=60=5F=5Fall=5F=5F=60_cannot_detect_fun?= =?utf-8?q?ction_name_with_=60=CF=86=60?= In-Reply-To: <1597413817.92.0.472445857575.issue41542@roundup.psfhosted.org> Message-ID: <20200815053039.GT23924@ando.pearwood.info> Steven D'Aprano added the comment: On Fri, Aug 14, 2020 at 02:03:37PM +0000, Seth Woodworth wrote: > I'm exploring what unicode code points can be used as valid starting > characters for identifiers. I presume you have seen the documention here: https://docs.python.org/3/reference/lexical_analysis.html#identifiers > I'm looping over the code point ranges > with the XID_START property and attempting to add them to globals() to > see if they maintain the same representation. You can add any hashable key to globals, it's just a dict: py> globals()[2] = 'test' py> globals()[2] 'test' Including strings that differ in their normalization: py> import unicodedata py> phi = '?' py> nphi = unicodedata.normalize('NFKC', phi) py> g = globals() py> g[phi] == g[nphi] False The strings are only normalised when used as variables: py> eval(f'{phi} == {nphi}') True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 03:05:20 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 15 Aug 2020 07:05:20 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597475120.59.0.973566342873.issue41545@roundup.psfhosted.org> Dennis Sweeney added the comment: This is exactly the motivation for context managers, no? I attached no_gc.py, which works when nested and should additionally be thread-safe. Usage: from no_gc import no_gc with no_gc(): # collection disabled with no_gc(): # collection is still disabled # collection is still disabled # collection is finally re-enabled here ---------- nosy: +Dennis Sweeney Added file: https://bugs.python.org/file49394/no_gc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 03:22:53 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 15 Aug 2020 07:22:53 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597476173.2.0.0345362369488.issue39994@roundup.psfhosted.org> Eric V. Smith added the comment: I went ahead and closed the PR. Either @Palak Kumar Jha or someone else can create a new PR. The suggestions in the original PR should be addresses. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 04:59:51 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 08:59:51 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597481991.69.0.740719967951.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: v0.3 removes _login_pty() and defines _login_tty() instead; the latter is based on login_tty(3) from glibc. ---------- Added file: https://bugs.python.org/file49395/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 05:02:59 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 09:02:59 +0000 Subject: [issue39994] Redundant code in pprint module. In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597482179.2.0.974604686669.issue39994@roundup.psfhosted.org> Irit Katriel added the comment: Thanks, I'll create a new PR and credit @Palak Kumar Jha as co-author. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 05:25:03 2020 From: report at bugs.python.org (Dick Visser) Date: Sat, 15 Aug 2020 09:25:03 +0000 Subject: [issue41556] hostname verification fails if hostname starts with literal IPv4 Message-ID: <1597483503.9.0.826978747102.issue41556@roundup.psfhosted.org> New submission from Dick Visser : I'm trying to connect to an HTTPS site with ssl.create_default_context, which implies hostname verification is done. This fails when connecting to a hostname that starts with a literal IPv4 address. Reproduce with: #!/usr/bin/env python3 import socket import ssl hostname = '145.100.57.105.surf-hosted.nl' # hostname = 'python.org' context = ssl.create_default_context() with socket.create_connection((hostname, 443)) as sock: with context.wrap_socket(sock, server_hostname=hostname) as ssock: cert = ssock.getpeercert() print(cert) Running this yeidls: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP address mismatch, certificate is not valid for '145.100.57.105.surf-hosted.nl'. (_ssl.c:1123) While the certificate on that host is perfectly fine (is has both CN and a subject alt name). Since the actual verification is done by OpenSSL, I tried that manually, and that does validate the hostname OK: dnmvisser at NUC8i5BEK ~$ openssl s_client -connect 145.100.57.105.surf-hosted.nl:443 -verify_hostname 145.100.57.105.surf-hosted.nl CONNECTED(00000005) depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3 verify return:1 depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 verify return:1 depth=0 CN = 145.100.57.105.surf-hosted.nl verify return:1 --- Certificate chain 0 s:CN = 145.100.57.105.surf-hosted.nl i:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 1 s:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 i:O = Digital Signature Trust Co., CN = DST Root CA X3 --- Server certificate -----BEGIN CERTIFICATE----- MIIFcTCCBFmgAwIBAgISAxA+MIkEpMc+JZEnhsWHqhSiMA0GCSqGSIb3DQEBCwUA MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0yMDA3MjUxNDM2NDdaFw0y MDEwMjMxNDM2NDdaMCgxJjAkBgNVBAMTHTE0NS4xMDAuNTcuMTA1LnN1cmYtaG9z dGVkLm5sMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvrpqHQUU2AMF KD+aF/XP4qdUe02NiZNG20s1YX8o9T8tVpFlaMbC5GouNpUWvchtRk2uwAEjW7xo //NCBPi5PuT0pfBz5gBhOpMMs3CXUqKCeFK+HxpWQM6h8+TARlWAfUpJ1EDcEK04 L0Oo0hPiq4utQSNouUpLmRMZtiZNH7ct4nht1JUJFr87p+IV9sDqxkZXdqSGvPyq El3dJq+id9f3eaPiTypHg08KGEaH6Cujuhrs98p0lXqZMG/dlR7AOtjHbJCaX0WI iodBri3BrhotMKyMNzWj35rlwf0lJO/vyEf0FanbjWwgfAQSQuTWY3Z4Aerl4DoY 0B063LU+EwIDAQABo4ICcTCCAm0wDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQG CCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBR+vf/J VqaQVTf6YUJvUxh95h3n5TAfBgNVHSMEGDAWgBSoSmpjBH3duubRObemRWXv86js oTBvBggrBgEFBQcBAQRjMGEwLgYIKwYBBQUHMAGGImh0dHA6Ly9vY3NwLmludC14 My5sZXRzZW5jcnlwdC5vcmcwLwYIKwYBBQUHMAKGI2h0dHA6Ly9jZXJ0LmludC14 My5sZXRzZW5jcnlwdC5vcmcvMCgGA1UdEQQhMB+CHTE0NS4xMDAuNTcuMTA1LnN1 cmYtaG9zdGVkLm5sMEwGA1UdIARFMEMwCAYGZ4EMAQIBMDcGCysGAQQBgt8TAQEB MCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly9jcHMubGV0c2VuY3J5cHQub3JnMIIBAwYK KwYBBAHWeQIEAgSB9ASB8QDvAHUAb1N2rDHwMRnYmQCkURX/dxUcEdkCwQApBo2y CJo32RMAAAFzhp6XvgAABAMARjBEAiARmq5foTaEABWuwX7XEwkVe7bnml98UGLw xXNG6DOtnwIgYgw+zA5LZICtlFS6QXXxtjUBZ6eNReieBYFHQywZcf4AdgAHt1wb 5X1o//Gwxh0jFce65ld8V5S3au68YToaadOiHAAAAXOGnpfnAAAEAwBHMEUCIFhg BCwM0ywDEP23WLRSOdSSSEAiTzAWQiDnT/St7FlHAiEAwOH86Z4dfV6HivcCZmEG MxsOywJC3JNO0ei0nFZXurIwDQYJKoZIhvcNAQELBQADggEBAFZytDjS2R1jwp8q 2qXp2kl9L33jV5tjAk+q08x0QVLdquBu5QsFjzq6ukZIlZsZV/08Jnb8rn0LaOgg B2nRlbl4Hmwcb4hL3Zpb7yH0nBZiOAI45SbYC/jnjHG2GzKazvtu/Sx8FYQgmRt+ vEGopOKdXrBd0OAJODV/bbv3SwwrQU0Z5cHriqSYz+Mho7aK57bQp2kuyiznNnuP VVxC+F0HL/z2jFq2cbjzFJS3tD8nS45ZR3i2dt/QRqcWqWaUVwoSA4DwoJMhoHQu unMnkBlXJpCodRvTNy/FmLJsCmOZbl2R0PH8Xd9qc4qfBnzzMvyI6iiT1Qb0qFAn HnciWiE= -----END CERTIFICATE----- subject=CN = 145.100.57.105.surf-hosted.nl issuer=C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 --- No client certificate CA names sent Peer signing digest: SHA512 Peer signature type: RSA Server Temp Key: ECDH, P-256, 256 bits --- SSL handshake has read 3085 bytes and written 457 bytes Verification: OK Verified peername: 145.100.57.105.surf-hosted.nl --- New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384 Session-ID: FE1915CF13C685CBE0A3B19238967A3F8B16C2322D69212492404DE230339E09 Session-ID-ctx: Master-Key: 756B52BC2B2823DD8992E7EE5869CFE929107142AE311B68D9245DF3D049C2FEDE931210F5D11B6F6A3A504923D833D1 PSK identity: None PSK identity hint: None SRP username: None Start Time: 1597482694 Timeout : 7200 (sec) Verify return code: 0 (ok) Extended master secret: no --- I'm guessing that there is some (greedy) IPv4 matching logic that causes the bare literal IPv4 address to be sent to OpenSSL for verification instead of the entire hostname? Because the error (X509_V_ERR_IP_ADDRESS_MISMATCH, https://github.com/python/cpython/blob/3.8/Modules/_ssl.c#L666-L670) indicates that OpenSSL is doing an IP address verification instead of a hostname verification. ---------- assignee: christian.heimes components: SSL messages: 375454 nosy: christian.heimes, dnmvisser priority: normal severity: normal status: open title: hostname verification fails if hostname starts with literal IPv4 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 06:04:24 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 15 Aug 2020 10:04:24 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 Message-ID: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : SQLite 3.33.0 was just released: https://www.sqlite.org/releaselog/3_33_0.html Suggesting to wait one week before updating, to see if a patch version appears. Python 3.9 and 3.10 both build fine against SQLite 3.33.0, and make test completes without complaints. I'll prepare a patch for the source deps repo, and a pair of patches for macOS/Windows. ---------- components: Library (Lib) messages: 375455 nosy: erlendaasland priority: normal severity: normal status: open title: Upgrade Windows and macOS builds to use SQLite 3.33 type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 06:58:27 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 15 Aug 2020 10:58:27 +0000 Subject: [issue41549] IDLE leaks `_` into hint box In-Reply-To: <1597395108.67.0.477230529042.issue41549@roundup.psfhosted.org> Message-ID: <1597489107.92.0.962369391515.issue41549@roundup.psfhosted.org> Terry J. Reedy added the comment: The global completion list for Shell or Editor comprises keywords (recently added), builtins, and global names bound by code executed in the current subprocess. The doc recommends restarting the subprocess when editing so that the global names are those resulting from the code being edited rather than code enter in Shell. (I an trying to make this even clearer in the doc.) wyz23x2 appears to claim that at least one leading underscore name, in particular '_', appeared in the list without having ever entered '_' as the prefix to be completed. That would be a bug. (_ names appear after ZeroDivisionError.) This might have happened in the past, but I do not see this in current IDLE. Without further info, I will close this as 'not a bug'. If '_' appeared alone, without the builtins, that would be a deeper bug. ---------- versions: +Python 3.10 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 07:55:50 2020 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Aug 2020 11:55:50 +0000 Subject: [issue41556] hostname verification fails if hostname starts with literal IPv4 In-Reply-To: <1597483503.9.0.826978747102.issue41556@roundup.psfhosted.org> Message-ID: <1597492550.38.0.941481626884.issue41556@roundup.psfhosted.org> Christian Heimes added the comment: Python uses OpenSSL's a2i_IPADDRESS() to check if the hostname is actually an IP address. I'm surprised as you that the function considers a hostname like 145.100.57.105.surf-hosted.nl as a valid IP address. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 08:06:59 2020 From: report at bugs.python.org (Christian Heimes) Date: Sat, 15 Aug 2020 12:06:59 +0000 Subject: [issue41556] hostname verification fails if hostname starts with literal IPv4 In-Reply-To: <1597483503.9.0.826978747102.issue41556@roundup.psfhosted.org> Message-ID: <1597493219.15.0.340260294875.issue41556@roundup.psfhosted.org> Christian Heimes added the comment: I filed https://github.com/openssl/openssl/issues/12649 with OpenSSL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 08:10:48 2020 From: report at bugs.python.org (S. Zhang) Date: Sat, 15 Aug 2020 12:10:48 +0000 Subject: [issue41555] re.sub replaces twice In-Reply-To: <1597459059.77.0.141713288192.issue41555@roundup.psfhosted.org> Message-ID: S. Zhang added the comment: Thanks. But if talking about empty matches, there would be endless empty matches at the end in such cases. So in my opinion, [^\.]*$ should match txt plus the empty match because the greedy rule applies here. On Fri, Aug 14, 2020 at 10:37 PM Ma Lin wrote: > > Ma Lin added the comment: > > The re.sub() doc said: > Changed in version 3.7: Empty matches for the pattern are replaced when > adjacent to a previous non-empty match. > > IMO 3.7+ behavior is more reasonable, and it fixed a bug, see issue25054. > > ---------- > nosy: +malin > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 08:17:19 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 15 Aug 2020 12:17:19 +0000 Subject: [issue41552] uuid.uuid1() on certain Macs does not generate unique IDs In-Reply-To: <1597398238.17.0.874687707711.issue41552@roundup.psfhosted.org> Message-ID: <1597493839.88.0.45695757649.issue41552@roundup.psfhosted.org> Vedran ?a?i? added the comment: Yes, you're right. Xoring can be replaced by any key-derivation function, though of course that's probably overkill. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 08:45:08 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sat, 15 Aug 2020 12:45:08 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597495508.64.0.815027690542.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: v0.4 puts try-except guards around imports so that existing code does not break. ---------- Added file: https://bugs.python.org/file49396/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 08:51:40 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 12:51:40 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597495900.51.0.62555995047.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: Thank you, David! Now that I can test on AIX, I can confirm that the data limit is the culprit: libmpdec deliberately calls malloc(52631578947368422ULL) in the maxprec tests, which is supposed to fail, but succeeds. However, instead of freezing the machine, the process gets a proper SIGKILL almost instantly. As I suggested earlier, using -bmaxdata prevents this from happening and the test passes. ./configure CC=xlc AR="ar -X64" CFLAGS="-q64 -qmaxmem=70000 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qthreaded -D_THREAD_SAFE -D__VACPP_MULTI__" LDFLAGS="-L/usr/lib64 -q64 -Wl,-bmaxdata:0x800000000" I have not figured out a similar gcc option yet, but only searched for 5 min. The question now is: Since this is expected behavior on AIX, and xlc (and probably gcc as well) have limit command line switches, do we need to disable the test? I tried to set rlimit in the test, which works on Linux but is broken on AIX: test test_decimal failed -- Traceback (most recent call last): File "/home/skrah/cpython/Lib/test/test_decimal.py", line 5684, in test_maxcontext_exact_arith resource.setrlimit(resource.RLIMIT_DATA, (8000000, hardlimit)) OSError: [Errno 14] Bad address So disabling the test would be the best option, unless we want to educate users about -bmaxdata. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 09:05:27 2020 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 Aug 2020 13:05:27 +0000 Subject: [issue41555] re.sub replaces twice In-Reply-To: <1597444113.99.0.353653909979.issue41555@roundup.psfhosted.org> Message-ID: <1597496727.49.0.106774396962.issue41555@roundup.psfhosted.org> Ma Lin added the comment: There can be at most one empty match at a position. IIRC, Perl's regex engine has very similar behavior. If don't want empty match, use + is fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 09:34:04 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 13:34:04 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597498444.36.0.900825743646.issue39994@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) title: Redundant code in pprint module. -> pprint handling of dict subclasses that override __repr__ type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 09:49:26 2020 From: report at bugs.python.org (David Edelsohn) Date: Sat, 15 Aug 2020 13:49:26 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597499366.89.0.467212799484.issue41540@roundup.psfhosted.org> David Edelsohn added the comment: AIX uses a "late" memory allocation scheme by default. If the test wants to malloc(52631578947368422ULL) and intends it to fail, it should run with the AIX $ export PSALLOC=early environment variable. More than all of the other maxdata changes. Separate from all of this, you are configuring as 64 bit (-q64). -qmaxmem affects the compiler optimization. -Wl,-bmaxdata:0x800000000 is a GCC command line option. "-Wl," passes the appended flag to the linker. So somehow you're using GCC to invoke the linker, although building with XLC. XLC knows about -bmaxdata directly. On the other hand, -bmaxdata behaves differently in 32 bit mode and 64 bit mode. In 32 bit mode, it increases the heap size from the default 256MB. In 64 bit mode, it sets a guaranteed maximum size for the heap. So I think that -bmaxdata may be helping, but not for the reason that you believe. -Wl,-bmaxdata:0x80000000 may work, although I don't understand how that correctly interacts with XLC. If you truly are running in 64 bit mode, then -bmaxdata has an effect like PSALLOC. I sort of think that the solution desired for the testcase is PSALLOC=early to match traditional Unix/Linux malloc() behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 10:03:45 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 14:03:45 +0000 Subject: [issue40878] Use c99 on the aixtools bot In-Reply-To: <1591385655.5.0.64244490428.issue40878@roundup.psfhosted.org> Message-ID: <1597500225.64.0.581413101627.issue40878@roundup.psfhosted.org> Change by Stefan Krah : ---------- keywords: +patch pull_requests: +21006 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21887 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 10:05:42 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 14:05:42 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597500342.35.0.677537268696.issue39994@roundup.psfhosted.org> Irit Katriel added the comment: While writing the tests I see that it's even more interesting: (Pdb) dd = MyDict() (Pdb) pprint.pformat(dd) '{}' (Pdb) pprint.saferepr(dd) 'I do my own thing ....' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 10:06:36 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 14:06:36 +0000 Subject: [issue40878] Use c99 on the aixtools bot In-Reply-To: <1591385655.5.0.64244490428.issue40878@roundup.psfhosted.org> Message-ID: <1597500396.24.0.915435689298.issue40878@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 40e700ad042089120456cc2ee79b8ca69479416b by Stefan Krah in branch 'master': bpo-40878: xlc cannot handle C99 extern inline. (GH-21887) https://github.com/python/cpython/commit/40e700ad042089120456cc2ee79b8ca69479416b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 10:47:43 2020 From: report at bugs.python.org (Fred Drake) Date: Sat, 15 Aug 2020 14:47:43 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597502863.38.0.285401363846.issue39994@roundup.psfhosted.org> Fred Drake added the comment: And that is why the original code was checking not only for the type, but the actual __repr__ method itself. I think the current behavior is broken. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 11:06:39 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 15:06:39 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597503999.65.0.182063092206.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: > -qmaxmem affects the compiler optimization. I know, that's just from the Python README.AIX. I didn't expect it to have any influence. > -Wl,-bmaxdata:0x800000000 is a GCC command line option. That is indeed surprising. Linking is prepared by a script: $ ./Modules/makexp_aix Modules/python.exp . libpython3.10.a; xlc -L/usr/lib64 -q64 -Wl,-bmaxdata:0x800000000 -Wl,-bE:Modules/python.exp -lld -o python Programs/python.o libpython3.10.a -lintl -ldl -lpthread -lm -lm The xlc command runs without warnings or errors. Without Wl,-bmaxdata:0x800000000 ================================ $ ./python -m test -uall test_decimal 0:00:00 Run tests sequentially 0:00:00 [1/1] test_decimal Killed With Wl,-bmaxdata:0x800000000 ============================= $ ./python -m test -uall test_decimal 0:00:00 Run tests sequentially 0:00:00 [1/1] test_decimal == Tests result: SUCCESS == 1 test OK. Total duration: 17.3 sec Tests result: SUCCESS > On the other hand, -bmaxdata behaves differently in 32 bit mode and 64 bit mode. In 32 bit mode, it increases the heap size from the default 256MB. In 64 bit mode, it sets a guaranteed maximum size for the heap. Yes, that's what I expected. The test only allocates that much memory for 64-bit builds. The workaround only needs to be enabled for 64-bit. So a memory softlimit, same as e.g. djb uses for qmail with his softlimit program, is exactly what I was looking for. > I sort of think that the solution desired for the testcase is PSALLOC=early to match traditional Unix/Linux malloc() behavior. I can try that, but our test suite might complain about the environment being modified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 11:24:25 2020 From: report at bugs.python.org (Ketan Bhatt) Date: Sat, 15 Aug 2020 15:24:25 +0000 Subject: [issue41558] Backspace not clearing the text Message-ID: <1597505065.08.0.273403618121.issue41558@roundup.psfhosted.org> New submission from Ketan Bhatt : The below statement is not clearing the text, although there are three backspaces: print("123",end="\b\b\b") The output from the Jupiter note book is 12!!! ---------- files: bug.ipynb messages: 375469 nosy: ketanbhatt18 priority: normal severity: normal status: open title: Backspace not clearing the text versions: Python 3.9 Added file: https://bugs.python.org/file49397/bug.ipynb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 11:28:33 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 15 Aug 2020 15:28:33 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597505313.91.0.0807093926006.issue39994@roundup.psfhosted.org> Eric V. Smith added the comment: I realize it might break some corner cases, but I really think we should re-write pprint to use functools.singledispatch. Or if the breakage isn't acceptable, abandon it and create a new module that does use singledispatch. That way it would be easily extensible. pprint currently works with a dispatch table (_dispatch), it's just hidden. @fdrake: From the comments: "If you find it useful, thank small children who sleep at night". I assume they're not small anymore! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 11:47:55 2020 From: report at bugs.python.org (Safihre) Date: Sat, 15 Aug 2020 15:47:55 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597506475.55.0.615530273764.issue31122@roundup.psfhosted.org> Safihre added the comment: Would anyone be able to review this? People keep reporting this bug in my project. Months are just passing while the PR is just a few lines of code: https://github.com/python/cpython/pull/18772/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 11:51:48 2020 From: report at bugs.python.org (Ma Lin) Date: Sat, 15 Aug 2020 15:51:48 +0000 Subject: [issue37095] [Feature Request]: Add zstd support in tarfile In-Reply-To: <1559187768.11.0.7498103877.issue37095@roundup.psfhosted.org> Message-ID: <1597506708.0.0.38744796167.issue37095@roundup.psfhosted.org> Ma Lin added the comment: There are two zstd modules on pypi: https://pypi.org/project/zstd/ https://pypi.org/project/zstandard/ The first one is too simple. The second one is powerful, but has too many APIs: ZstdCompressorIterator ZstdDecompressorIterator ZstdCompressionReader ZstdCompressionWriter ZstdCompressionChunkerIterator (multi-thread compression) IMO these are not necessary for stdlib. In addition, it needs to add something, such as the `max_length` parameter, and a `ZstdFile` class that can be integrated with the tarfile module. These workloads are not big. I looked at the zstd API, it's a bit simpler than lzma/bz2/zlib. If spend a month, should be able to make a zstd module for stdlib. Then discuss the detailed API on Python-Ideas. I once wanted to do this job, but it seems my time does not allow it. If anyone wants to do this work, please reply here. FYI, Python 3.10 schedule: 3.10.0 beta 1: 2021-05-03 (No new features beyond this point.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 11:59:56 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 15:59:56 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597507196.68.0.24981730344.issue39994@roundup.psfhosted.org> Irit Katriel added the comment: import pprint class MyDict(dict): def __repr__(self): return '*'*len(dict.__repr__(self)) if __name__ == '__main__': d=MyDict({}) print('pprint.pformat(d):\n%s' % pprint.pformat(d)) print('pprint.pformat(d, width=1, indent=0):\n%s' % pprint.pformat(d, width=1, indent=0)) Output: pprint.pformat(d): ** pprint.pformat(d, width=1, indent=0): {} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 12:08:27 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 15 Aug 2020 16:08:27 +0000 Subject: [issue41558] Backspace not clearing the text In-Reply-To: <1597505065.08.0.273403618121.issue41558@roundup.psfhosted.org> Message-ID: <1597507707.94.0.0515899802727.issue41558@roundup.psfhosted.org> Steven D'Aprano added the comment: Works correctly for me in the Python interpreter. Please check if it works for you in the Python interpreter, if it does, then it is a bug in Jupyter and should be reported to them, we cannot do anything to fix it. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 12:33:48 2020 From: report at bugs.python.org (S. Zhang) Date: Sat, 15 Aug 2020 16:33:48 +0000 Subject: [issue41555] re.sub replaces twice In-Reply-To: <1597496727.49.0.106774396962.issue41555@roundup.psfhosted.org> Message-ID: S. Zhang added the comment: Okay. Thanks. On Sat, Aug 15, 2020 at 9:07 AM Ma Lin wrote: > > Ma Lin added the comment: > > There can be at most one empty match at a position. IIRC, Perl's regex > engine has very similar behavior. > If don't want empty match, use + is fine. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 12:48:18 2020 From: report at bugs.python.org (Ketan Bhatt) Date: Sat, 15 Aug 2020 16:48:18 +0000 Subject: [issue41558] Backspace not clearing the text In-Reply-To: <1597507707.94.0.0515899802727.issue41558@roundup.psfhosted.org> Message-ID: Ketan Bhatt added the comment: Dear Steven, Checked in the interpreter from the terminal and you are right, the output is as desired, and there is no bug. As advised, I will report this to the Jupyter team. Thank you for your confirmation and advised. Regards, Ketan Bhatt. > On 15-Aug-2020, at 9:38 PM, Steven D'Aprano wrote: > > > Steven D'Aprano added the comment: > > Works correctly for me in the Python interpreter. > > Please check if it works for you in the Python interpreter, if it does, then it is a bug in Jupyter and should be reported to them, we cannot do anything to fix it. > > ---------- > nosy: +steven.daprano > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 12:49:25 2020 From: report at bugs.python.org (Ketan Bhatt) Date: Sat, 15 Aug 2020 16:49:25 +0000 Subject: [issue41558] Backspace not clearing the text In-Reply-To: <1597505065.08.0.273403618121.issue41558@roundup.psfhosted.org> Message-ID: <15539096-06E4-4F97-8187-6E990D722B75@gmail.com> Ketan Bhatt added the comment: > Dear Steven, > > Checked in the interpreter from the terminal and you are right, the output is as desired, and there is no bug. > As advised, I will report this to the Jupyter team. > Thank you for your confirmation and advised. > Regards, > Ketan Bhatt. > > >> On 15-Aug-2020, at 9:38 PM, Steven D'Aprano wrote: >> >> >> Steven D'Aprano added the comment: >> >> Works correctly for me in the Python interpreter. >> >> Please check if it works for you in the Python interpreter, if it does, then it is a bug in Jupyter and should be reported to them, we cannot do anything to fix it. >> >> ---------- >> nosy: +steven.daprano >> >> _______________________________________ >> Python tracker >> >> _______________________________________ > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:01:52 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 17:01:52 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597510912.39.0.249829439982.issue31122@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21008 pull_request: https://github.com/python/cpython/pull/21889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:01:46 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 17:01:46 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597510906.01.0.263190787852.issue31122@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21007 pull_request: https://github.com/python/cpython/pull/21888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:01:40 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 17:01:40 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597510900.14.0.504268505879.issue31122@roundup.psfhosted.org> miss-islington added the comment: New changeset 495bd035662fda29639f9d52bb6baebea31d72fa by Dima Tisnek in branch 'master': bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation (GH-18772) https://github.com/python/cpython/commit/495bd035662fda29639f9d52bb6baebea31d72fa ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:03:05 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 15 Aug 2020 17:03:05 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597510985.12.0.011766984838.issue31122@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks! fyi for confirmation incase anyone doubted: >>> issubclass(ssl.SSLEOFError, OSError) True So from a code point of view, anything already catching the error still catches the error. 100% bugfix. ---------- assignee: christian.heimes -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:05:38 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 17:05:38 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597511138.62.0.267448006087.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: To recap for people who find this: The problem occurs because of AIX's extreme over-allocation and is specific to the 64-bit build. Workarounds: 1) Something like ulimit -d 8000000. 2) xlc: LDFLAGS="-L/usr/lib64 -q64 -bmaxdata:0x800000000" or LDFLAGS="-L/usr/lib64 -q64 -Wl,-bmaxdata:0x800000000". The first version seems more natural for xlc. 3) gcc: LDFLAGS="-L/usr/lib64 -Wl,-bmaxdata:0x800000000 -maix64" PSALLOC=early works really well for the libmpdec tests but is extremely slow with the Python interpreter. Also, setting the environment in the tests does not work. It looks like it needs to be set before main() starts. So I'll just skip that test on AIX. It is not that important, and the libmpdec maxprec tests, which are way more thorough, all pass with PSALLOC=early. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:06:01 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 15 Aug 2020 17:06:01 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597511161.93.0.955612895448.issue31122@roundup.psfhosted.org> Gregory P. Smith added the comment: While this is present in 3.7 (and earlier?), 3.7 is EOL - security fix only stage. the 3.8 and 3.9 PRs should automerge after CI finishes. please reopen the issue or ping me on those PRs if they somehow fail to do so. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:41:58 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 17:41:58 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597513318.88.0.599974952067.issue41540@roundup.psfhosted.org> Change by Stefan Krah : ---------- keywords: +patch pull_requests: +21009 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:42:40 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 17:42:40 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597513360.43.0.33471807768.issue31122@roundup.psfhosted.org> miss-islington added the comment: New changeset 243458115e2cb295fb5bbb61e6ac528c6b2cf5be by Miss Islington (bot) in branch '3.8': bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation (GH-18772) https://github.com/python/cpython/commit/243458115e2cb295fb5bbb61e6ac528c6b2cf5be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:44:58 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 15 Aug 2020 17:44:58 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597513498.54.0.93133822141.issue41513@roundup.psfhosted.org> Tim Peters added the comment: > ... > one at a time subtract a**2 (an argument squared) in descending > order of magnitude > ... But that doesn't really help unless the sum of squares was computed without care to begin with. Can do as well by skipping that but instead computing the original sum of squares in increasing order of magnitude. Cheapest way I know of that "seemingly always" reproduces the Decimal result (when that's rounded back to float) combines fsum(), Veltkamp splitting, and the correction trick from the paper: def split(x, T27=ldexp(1.0, 27)+1.0): t = x * T27 hi = t - (t - x) lo = x - hi assert hi + lo == x return hi, lo # result := hypot(*xs) parts = [] for x in xs: a, b = split(x) parts.append(a*a) parts.append(2.0*a*b) parts.append(b*b) result = sqrt(fsum(parts)) a, b = split(result) parts.append(-a*a) parts.append(-2.0*a*b) parts.append(-b*b) x = fsum(parts) # best float approx to sum(x_i ** 2) - result**2 result += x / (2.0 * result) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 13:45:01 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 17:45:01 +0000 Subject: [issue31122] SSLContext.wrap_socket() throws OSError with errno == 0 In-Reply-To: <1501874201.48.0.0126792321555.issue31122@psf.upfronthosting.co.za> Message-ID: <1597513501.07.0.741517516062.issue31122@roundup.psfhosted.org> miss-islington added the comment: New changeset fc8ffe27b6f29d67b76fb2ef57466c95af5a9f82 by Miss Islington (bot) in branch '3.9': bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation (GH-18772) https://github.com/python/cpython/commit/fc8ffe27b6f29d67b76fb2ef57466c95af5a9f82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:03:40 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 18:03:40 +0000 Subject: [issue40878] Use c99 on the aixtools bot In-Reply-To: <1591385655.5.0.64244490428.issue40878@roundup.psfhosted.org> Message-ID: <1597514620.02.0.0950924424572.issue40878@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +21010 pull_request: https://github.com/python/cpython/pull/21891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:15:18 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 18:15:18 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597515318.11.0.836061239332.issue39994@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +21011 pull_request: https://github.com/python/cpython/pull/21892 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:18:54 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 18:18:54 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597515534.69.0.186063533392.issue39994@roundup.psfhosted.org> Irit Katriel added the comment: I've created a new PR, with two commits. The first has just tests added, which show the problems and assert that the bug is there. The second has the fix and update to the tests. Let me know what you think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:19:22 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 15 Aug 2020 18:19:22 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597515562.55.0.774336304476.issue41540@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21012 pull_request: https://github.com/python/cpython/pull/21893 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:19:16 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 18:19:16 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597515556.29.0.487193531076.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 39dab24621122338d01c1219bb0acc46ba9c9956 by Stefan Krah in branch 'master': bpo-41540: AIX: skip test that is flaky with a default ulimit. (#21890) https://github.com/python/cpython/commit/39dab24621122338d01c1219bb0acc46ba9c9956 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:36:04 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 15 Aug 2020 18:36:04 +0000 Subject: [issue41559] Add support for PEP 612 to typing.py Message-ID: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> New submission from Guido van Rossum : We need stub versions of ParamSpec and Concatenate added to typing.py, plus tests that ensure these actually work in all situations required by the PEP. (It's not so important to ensure that they raise exceptions at runtime in cases where the PEP says they needn't work -- static type checkers will flag those better.) ---------- components: Library (Lib) messages: 375487 nosy: gvanrossum priority: normal severity: normal stage: needs patch status: open title: Add support for PEP 612 to typing.py type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:37:16 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 18:37:16 +0000 Subject: [issue40878] Use c99 on the aixtools bot In-Reply-To: <1591385655.5.0.64244490428.issue40878@roundup.psfhosted.org> Message-ID: <1597516636.23.0.422736113685.issue40878@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 1864eacc22485b26c0ec0a059c9330f877861afb by Miss Islington (bot) in branch '3.9': bpo-40878: xlc cannot handle C99 extern inline. (GH-21891) https://github.com/python/cpython/commit/1864eacc22485b26c0ec0a059c9330f877861afb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:37:31 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 15 Aug 2020 18:37:31 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597516651.7.0.426786448058.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: > Cheapest way I know of that "seemingly always" reproduces > the Decimal result (when that's rounded back to float) > combines fsum(), Veltkamp splitting, and the correction > trick from the paper. That's impressive. Do you think this is worth implementing? Or should we declare victory with the current PR which is both faster and more accurate than what we have now? Having 1-ulp error 17% of the time and correctly rounded 83% of the time is pretty darned good (and on par with C library code for the two-argument case). Unless we go all-out with the technique you described, the paper shows that we're already near the limit of what can be done by trying to make the sum of squares more accurate, "... the correctly rounded square root of the correctly rounded a**2+b**2 can still be off by as much as one ulp. This hints at the possibility that working harder to compute a**2+b**2 accurately may not be the best path to a better answer". FWIW, in my use cases, the properties that matter most are monotonicity, commutativity, cross-platform portability, and speed. Extra accuracy would nice to have but isn't essential and would likely never be noticed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:40:17 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 18:40:17 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597516817.62.0.52721989183.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 28bf82661ac9dfaf1b2d0fd0ac98fc0b31cd95bb by Miss Islington (bot) in branch '3.9': bpo-41540: AIX: skip test that is flaky with a default ulimit. (GH-21890) (#21893) https://github.com/python/cpython/commit/28bf82661ac9dfaf1b2d0fd0ac98fc0b31cd95bb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:43:34 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 18:43:34 +0000 Subject: [issue40878] Use c99 on the aixtools bot In-Reply-To: <1591385655.5.0.64244490428.issue40878@roundup.psfhosted.org> Message-ID: <1597517014.14.0.914142286587.issue40878@roundup.psfhosted.org> Change by Stefan Krah : ---------- assignee: -> skrah resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:46:09 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 18:46:09 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597517169.58.0.0920158399309.issue41540@roundup.psfhosted.org> Change by Stefan Krah : ---------- assignee: -> skrah resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 14:46:49 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 18:46:49 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597517209.62.0.688361050996.issue39994@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 15:02:47 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 15 Aug 2020 19:02:47 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1597518167.97.0.097518069529.issue39994@roundup.psfhosted.org> Eric V. Smith added the comment: Only 3.8 - 3.10 would be eligible for this fix. 3.7 is getting only security fixes. ---------- versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 15:26:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 15 Aug 2020 19:26:44 +0000 Subject: [issue41558] Backspace not clearing the text In-Reply-To: <1597505065.08.0.273403618121.issue41558@roundup.psfhosted.org> Message-ID: <1597519604.81.0.417559787306.issue41558@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not even think that it is a bug in Jupyter. It is expected that different output devices can support or not support specific control characters. It is rather a feature request to add support of the backslash character (and maybe other control characters like caret return, horizontal and vertical tabs, etc) in Jupiter. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 15:32:17 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 15 Aug 2020 19:32:17 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1597519937.65.0.729375500858.issue38628@roundup.psfhosted.org> Vinay Sajip added the comment: > stgdict.c currently includes a target-specific work-around for small structures that is not restricted to the one target (x64) affected. What's the best way to proceed? I think more data is needed to determine the best way to proceed. The original failure was for x64, but other targets may be affected too if structs below a certain size, when passed by value, are passed in registers - libffi would have incomplete information about how to pass the struct correctly, as arrays are normally encoded as pointers in libffi. Do we know for particular targets what the struct size limits are for passing by value in registers? If so, we could set the MAX_STRUCT_SIZE according to target. I would suggest adding a test to Lib/ctypes/test/test_structures.py in the test_array_in_struct method (or an analogous test_38628 method), to get it to fail - rather than using the OP's MemchrArgsHack. Then any patches to the stgdict.c code would have to pass that test on all architectures. But, noting that test_array_in_struct passes 16-byte structures by value to a C function to verify correct passing of the struct - if these tests aren't failing on AIX now, how come? That test was failing on x64 before the stgdict.c patch was added, and started working afterwards. Unfortunately I don't have an AIX environment I can try things in :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 16:44:57 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 20:44:57 +0000 Subject: [issue39576] Surprising MemoryError in `decimal` with MAX_PREC In-Reply-To: <1581046760.48.0.443155322154.issue39576@roundup.psfhosted.org> Message-ID: <1597524297.39.0.00731560500826.issue39576@roundup.psfhosted.org> Stefan Krah added the comment: Thanks to David Edelsohn I have AIX access now. The issue reported by Pablo is the same as #41540, for a summary see msg375480. It is a trivial issue that requires that ulimits are in place due to the fact that AIX over-allocates petabytes even when the physical memory is just 16GB. I have verified that the Python-3.7.7 release, which contains the feature, behaves exactly like master: No limits ========= ./configure CC=xlc AR="ar -X64" CFLAGS="-q64 -qmaxmem=70000 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qthreaded -D_THREAD_SAFE -D__VACPP_MULTI__" LDFLAGS="-L/usr/lib64 -q64" skrah at gcc119:[/home/skrah/Python-3.7.7]./python -m test -uall test_decimal 0:00:00 Run tests sequentially 0:00:00 [1/1] test_decimal Killed There is no segfault, the program receives SIGKILL. Data limits (-bmaxdata) ======================= ./configure CC=xlc AR="ar -X64" CFLAGS="-q64 -qmaxmem=70000 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qthreaded -D_THREAD_SAFE -D__VACPP_MULTI__" LDFLAGS="-L/usr/lib64 -q64 -bmaxdata:0x800000000" skrah at gcc119:[/home/skrah/Python-3.7.7]./python -m test -uall test_decimal 0:00:00 Run tests sequentially 0:00:00 [1/1] test_decimal == Tests result: SUCCESS == 1 test OK. Total duration: 18.0 sec Tests result: SUCCESS In summary, since 64-bit AIX users should be familiar with data limits, I don't consider the situation a _decimal bug at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 16:48:36 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 20:48:36 +0000 Subject: [issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1) In-Reply-To: <1593816685.46.0.773129097137.issue41205@roundup.psfhosted.org> Message-ID: <1597524516.18.0.191125168416.issue41205@roundup.psfhosted.org> Stefan Krah added the comment: Mark, do you think that we should document the other oddity as well or should we close this? ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 17:05:31 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 21:05:31 +0000 Subject: [issue40424] AIX: makexp_aix, parallel build (failures) and ld WARNINGS In-Reply-To: <1588090800.25.0.961976947202.issue40424@roundup.psfhosted.org> Message-ID: <1597525531.02.0.173410168184.issue40424@roundup.psfhosted.org> Stefan Krah added the comment: I understand that both of you are in favor of #19521 (the patch of which I have not tried yet). Can we close this as a duplicate? Please just reopen if you disagree. ---------- nosy: +skrah resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Parallel build race condition on AIX since python-2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 17:06:03 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 21:06:03 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1597525563.26.0.830037406268.issue19521@roundup.psfhosted.org> Change by Stefan Krah : ---------- versions: +Python 3.10 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 17:05:36 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 15 Aug 2020 21:05:36 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1597525536.02.0.786306028608.issue19521@roundup.psfhosted.org> Change by Stefan Krah : ---------- nosy: +BTaskaya, Michael.Felt, kadler, skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 18:23:50 2020 From: report at bugs.python.org (Elvis Pranskevichus) Date: Sat, 15 Aug 2020 22:23:50 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1597530230.69.0.0991062133844.issue37658@roundup.psfhosted.org> Change by Elvis Pranskevichus : ---------- keywords: +patch nosy: +Elvis.Pranskevichus nosy_count: 3.0 -> 4.0 pull_requests: +21013 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 18:43:46 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 15 Aug 2020 22:43:46 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597531426.49.0.421396714538.issue41545@roundup.psfhosted.org> Irit Katriel added the comment: There is also gc.isenabled(), so couldn't you check that before disabling and remember whether you needed to disable or not? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 18:54:11 2020 From: report at bugs.python.org (Elvis Pranskevichus) Date: Sat, 15 Aug 2020 22:54:11 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1597532051.08.0.222337089278.issue32751@roundup.psfhosted.org> Change by Elvis Pranskevichus : ---------- nosy: +Elvis.Pranskevichus nosy_count: 6.0 -> 7.0 pull_requests: +21014 pull_request: https://github.com/python/cpython/pull/21895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 21:40:56 2020 From: report at bugs.python.org (Tim Peters) Date: Sun, 16 Aug 2020 01:40:56 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597542056.46.0.626490596225.issue41513@roundup.psfhosted.org> Tim Peters added the comment: Oh no - I wouldn't use this as a default implementation. Too expensive. There is one aspect you may find especially attractive, though: unlike even the Decimal approach, it should be 100% insensitive to argument order (no info is lost before fsum() is called, and fsum's output should be unaffected by summand order). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 22:02:44 2020 From: report at bugs.python.org (Alexander Heger) Date: Sun, 16 Aug 2020 02:02:44 +0000 Subject: [issue41560] pathlib.Path.glob fails on empty string Message-ID: <1597543364.86.0.966636544489.issue41560@roundup.psfhosted.org> New submission from Alexander Heger : Passing an empty string to pathlib.Path.glob fails. Example ``` from pathlib import Path path = Path('./myfile.txt') path.glob('') ``` The result is: ``` ~/Python/lib/python3.8/pathlib.py in glob(self, pattern) 1129 """ 1130 if not pattern: -> 1131 raise ValueError("Unacceptable pattern: {!r}".format(pattern)) 1132 drv, root, pattern_parts = self._flavour.parse_parts((pattern,)) 1133 if drv or root: ValueError: Unacceptable pattern: '' ``` This is not the desired or expected behaviour, which would be to just return `path` if it exists. This behaviour is also inconsistent with the documentation which states (Python 3.8.5): """ Glob the given relative pattern in the directory represented by this path, yielding all matching files (of any kind): """ And it is in contrast to the behaviour of glob.glob, which is just fine with the empty string, returning an empty list. ---------- components: Library (Lib) messages: 375499 nosy: alex.heger priority: normal severity: normal status: open title: pathlib.Path.glob fails on empty string type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 22:38:25 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Aug 2020 02:38:25 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597545505.61.0.716810063212.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset fff3c28052e6b0750d6218e00acacd2fded4991a by Raymond Hettinger in branch 'master': bpo-41513: Improve speed and accuracy of math.hypot() (GH-21803) https://github.com/python/cpython/commit/fff3c28052e6b0750d6218e00acacd2fded4991a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 22:42:31 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Aug 2020 02:42:31 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597545751.56.0.0417177869375.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: If someone thinks there is a case for using the C library hypot() for the two-argument form, feel free to reopen this. Likewise, if someone thinks there is a case for doing the expensive but more accurate algorithm, go ahead and reopen this. Otherwise, I think we're done for now :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 22:53:02 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Aug 2020 02:53:02 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597546382.8.0.818218418905.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49398/test_hypot_commutativity.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 23:12:50 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 16 Aug 2020 03:12:50 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597547570.01.0.252385614096.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49399/test_hypot_accuracy.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 23:40:23 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 16 Aug 2020 03:40:23 +0000 Subject: [issue41489] HTMLParser : HTMLParser.error creating multiple errors. In-Reply-To: <1596657865.41.0.326756245182.issue41489@roundup.psfhosted.org> Message-ID: <1597549223.73.0.22515244634.issue41489@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 15 23:44:19 2020 From: report at bugs.python.org (hai shi) Date: Sun, 16 Aug 2020 03:44:19 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597549459.08.0.455948525346.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +21015 pull_request: https://github.com/python/cpython/pull/21896 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 00:10:49 2020 From: report at bugs.python.org (Bug Reporter) Date: Sun, 16 Aug 2020 04:10:49 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch Message-ID: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> New submission from Bug Reporter : FAIL: test_min_max_version_mismatch (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vbk/Downloads/Python-3.8.5/Lib/test/test_ssl.py", line 217, in wrapper return func(*args, **kw) File "/home/vbk/Downloads/Python-3.8.5/Lib/test/test_ssl.py", line 3841, in test_min_max_version_mismatch self.assertIn("alert", str(e.exception)) AssertionError: 'alert' not found in '[SSL: NO_PROTOCOLS_AVAILABLE] no protocols available (_ssl.c:1123)' ---------- assignee: christian.heimes components: Build, SSL, Tests messages: 375502 nosy: bugsrep, christian.heimes priority: normal severity: normal status: open title: test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 01:04:48 2020 From: report at bugs.python.org (Henrique Gj) Date: Sun, 16 Aug 2020 05:04:48 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597554288.07.0.60953605005.issue41546@roundup.psfhosted.org> Henrique Gj added the comment: > Debug prints should not crash a program. > 'Not a bug' wait ---------- nosy: +henriquesdj0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 02:57:08 2020 From: report at bugs.python.org (Dan Pascu) Date: Sun, 16 Aug 2020 06:57:08 +0000 Subject: [issue41562] StreamReaderProtocol inheritance Message-ID: <1597561028.71.0.475726602595.issue41562@roundup.psfhosted.org> New submission from Dan Pascu : I noticed that StreamReaderProtocol is defined like this: class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): ... but FlowControlMixin already inherits protocols.Protocol: class FlowControlMixin(protocols.Protocol): ... It seems redundant that StreamReaderProtocol has protocols.Protocol as a second base class (is this an oversight or I'm missing some hidden reasoning behind it in which case it might be useful to have it mentioned in a comment to avoid confusion). ---------- components: asyncio messages: 375504 nosy: asvetlov, danpascu777, yselivanov priority: normal severity: normal status: open title: StreamReaderProtocol inheritance type: enhancement versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 04:52:03 2020 From: report at bugs.python.org (hai shi) Date: Sun, 16 Aug 2020 08:52:03 +0000 Subject: [issue41551] test.support has way too many imports in libregrtest In-Reply-To: <1597397929.74.0.568680866086.issue41551@roundup.psfhosted.org> Message-ID: <1597567923.87.0.172566690087.issue41551@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 07:42:32 2020 From: report at bugs.python.org (Denniver) Date: Sun, 16 Aug 2020 11:42:32 +0000 Subject: [issue41563] .python_history file causes considerable slowdown Message-ID: <1597578152.77.0.254991053979.issue41563@roundup.psfhosted.org> New submission from Denniver : The seemingly unlimited growth of the ".python_history"-file seems to cause a massive slowdown when starting or exiting python, the same after running commands. On one machine python took about 3 minutes to start and I found out that while it is seemingly doing nothing, it was constantly aceesing the ".python_history"-file, which was 130 Mb large. After deleting the file, anything was back to normal. ---------- components: Build messages: 375505 nosy: bytecookie priority: normal severity: normal status: open title: .python_history file causes considerable slowdown type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 07:50:33 2020 From: report at bugs.python.org (bytecookie) Date: Sun, 16 Aug 2020 11:50:33 +0000 Subject: [issue41563] .python_history file causes considerable slowdown In-Reply-To: <1597578152.77.0.254991053979.issue41563@roundup.psfhosted.org> Message-ID: <1597578633.75.0.653892304102.issue41563@roundup.psfhosted.org> bytecookie added the comment: Using Python 3.8.3 on Windows 10 1803 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 08:42:01 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 16 Aug 2020 12:42:01 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1597581721.09.0.641441082544.issue38628@roundup.psfhosted.org> Ronald Oussoren added the comment: As mentioned before I haven't studied the ctypes code base, but I am a bit worried about the use of MAX_STRUCT_SIZE, an array definition in a structure is always part of the struct itself and is never a pointer. I agree with Vinay that there needs to be a unittest that demonstrates the problem. ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 09:01:20 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 16 Aug 2020 13:01:20 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597582880.71.0.261263355596.issue41503@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 10:25:32 2020 From: report at bugs.python.org (aaliddell) Date: Sun, 16 Aug 2020 14:25:32 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1597587932.3.0.185096694832.issue37658@roundup.psfhosted.org> Change by aaliddell : ---------- nosy: +aaliddell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 10:30:36 2020 From: report at bugs.python.org (E. Paine) Date: Sun, 16 Aug 2020 14:30:36 +0000 Subject: [issue33051] IDLE: Create new tab for editor options in configdialog In-Reply-To: <1520796379.91.0.467229070634.issue33051@psf.upfronthosting.co.za> Message-ID: <1597588236.85.0.960041088153.issue33051@roundup.psfhosted.org> E. Paine added the comment: Thank you Cheryl for linking this issue on #40468 (I didn't find this when researching for existing issues). I have briefly tested the PR and it seems perfect, though seeing `init_validators` made me think we should possibly have an ABC for the tab pages. This would be a separate issue, but I think there would be three main advantages: 1. We could enforce a more standard naming of page methods (`create_page_*` would become `create_page` and be called by the parent, for example) 2. We could share methods like `init_validators` (which would preferably be part of the class but I appreciate the need to move it in this PR) 3. We can also potentially remove the example `TabPage` as the ABC would serve as its own example Back to this issue, I didn't scrutinise it but the PR looks good and the "result" (user-facing) is exactly as I would propose based on #40468. ---------- nosy: +epaine versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 11:06:56 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Aug 2020 15:06:56 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1597590416.53.0.522396285725.issue38628@roundup.psfhosted.org> Vinay Sajip added the comment: > an array definition in a structure is always part of the struct itself and is never a pointer True, but a problem only arises in practice when passing by value in registers. It's still an open libffi issue that doesn't look like it's going to be solved any time soon, hence the attempted workaround in ctypes. https://github.com/libffi/libffi/issues/33 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 11:10:22 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Aug 2020 15:10:22 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597590622.52.0.483415662348.issue41503@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 2353d77fad7ed9d11d8a4d66b5dd1306cdb94125 by Irit Katriel in branch 'master': bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) https://github.com/python/cpython/commit/2353d77fad7ed9d11d8a4d66b5dd1306cdb94125 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 11:12:47 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 16 Aug 2020 15:12:47 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597590767.01.0.262141552615.issue41503@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21017 pull_request: https://github.com/python/cpython/pull/21898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 11:12:39 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 16 Aug 2020 15:12:39 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597590759.79.0.0528088370262.issue41503@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +21016 pull_request: https://github.com/python/cpython/pull/21897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 11:20:27 2020 From: report at bugs.python.org (David Edelsohn) Date: Sun, 16 Aug 2020 15:20:27 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1597591227.09.0.246346146346.issue38628@roundup.psfhosted.org> David Edelsohn added the comment: Yes, it doesn't appear that it will be solved in libffi. I don't fully understand the need for the work-around because it should gracefully overflow to the stack. I can't tell if the issue is a problem with arguments passed by value that need to be passed partially in registers and partially in the stack. But if the work-around is necessary, it is target- and ABI-dependent: the number of arguments passed in registers is target- and ABI-dependent. Implementing a work-around solely based on x64 ABI is not correct. The ctypes stgdict.c code needs to define MAX_STRUCT_SIZE based on the target, at least for the targets that experience the problem. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 11:34:42 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 16 Aug 2020 15:34:42 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597592082.22.0.695503782075.issue41503@roundup.psfhosted.org> miss-islington added the comment: New changeset 2c050e52f1ccf5db03819e4ed70690521d67e9fa by Miss Islington (bot) in branch '3.9': [3.9] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21897) https://github.com/python/cpython/commit/2c050e52f1ccf5db03819e4ed70690521d67e9fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:14:08 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Sun, 16 Aug 2020 16:14:08 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597594448.25.0.55912218338.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Further proposal: Rename my _login_tty to login_tty and make it available as a part of the pty library. Note that usually login_tty accompanies openpty and forkpty on a system; for example, see https://www.man7.org/linux/man-pages/man3/login_tty.3.html https://man.openbsd.org/login_tty https://netbsd.gw.com/cgi-bin/man-cgi?login_tty++NetBSD-current However, python's pty only offers openpty and forkpty in the form of pty.openpty and pty.fork respectively. While it is true that forkpty [ pty.fork ] combines openpty, fork, and login_tty, it also closes the slave end of the pty, making it unsuitable for situations where the slave end needs to be kept open; for example, in my patch, the slave end is used to set the window size; or, in case someone wants to do even better and register a SIGWINCH handler for situations in which the window size can change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:15:25 2020 From: report at bugs.python.org (Barathwaja) Date: Sun, 16 Aug 2020 16:15:25 +0000 Subject: [issue41032] locale.setlocale example incorrect In-Reply-To: <1592558818.84.0.296845885403.issue41032@roundup.psfhosted.org> Message-ID: <1597594525.32.0.827350703847.issue41032@roundup.psfhosted.org> Barathwaja added the comment: Hi Marco, Can I work on this? ---------- nosy: +Barathwaja _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:18:52 2020 From: report at bugs.python.org (sahiba) Date: Sun, 16 Aug 2020 16:18:52 +0000 Subject: [issue35058] Unable to Install Python on Windows In-Reply-To: <1540390509.38.0.788709270274.issue35058@psf.upfronthosting.co.za> Message-ID: <1597594732.52.0.200976965328.issue35058@roundup.psfhosted.org> sahiba added the comment: Can you please find the log files and attach them or you could also provide the download link as without it there is nothing that can be done. ---------- nosy: +sahiba007 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:27:08 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 16 Aug 2020 16:27:08 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597595228.4.0.104058891999.issue41503@roundup.psfhosted.org> miss-islington added the comment: New changeset 08f0a2109297e8a64e8636d47dce737e5b7ccf2c by Miss Islington (bot) in branch '3.8': [3.8] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21898) https://github.com/python/cpython/commit/08f0a2109297e8a64e8636d47dce737e5b7ccf2c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:31:46 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Aug 2020 16:31:46 +0000 Subject: [issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler In-Reply-To: <1596813000.5.0.282136577627.issue41503@roundup.psfhosted.org> Message-ID: <1597595506.7.0.842316444131.issue41503@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:30:56 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 16 Aug 2020 16:30:56 +0000 Subject: [issue38628] Issue with ctypes in AIX In-Reply-To: <1572340643.38.0.935669039099.issue38628@roundup.psfhosted.org> Message-ID: <1597595456.6.0.640490919602.issue38628@roundup.psfhosted.org> Vinay Sajip added the comment: > Implementing a work-around solely based on x64 ABI is not correct. But AFAIK the test_array_in_struct test passes on AIX and exercises the workaround - why does it work if the workaround is faulty? If OTOH the test is faulty, could you update it with code that fails on AIX, as I suggested earlier? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 12:49:27 2020 From: report at bugs.python.org (Lewis Gaul) Date: Sun, 16 Aug 2020 16:49:27 +0000 Subject: [issue38379] finalizer resurrection in gc In-Reply-To: <1570296686.13.0.00730737596554.issue38379@roundup.psfhosted.org> Message-ID: <1597596567.1.0.28505159902.issue38379@roundup.psfhosted.org> Lewis Gaul added the comment: I noticed this bug is mentioned in the 3.9 release notes with a note similar to the title of the 4th PR: "garbage collection does not block on resurrected objects". I can't see any mention of a blocking issue here on the issue: > The bug: the stats keep claiming gc is collecting an enormous number of objects, but in fact it's not collecting any. Objects in the unreachable set shouldn't add to the "collected" count unless they _are_ collected. Would someone be able to elaborate on the blocking issue that was fixed as part of this BPO? ---------- nosy: +LewisGaul _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 14:51:47 2020 From: report at bugs.python.org (Bar Harel) Date: Sun, 16 Aug 2020 18:51:47 +0000 Subject: [issue13322] The io module doesn't support non-blocking files In-Reply-To: <1320246535.71.0.465783773129.issue13322@psf.upfronthosting.co.za> Message-ID: <1597603907.71.0.836428788967.issue13322@roundup.psfhosted.org> Bar Harel added the comment: I have experienced both ?TypeError: can't concat NoneType to bytes?, and the fact BufferedIO returns None. @pitrou @izbyshev contrary to your belief, I think there is at least some interest in this issue. Every few months another ticket is opened about a different aspect of the same underlying problem. ---------- nosy: +bar.harel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 15:56:34 2020 From: report at bugs.python.org (Tim Peters) Date: Sun, 16 Aug 2020 19:56:34 +0000 Subject: [issue38379] finalizer resurrection in gc In-Reply-To: <1570296686.13.0.00730737596554.issue38379@roundup.psfhosted.org> Message-ID: <1597607794.83.0.797765753221.issue38379@roundup.psfhosted.org> Tim Peters added the comment: I suspect you're reading some specific technical meaning into the word "block" that the PR and release note didn't intend by their informal use of the word. But I'm unclear on what technical meaning you have in mind. Before the change, gc "just gave up" after seeing a resurrection, ending the then-current cyclic gc run. It that sense, yes, resurrection "blocked" gc from making progress. It did not, e.g., "block" the interpreter in the sense of deadlock, or of waiting for some lock to be released, or of waiting for a network request to respond, or ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 16:02:39 2020 From: report at bugs.python.org (Lewis Gaul) Date: Sun, 16 Aug 2020 20:02:39 +0000 Subject: [issue38379] finalizer resurrection in gc In-Reply-To: <1570296686.13.0.00730737596554.issue38379@roundup.psfhosted.org> Message-ID: <1597608159.51.0.434235842964.issue38379@roundup.psfhosted.org> Lewis Gaul added the comment: You're right that's how I had interpreted it, thanks for clarifying. I was wondering if this could be related to an issue I've hit with gc.collect() getting slower and slower in a test suite, but that now seems unlikely, so I won't go into that here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 17:57:52 2020 From: report at bugs.python.org (Michael Felt) Date: Sun, 16 Aug 2020 21:57:52 +0000 Subject: [issue40424] AIX: makexp_aix, parallel build (failures) and ld WARNINGS In-Reply-To: <1597525531.02.0.173410168184.issue40424@roundup.psfhosted.org> Message-ID: Michael Felt added the comment: If #19521 had been merged I would be all for closing this as a duplicate. However, if i have read all the comments correctly noone has tested the other pr. As the approaches are quite different I think both should be open until a decision is made on the better approach. Closing one (asap) is a good idea, especially if that leads to something being merged so this is finally repaired. Sent from my iPhone > On 15 Aug 2020, at 23:07, Stefan Krah wrote: > > ? > Stefan Krah added the comment: > > I understand that both of you are in favor of #19521 (the patch of > which I have not tried yet). > > Can we close this as a duplicate? Please just reopen if you disagree. > > ---------- > nosy: +skrah > resolution: -> duplicate > stage: patch review -> resolved > status: open -> closed > superseder: -> Parallel build race condition on AIX since python-2.7 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 16 22:50:34 2020 From: report at bugs.python.org (Matt Joiner) Date: Mon, 17 Aug 2020 02:50:34 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" Message-ID: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> New submission from Matt Joiner : I get this error when running pyright for a type of typing.ByteString. All the implementations of ByteString (bytes, bytearray, memoryview) have the hex method, so this seems unexpected? ---------- components: Library (Lib) messages: 375523 nosy: anacrolix priority: normal severity: normal status: open title: Cannot access member "hex" for type "ByteString" type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 01:02:54 2020 From: report at bugs.python.org (song super) Date: Mon, 17 Aug 2020 05:02:54 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows Message-ID: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> New submission from song super <2262720766 at qq.com>: python3.6 from os.path import join join('3', '{:3') return '{:3' in windows,However,join('3', '{:3') return '3//{:3' in linux,I think this is a bug ---------- components: Windows files: python bug.zip hgrepos: 391 messages: 375524 nosy: 2262720766, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: from os.path import join join('3', '{:3') return '{:3' in windows type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file49400/python bug.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 01:20:49 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 05:20:49 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597641649.67.0.13590925469.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fbf43f051e7bf479709e122efa4b6edd4b09d4df by Victor Stinner in branch 'master': bpo-41521: Rename blacklist parameter to not_exported (GH-21824) https://github.com/python/cpython/commit/fbf43f051e7bf479709e122efa4b6edd4b09d4df ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 01:23:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 05:23:44 +0000 Subject: [issue41521] Replace whitelist/blacklist with allowlist/denylist In-Reply-To: <1597149870.51.0.801389190746.issue41521@roundup.psfhosted.org> Message-ID: <1597641824.6.0.143823004733.issue41521@roundup.psfhosted.org> STINNER Victor added the comment: I don't think that it's worth it to backport these changes, so I close the issue. Again, to avoid reintroducing such terms, I proposed https://github.com/python/devguide/issues/605 to define some general guidelines on the terminology. Thanks for reviews. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 02:18:31 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 06:18:31 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597645111.28.0.152196969547.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21018 pull_request: https://github.com/python/cpython/pull/21900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 02:41:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 06:41:45 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597646505.83.0.15442402648.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1abeda80f760134b4233608e2c288790f955b95a by Victor Stinner in branch 'master': bpo-40204: Fix duplicated productionlist names in the doc (GH-21900) https://github.com/python/cpython/commit/1abeda80f760134b4233608e2c288790f955b95a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 02:49:15 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 17 Aug 2020 06:49:15 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1597646955.22.0.678221913751.issue41564@roundup.psfhosted.org> Eric V. Smith added the comment: Without some example code that shows the problem we can't help you. Have you considered that this is a bug with pyright, not a bug with python itself? ---------- nosy: +eric.smith status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 02:50:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 06:50:54 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597647054.58.0.492987861187.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21019 pull_request: https://github.com/python/cpython/pull/21901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 02:55:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 06:55:16 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597647316.03.0.33367933333.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: I'm now able to build the Python documentation with Sphinx 3.2.1 without modifying the Doc/Makefile, so using -W option (treat warnings as errors): there are no more Sphinx 3 warnings. When Sphinx 3 will be more widely available (ex: in Linux distributions), we will be able to consider removing c_allow_pre_v3=True and c_warn_on_allowed_pre_v3=False in doc/conf.py. For that, we should update the documentation to use the Sphinx 3 syntax, see PR 19397 written by Jakob Lykke Andersen. For now, I prefer to keep Sphinx 2 support and so keep Sphinx 2 syntax in the C domain, since it allows supporting Sphinx 2 and Sphinx 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 03:47:38 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 07:47:38 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597650458.07.0.63018396322.issue41025@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset 87d8287865e5c9f137f6b5cf8c34c2c509eb5e9d by Paul Ganssle in branch 'master': > bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) This change introduced a reference leak. 3.9 and master branch are affected. $ make && ./python -m test -R 3:3 test_zoneinfo (...) test_zoneinfo leaked [84, 84, 84] references, sum=252 test_zoneinfo leaked [41, 41, 41] memory blocks, sum=123 (...) ZoneInfoSubclassTest and CZoneInfoSubclassTest test cases leak. Example of test method which leaks: test.test_zoneinfo.test_zoneinfo.CZoneInfoSubclassTest.test_folds_and_gaps ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 03:54:04 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 17 Aug 2020 07:54:04 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597650844.75.0.730738590738.issue41565@roundup.psfhosted.org> Ronald Oussoren added the comment: I'm fairly sure this is intended behaviour, see . The second arguments is "{:3", the colon means this is interpreted as the the relative path "3" on drive "}:". I'm not sure if "}" could ever be valid drive letter, but ":" can definitely be used in filenames. ---------- nosy: +ronaldoussoren -2262720766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 04:17:38 2020 From: report at bugs.python.org (Mika Hawkins) Date: Mon, 17 Aug 2020 08:17:38 +0000 Subject: [issue41100] Build failure on macOS 11 (beta) In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1597652258.29.0.847277264446.issue41100@roundup.psfhosted.org> Mika Hawkins added the comment: Hi, What you can do is to verify builds on older macOS versions and you can also support building using non-system libffi on macOS. Hope this hhelps... Regards, Mika Hawkins ---------- nosy: +Mika_Hawkins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 04:19:06 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Mon, 17 Aug 2020 08:19:06 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) Message-ID: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> New submission from Ruben Vorderman : The gzip file format is quite ubiquitous and so is its first (?) free/libre implementation zlib with the gzip command line tool. This uses the DEFLATE algorithm. Lately some faster algorithms (most notable zstd) have popped up which have better speed and compression ratio vs zlib. Unfortunately switching over to zstd will not be seemless. It is not compatible with zlib/gzip in any way. Luckily some developers have tried to implement DEFLATE in a faster way. Most notably libdeflate (https://github.com/ebiggers/libdeflate) and Intel's storage acceleration library (https://github.com/intel/isa-l). These libraries provide the libdeflate-gzip and igzip utilities respectively. These can compress and decompress the same gzip files. An igzip compressed file can be read with gzip and vice versa. To give an idea of the speed improvements that can be obtained. Here are some benchmarks. All benchmarks were done using hyperfine (https://github.com/sharkdp/hyperfine). The system was a Ryzen 5 3600 with 2x16GB DDR4-3200 memory. Operating system Debian 10. All benchmarks were performed on a tmpfs which lives in memory to prevent IO bottlenecks. The test file was a 5 million read FASTQ file of 1.6 GB (https://en.wikipedia.org/wiki/FASTQ_format). These type of files are common in bioinformatics at 100+ GB sizes so are a good real-world benchmark. I benchmarked pigz on one thread as well, as it implements zlib but in a faster way than gzip. Zstd was benchmarked as a comparison. Versions: gzip 1.9 (provided by debian) pigz 2.4 (provided by debian) igzip 2.25.0 (provided by debian) libdeflate-gzip 1.6 (compiled by conda-build with the recipe here: https://github.com/conda-forge/libdeflate-feedstock/pull/4) zstd 1.3.8 (provided by debian) By default level 1 is chosen for all compression benchmarks. Time is average over 10 runs. COMPRESSION program time size memory gzip 23.5 seconds 657M 1.5M pigz (one thread) 22.2 seconds 658M 2.4M libdeflate-gzip 10.1 seconds 623M 1.6G (reads entire file in memory) igzip 4.6 seconds 620M 3.5M zstd (to .zst) 6.1 seconds 584M 12.1M Decompression. All programs decompressed the file created using gzip -1. (Even zstd which can also decompress gzip). DECOMPRESSION program time memory gzip 10.5 seconds 744K pigz (one-thread) 6.7 seconds 1.2M libdeflate-gzip 3.6 seconds 2.2G (reads in mem before writing) igzip 3.3 seconds 3.6M zstd (from .gz) 6.4 seconds 2.2M zstd (from .zst) 2.3 seconds 3.1M As shown from the above benchmarks, using Intel's Storage Acceleration Libraries may improve performance quite substantially. Offering very fast compression and decompression. This gets igzip in the zstd ballpark in terms of speed while still offering backwards compatibility with gzip. Intel's Storage Acceleration Libraries (isa-l) come with a bsd-3-clause license, so there should be no licensing issues when using that code inside of CPython. ---------- components: Library (Lib) messages: 375533 nosy: rhpvorderman priority: normal severity: normal status: open title: Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 04:19:48 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 17 Aug 2020 08:19:48 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597652388.79.0.674212871549.issue41546@roundup.psfhosted.org> Vedran ?a?i? added the comment: The big part of the justification for making print a function in Py3 is that it can be painlessly replaced with other functions, such as (example given by BDFL) pprint.pprint. I think we should do what we can to make the replacement as painless as possible. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 04:55:46 2020 From: report at bugs.python.org (Eryk Sun) Date: Mon, 17 Aug 2020 08:55:46 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597654546.36.0.124981952166.issue41565@roundup.psfhosted.org> Eryk Sun added the comment: > I'm not sure if "}" could ever be valid drive letter The Windows file API is designed in a way to support almost any Unicode BMP character in a DOS drive designation. For example, the following creates "{:" as a substitute drive for "C:\\Temp": >>> DefineDosDevice(0, '{:', 'C:\\Temp') Drive "{:" has a working directory: >>> os.mkdir('{:/Eggs') >>> os.chdir('{:/Eggs') >>> os.chdir('C:/') >>> ntpath.abspath('{:') '{:\\Eggs' The latter is based on a hidden environment variable named "={:", which WinAPI GetFullPathNameW consumes: >>> GetEnvironmentVariable('={:') '{:\\Eggs' That said, only drive letters A-Z count for WinAPI GetLogicalDrives and GetLogicalDriveStrings, and these are the only drive names that can be assigned normally. So it's not important to handle "{:" as a drive. Whatever makes the code simpler. > ":" can definitely be used in filenames. Colon is allowed in filepaths, such as in device names and stream designations, but most filesystems do not allow colon in filenames. Exceptions include the named-pipe filesystem and some redirectors for non-native filesystems, such as the VirtualBox shared-folder filesystem. The Windows API reserves colon as the delimiter for file streams [1]. In stream designations such as "filename:streamname:streamtype", the colon is not part of the filename, stream name, or stream type name. "{:3" could be a file named "{" with a data stream named "3". (The "DATA$" stream type is implicit.) The workaround for accessing a named stream in a file with a single-character filename is to use an explicitly relative path such as "./{:3". This works fine with ntpath.join: >>> ntpath.join('3', './{:3') '3\\./{:3' >>> ntpath.normpath(ntpath.join('3', './{:3')) '3\\{:3' --- [1] https://docs.microsoft.com/en-us/windows/win32/fileio/file-streams ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 04:57:31 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Mon, 17 Aug 2020 08:57:31 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597654651.8.0.958558316855.issue41566@roundup.psfhosted.org> Ruben Vorderman added the comment: This has to be in a PEP. I am sorry I missplaced it on the bugtracker. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 05:45:10 2020 From: report at bugs.python.org (Tony Reix) Date: Mon, 17 Aug 2020 09:45:10 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597657510.96.0.206944601137.issue41540@roundup.psfhosted.org> Tony Reix added the comment: Hi Stefan, In your message https://bugs.python.org/issue41540#msg375462 , you said: "However, instead of freezing the machine, the process gets a proper SIGKILL almost instantly." That's probably due to a very small size of the Paging Space of the AIX machine you used for testing. With very small PS, the OS quickly reaches the step where PS and memory are full and it tries to kill possible culprits (but often killing innocent processes, like my bash shell). However, with a large PS (size of the Memory, or half), it takes some time for the OS to consume the PS, and, during this time (many seconds if not minutes), the OS looks like frozen and it takes many seconds or minutes for a "kill -9 PID" to take effect. About -bmaxdata, I always used it for extending default memory of a 32bit process, but I never used it for reducing the possible memory of a 64bit process since some users may want to use python with hundreds of GigaBytes of memory. And the python executable used for tests is the same one that is delivered to users. About PSALLOC=early , I confirm that it perfectly fixes the issue. So, we'll use it when testing Python. Our customers should use it or use ulimit -d . But using -bmaxdata for building python process in 64bit would reduce the possibilities of the python process. In the future, we'll probably improve the compatibility with Linux so that this (rare) case no more appear. BTW, on AIX, we have only 12 test cases failing out of about 32,471 test cases run in 64bit, with probably only 5 remaining serious failures. Both with GCC and XLC. Not bad. Less in 32bit. Now studying these few remaining issues and the still skipped tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 06:12:03 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 17 Aug 2020 10:12:03 +0000 Subject: [issue41563] .python_history file causes considerable slowdown In-Reply-To: <1597578152.77.0.254991053979.issue41563@roundup.psfhosted.org> Message-ID: <1597659123.89.0.0846532326425.issue41563@roundup.psfhosted.org> Steven D'Aprano added the comment: How very odd. I use the Python interactive interpreter extensively, and have done so for years. My history file is only 500 lines. Did you happen to inspect the file before deleting it to see if it contained something odd? What does this print for you? import readline readline.get_history_length() ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 06:26:27 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 17 Aug 2020 10:26:27 +0000 Subject: [issue41563] .python_history file causes considerable slowdown In-Reply-To: <1597578152.77.0.254991053979.issue41563@roundup.psfhosted.org> Message-ID: <1597659987.31.0.580127898656.issue41563@roundup.psfhosted.org> Steven D'Aprano added the comment: > My history file is only 500 lines. *slaps forehead* Of course it is, I'm running a customer history hook that has a limit of 500 lines in the history file. It looks to me that by default the history feature is set to unlimited lines, so I guess that implies that this isn't a bug and it is your responsibility to set a maximum history length. You can put these two lines in your Python startup file: import readline readline.set_history_length(1000) # or any number you like Personally, I don't think that having a default setting that allows the history file to grow to 130MB is a good idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 06:33:46 2020 From: report at bugs.python.org (bytecookie) Date: Mon, 17 Aug 2020 10:33:46 +0000 Subject: [issue41563] .python_history file causes considerable slowdown In-Reply-To: <1597578152.77.0.254991053979.issue41563@roundup.psfhosted.org> Message-ID: <1597660426.81.0.201587973074.issue41563@roundup.psfhosted.org> bytecookie added the comment: > it is your responsibility to set a maximum history length. No, sorry. The problem is not the history file, is the massive slow down it causes. And if you have to utilize a process monitoring tool to find out that the history file is the cause, its not a matter of responsibility . You can only be responsible for something you know of. Still I wonder why this isn't an already widely known problem, or is this a new feature? (I am an seasoned developer but very new to python) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 07:31:56 2020 From: report at bugs.python.org (MarcoBakera) Date: Mon, 17 Aug 2020 11:31:56 +0000 Subject: [issue41032] locale.setlocale example incorrect In-Reply-To: <1592558818.84.0.296845885403.issue41032@roundup.psfhosted.org> Message-ID: <1597663916.42.0.0993896254889.issue41032@roundup.psfhosted.org> MarcoBakera added the comment: I have only reported the bug and do not know exactly how to proceed. I don't think there's anything wrong with taking over the bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 07:37:30 2020 From: report at bugs.python.org (Carl Drougge) Date: Mon, 17 Aug 2020 11:37:30 +0000 Subject: [issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1 Message-ID: <1597664250.53.0.724586569237.issue41567@roundup.psfhosted.org> New submission from Carl Drougge : If several threads try to start a multiprocessing.Pool at the same time when no pool has been started before this often fails with an exception like this (the exact import varies): Exception in thread Thread-2: Traceback (most recent call last): File "/tmp/py3.9.0rc1/lib/python3.9/threading.py", line 950, in _bootstrap_inner self.run() File "/tmp/py3.9.0rc1/lib/python3.9/threading.py", line 888, in run self._target(*self._args, **self._kwargs) File "/tmp/py3.9.0rc1/lib/python3.9/multiprocessing/context.py", line 118, in Pool from .pool import Pool ImportError: cannot import name 'Pool' from partially initialized module 'multiprocessing.pool' (most likely due to a circular import) (/tmp/py3.9.0rc1/lib/python3.9/multiprocessing/pool.py) This happens even if Pool was imported before starting the threads and is new in 3.9. It's easy to work around by starting a pool in the main thread before starting the other threads. I have attached a minimal example that triggers it. Tested on Debian stable and FreeBSD 11.3. ---------- components: Library (Lib) files: pool_error_on_3.9.py messages: 375542 nosy: drougge priority: normal severity: normal status: open title: multiprocessing.Pool from concurrent threads failure on 3.9.0rc1 type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49401/pool_error_on_3.9.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 08:20:57 2020 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Mon, 17 Aug 2020 12:20:57 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597666857.72.0.867053715307.issue41545@roundup.psfhosted.org> Yonatan Goldschmidt added the comment: > This is exactly the motivation for context managers, no? I attached no_gc.py, which works when nested and should additionally be thread-safe. My solution was roughly the same (also a context manager, but a bit simplified because I didn't need threading support so I didn't bother with locking). > There is also gc.isenabled(), so couldn't you check that before disabling and remember whether you needed to disable or not? Yes, but it must be protected like Dennis suggested, otherwise it can't be used in a race-free way, for example this snippet is susceptible to a thread switch between the `isenabled()` and `disable()` calls (so another thread could meanwhile disable GC, and we retain a stale `was_enabled` result) was_enabled = gc.isenabled() gc.disable() ... if was_enabled: gc.enable() My points in this issue are: 1. I think that such a safer API should be available in the standard library (I don't want to find myself repeating this across different projects). I think that wherever you find yourself using `gc.disable()` you should actually be using a safer API (that takes into account multithreading & previous invocations of `gc.disable()`) 2. A tiny change in `gc.enable()` (as I suggested in msg375376) can make it substantially easier for the Python side to protect itself, because it will be race-free without any locks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 09:35:02 2020 From: report at bugs.python.org (Nathaniel Manista) Date: Mon, 17 Aug 2020 13:35:02 +0000 Subject: [issue41292] Dead link in Windows FAQ In-Reply-To: <1594651776.92.0.628399384515.issue41292@roundup.psfhosted.org> Message-ID: <1597671302.35.0.480271255461.issue41292@roundup.psfhosted.org> Change by Nathaniel Manista : ---------- nosy: +Nathaniel Manista _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 09:35:50 2020 From: report at bugs.python.org (Nathaniel Manista) Date: Mon, 17 Aug 2020 13:35:50 +0000 Subject: [issue30757] pyinstaller can be added to docs, py2exe ref can be updated In-Reply-To: <1498451168.27.0.593036349197.issue30757@psf.upfronthosting.co.za> Message-ID: <1597671350.33.0.00309105204867.issue30757@roundup.psfhosted.org> Change by Nathaniel Manista : ---------- nosy: +Nathaniel Manista _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 09:51:14 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Aug 2020 13:51:14 +0000 Subject: [issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1 In-Reply-To: <1597664250.53.0.724586569237.issue41567@roundup.psfhosted.org> Message-ID: <1597672274.38.0.706419067144.issue41567@roundup.psfhosted.org> Irit Katriel added the comment: I see the same in Python 3.10 on windows 10. If I change the relative imports to absolute imports in a couple of functions in multiprocessing.context as below, the attached (pool_error_on_3.9.py) script not longer raises the exception. def SimpleQueue(self): '''Returns a queue object''' from multiprocessing.queues import SimpleQueue return SimpleQueue(ctx=self.get_context()) def Pool(self, processes=None, initializer=None, initargs=(), maxtasksperchild=None): '''Returns a process pool object''' from multiprocessing.pool import Pool return Pool(processes, initializer, initargs, maxtasksperchild, context=self.get_context()) ---------- nosy: +iritkatriel versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:02:49 2020 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 17 Aug 2020 14:02:49 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597672969.07.0.555374618501.issue41566@roundup.psfhosted.org> Stefan Behnel added the comment: > This has to be in a PEP No, the bug tracker seems fine for this. ---------- nosy: +scoder resolution: not a bug -> stage: resolved -> needs patch status: closed -> open type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:05:14 2020 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 17 Aug 2020 14:05:14 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597673114.4.0.698504042424.issue41566@roundup.psfhosted.org> Stefan Behnel added the comment: What about building the library? The readme says it needs nasm? That's not a standard dependency for the CPython build currently, which relies solely on a C compiler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:17:38 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Mon, 17 Aug 2020 14:17:38 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597673858.22.0.172775492206.issue41566@roundup.psfhosted.org> Ruben Vorderman added the comment: nasm or yasm will work. I only have experience building it with nasm. But yes that is indeed a dependency. Personally I do not see the problem with adding nasm as a build dependency, as it opens up possibilities for even more performance optimizations in python by moving parts of the code to Assembly. But I can imagine that there might be complications with updating the build system. Libdeflate does not have this problem as it entirely in C. So it could be interesting to use that. I think the unfortunate use of memory is due to the libdeflate-gzip coding, and not necessarily because of the library. Samtools is a tool that uses libdeflate library to great effect and its memory usage is fine. > No, the bug tracker seems fine for this. Well one thing is that libdeflate and isa-l use different compression ratio's for the levels. isa-l does not support anything above 3. libdeflate supports 1-12. So it is not a one-to-one mapping. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:20:06 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 14:20:06 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597674006.49.0.0308594934412.issue40782@roundup.psfhosted.org> miss-islington added the comment: New changeset 29f84294d88ec493c2de9d6e8dbc12fae3778771 by James Weaver in branch 'master': bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852) https://github.com/python/cpython/commit/29f84294d88ec493c2de9d6e8dbc12fae3778771 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:21:24 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 14:21:24 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597674084.82.0.649953440343.issue40782@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21020 pull_request: https://github.com/python/cpython/pull/21903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:21:30 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 14:21:30 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597674090.63.0.87056947603.issue40782@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21021 pull_request: https://github.com/python/cpython/pull/21904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:29:19 2020 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 17 Aug 2020 14:29:19 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597674559.35.0.0952211700454.issue41566@roundup.psfhosted.org> Stefan Behnel added the comment: > libdeflate and isa-l use different compression ratio's for the levels. I don't see why these would need to translate 1:1. The zlib module is a Python API wrapper, it can do its own mapping here, or use the libraries selectively only for some compression levels. Python code also cannot rely on an exact bit pattern coming out of the zlib/gzip compressor, since that might change with the zlib version that is available. So I think we're fine when replacing the underlying implementation, as long as the API does not change and the output is strictly zlib/gzip compatible (and there are no visible performance/size regressions, as your numbers seem to suggest, but that would need some broader testing). You also wrote on python-ideas that > It is packaged in linux distros already That might be an option then. CPython could use the existing library if it is available. It doesn't have to ship the sources. Most Linux distributions already build some standard library modules against the system-wide installed libraries rather than whatever CPython ships in its sources. And those distributions could then make the library a fixed dependency of their CPython packages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:31:33 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 14:31:33 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references Message-ID: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : OK (skipped=26) ...... test_zoneinfo leaked [84, 84, 84] references, sum=252 test_zoneinfo leaked [41, 41, 41] memory blocks, sum=123 1 test failed again: test_zoneinfo == Tests result: FAILURE then FAILURE == Example failure: https://buildbot.python.org/all/#/builders/84/builds/3 ---------- messages: 375550 nosy: p-ganssle, pablogsal priority: normal severity: normal status: open title: test_zoneinfo leaked [84, 84, 84] references _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:31:50 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 14:31:50 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597674710.02.0.590444548038.issue41568@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- assignee: -> p-ganssle priority: normal -> release blocker versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:37:32 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 14:37:32 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597675052.16.0.171824421518.issue40782@roundup.psfhosted.org> miss-islington added the comment: New changeset 1baa8b14ee23ef3040923f53565c8d1bafd28117 by Miss Islington (bot) in branch '3.8': bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852) https://github.com/python/cpython/commit/1baa8b14ee23ef3040923f53565c8d1bafd28117 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:40:33 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 14:40:33 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597675233.83.0.283963459218.issue40782@roundup.psfhosted.org> miss-islington added the comment: New changeset d6bdf6d52f0400df1bd1dce24aaad9514015c755 by Miss Islington (bot) in branch '3.9': bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852) https://github.com/python/cpython/commit/d6bdf6d52f0400df1bd1dce24aaad9514015c755 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 10:41:46 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 17 Aug 2020 14:41:46 +0000 Subject: [issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future In-Reply-To: <1590507938.7.0.58927076005.issue40782@roundup.psfhosted.org> Message-ID: <1597675306.48.0.449829501253.issue40782@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 Mon Aug 17 10:43:49 2020 From: report at bugs.python.org (hai shi) Date: Mon, 17 Aug 2020 14:43:49 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597675429.12.0.686254863205.issue1635741@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +21022 pull_request: https://github.com/python/cpython/pull/21902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 11:06:00 2020 From: report at bugs.python.org (Matt Joiner) Date: Mon, 17 Aug 2020 15:06:00 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1597676760.82.0.717648407416.issue41564@roundup.psfhosted.org> Matt Joiner added the comment: https://github.com/python/cpython/blob/48b069a003ba6c684a9ba78493fbbec5e89f10b8/Lib/_collections_abc.py#L953 https://github.com/python/cpython/blob/0e95bbf08571e98f4b688524efc2dcf20d315d91/Lib/typing.py#L1612 ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 11:11:05 2020 From: report at bugs.python.org (jack1142) Date: Mon, 17 Aug 2020 15:11:05 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597677065.39.0.299538451194.issue41566@roundup.psfhosted.org> Change by jack1142 : ---------- nosy: +jack1142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 11:17:09 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 17 Aug 2020 15:17:09 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1597677429.05.0.446194878684.issue41564@roundup.psfhosted.org> Eric V. Smith added the comment: We need to know how to trigger the problem you're seeing. You need to provide code we can run that shows the error you're seeing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 11:55:10 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 17 Aug 2020 15:55:10 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597679710.38.0.919603635256.issue41526@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the report! This should be in the next 3.9 RC. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 12:07:35 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Aug 2020 16:07:35 +0000 Subject: [issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1 In-Reply-To: <1597664250.53.0.724586569237.issue41567@roundup.psfhosted.org> Message-ID: <1597680455.47.0.141422455941.issue41567@roundup.psfhosted.org> Irit Katriel added the comment: I think this is no a bug, on the basis that multiprocessing.Pool is not thread-safe. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 12:21:21 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 Aug 2020 16:21:21 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597681281.46.0.568014999176.issue41545@roundup.psfhosted.org> Dennis Sweeney added the comment: The save-a-boolean-for-each-context-manager approach has an issue if used with concurrent generators, where the lifetimes of two generator objects might be overlapping but not completely nested, as shown below. The same issue should arise when using multiple threads. The approach in no_gc.py with counting the times_disabled does not run into the same issue. >>> from contextlib import contextmanager >>> import gc >>> @contextmanager def no_gc(): was_enabled = gc.isenabled() try: yield finally: if was_enabled: gc.enable() >>> def gen1(): with no_gc(): yield "a" yield "b" yield "c" >>> def gen2(): with no_gc(): yield 1 yield 2 yield 3 >>> >>> g1 = gen1() >>> g2 = gen2() >>> next(g1) 'a' >>> next(g2) 1 >>> list(g1) ['b', 'c'] >>> gc.isenabled() # should be False! True >>> list(g2) [2, 3] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 12:23:53 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 17 Aug 2020 16:23:53 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597681433.32.0.845557311094.issue41545@roundup.psfhosted.org> Dennis Sweeney added the comment: FWIW I forgot the gc.disable() line in the contextmanager, but what I said still applies. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 12:32:36 2020 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 17 Aug 2020 16:32:36 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597681956.09.0.377131855971.issue41025@roundup.psfhosted.org> Paul Ganssle added the comment: There are two refleaks here. One is a reference leaking to the weak cache in `__init_subclass__` (one leak every time a subclass is created), and the other is that when `subclass.clear_cache()` is called, it sets `ZONEINFO_STRONG_CACHE = NULL`, thus causing a reference leak to the parent class's strong cache. I'll send a PR to fix it shortly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 13:23:01 2020 From: report at bugs.python.org (Larry Hastings) Date: Mon, 17 Aug 2020 17:23:01 +0000 Subject: [issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures In-Reply-To: <1593614146.46.0.384684767233.issue41183@roundup.psfhosted.org> Message-ID: <1597684981.93.0.279815385539.issue41183@roundup.psfhosted.org> Larry Hastings added the comment: > Does testing with the environment variable OPENSSL_CONF=/non-existing-file workaround the remaining issues? Sadly, no. I get the same failures whether or not that environment variable is set. And I confirmed that the environment variable survives Python's testing harness, it doesn't get unset or overwritten. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 13:42:21 2020 From: report at bugs.python.org (David Byrne) Date: Mon, 17 Aug 2020 17:42:21 +0000 Subject: [issue41569] json.JSONEncoder.default should be called for dict keys as well Message-ID: <1597686141.71.0.298355570835.issue41569@roundup.psfhosted.org> New submission from David Byrne : Sub-classing and overriding json.JSONEncoder.default allows users to create custom serialisation for objects that can?t otherwise be serialized. However, this method is only called for dictionary values such that dictionary supported keys (i.e. hashable types) can not be fully utilized. Calling .default on keys as well as values allows users to to fully utilize json for all dict supported types. See https://stackoverflow.com/questions/63393059/json-dump-not-calling-default-or-cls for example ---------- components: Library (Lib) messages: 375561 nosy: david.byrne222 priority: normal severity: normal status: open title: json.JSONEncoder.default should be called for dict keys as well type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:06:06 2020 From: report at bugs.python.org (Peter Lovett) Date: Mon, 17 Aug 2020 18:06:06 +0000 Subject: [issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow In-Reply-To: <1597194249.21.0.0691065972604.issue41526@roundup.psfhosted.org> Message-ID: <1597687566.22.0.85134210993.issue41526@roundup.psfhosted.org> Peter Lovett added the comment: :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:07:44 2020 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 17 Aug 2020 18:07:44 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597687664.31.0.838245290036.issue41568@roundup.psfhosted.org> Change by Paul Ganssle : ---------- keywords: +patch pull_requests: +21023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:29:13 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Aug 2020 18:29:13 +0000 Subject: [issue40815] Multiprocessing docs don't describe thread-safety In-Reply-To: <1590758700.82.0.757809403714.issue40815@roundup.psfhosted.org> Message-ID: <1597688953.91.0.311783821135.issue40815@roundup.psfhosted.org> Irit Katriel added the comment: Probably another example: issue41567 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:32:08 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Aug 2020 18:32:08 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597689128.79.0.50659960168.issue40994@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:46:06 2020 From: report at bugs.python.org (Roundup Robot) Date: Mon, 17 Aug 2020 18:46:06 +0000 Subject: [issue14134] xmlrpc.client.ServerProxy needs timeout parameter In-Reply-To: <1330294741.21.0.00592117933576.issue14134@psf.upfronthosting.co.za> Message-ID: <1597689966.39.0.2099085486.issue14134@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +21024 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/21908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:57:22 2020 From: report at bugs.python.org (Matt Prahl) Date: Mon, 17 Aug 2020 18:57:22 +0000 Subject: [issue14134] xmlrpc.client.ServerProxy needs timeout parameter In-Reply-To: <1330294741.21.0.00592117933576.issue14134@psf.upfronthosting.co.za> Message-ID: <1597690642.62.0.77177205053.issue14134@roundup.psfhosted.org> Change by Matt Prahl : ---------- nosy: +mprahl nosy_count: 7.0 -> 8.0 pull_requests: +21025 pull_request: https://github.com/python/cpython/pull/21909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 14:58:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Aug 2020 18:58:01 +0000 Subject: [issue40756] Second argument of LoggerAdapter.__init__ should default to None In-Reply-To: <1590343358.29.0.207811312221.issue40756@roundup.psfhosted.org> Message-ID: <1597690681.29.0.621796247721.issue40756@roundup.psfhosted.org> Irit Katriel added the comment: looks like this can be closed now? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 15:47:56 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 17 Aug 2020 19:47:56 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1597693676.9.0.271693747486.issue41546@roundup.psfhosted.org> Steve Dower added the comment: I'm inclined to agree that it should pass silently in this case, as if it were printing with print() rather than .write(). What better meaning is there for sys.stdout == None than "no output"? ---------- versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 16:07:14 2020 From: report at bugs.python.org (Jonathan Hoffstadt) Date: Mon, 17 Aug 2020 20:07:14 +0000 Subject: [issue41570] Add DearPyGui to faq/gui.rst Message-ID: <1597694834.82.0.650737066259.issue41570@roundup.psfhosted.org> Change by Jonathan Hoffstadt : ---------- assignee: docs at python components: Documentation nosy: docs at python, jhoffstadt priority: normal severity: normal status: open title: Add DearPyGui to faq/gui.rst type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 16:08:56 2020 From: report at bugs.python.org (Jonathan Hoffstadt) Date: Mon, 17 Aug 2020 20:08:56 +0000 Subject: [issue41570] Add DearPyGui to faq/gui.rst Message-ID: <1597694936.07.0.525698050112.issue41570@roundup.psfhosted.org> Change by Jonathan Hoffstadt : ---------- keywords: +patch pull_requests: +21026 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 16:29:11 2020 From: report at bugs.python.org (R. David Murray) Date: Mon, 17 Aug 2020 20:29:11 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation In-Reply-To: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> Message-ID: <1597696151.96.0.924997738358.issue41553@roundup.psfhosted.org> R. David Murray added the comment: Yes for the registry changes. I thought we had fixed the bug that was causing message-id to get encoded, but maybe it still exists in 3.7? I don't remember when we fixed it (and I may be remembering wrong!) As for X- "unstructured headers" getting trashed, by *definition* in the rfc, if the header body is unstructured it must support RFC encoding. If does not, it is not an unstructured header field. Which is why I said we need to think about what characteristics the default parser should have. The RFC doesn't really speak to that, it expects every header to be one of the defined types...but while an X- header might be of a defined type, the email package can't know that unless it is told, so what should we use as the default parsing strategy? "text without encoded words" isn't really RFC compliant, I think. (Though I'll admit it has been a while since I last reviewed the relevant RFCs.) Note that I believe that we have an open issue (or at least an open discussion) that we should change the 'refold_source' default from 'long' to 'none', which means that X- headers would at least be passed through by default. It would also mitigate this problem, and can be used as a local workaround for headers that are just getting passed through and not modified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 16:36:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 17 Aug 2020 20:36:27 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1597696587.8.0.737816799247.issue1635741@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8aa163eea6b0fb4693f6c0a314d4f2ccada51d70 by Hai Shi in branch 'master': bpo-1635741: Explict GC collect after PyInterpreterState_Clear() (GH-21902) https://github.com/python/cpython/commit/8aa163eea6b0fb4693f6c0a314d4f2ccada51d70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 17:37:25 2020 From: report at bugs.python.org (Yonatan Goldschmidt) Date: Mon, 17 Aug 2020 21:37:25 +0000 Subject: [issue41545] gc API requiring matching number of gc.disable - gc.enable calls In-Reply-To: <1597362741.87.0.831562855057.issue41545@roundup.psfhosted.org> Message-ID: <1597700245.77.0.790209086365.issue41545@roundup.psfhosted.org> Yonatan Goldschmidt added the comment: Hmm... I didn't think of overlapping lock periods. You are right, Dennis, a counter must be managed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 17:58:55 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 17 Aug 2020 21:58:55 +0000 Subject: [issue35024] Incorrect logging in importlib when '.pyc' file creation fails In-Reply-To: <1539921641.62.0.788709270274.issue35024@psf.upfronthosting.co.za> Message-ID: <1597701535.6.0.171671662506.issue35024@roundup.psfhosted.org> Irit Katriel added the comment: This seems resolved, can it be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:17:05 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 17 Aug 2020 22:17:05 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597702625.11.0.30835652503.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: > That's probably due to a very small size of the Paging Space of the AIX machine you used for testing. That is the case, the machine has 160GB of memory and 1GB of paging space. I guess it is configured specifically for not freezing. > About PSALLOC=early , I confirm that it perfectly fixes the issue. I'm surprised, because it is unspeakably slow on this machine, even with the skips in place: PSALLOC=early time ./python -m test -uall test_decimal I hit Ctrl-C after 10min, so it takes even longer: Real 622.11 User 11.63 System 350.12 (!) The -bmaxdata approach has no speed penalty. Note that you can use 10 petabytes for the value, it should still prevent this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:23:13 2020 From: report at bugs.python.org (David Edelsohn) Date: Mon, 17 Aug 2020 22:23:13 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597702993.98.0.91336661335.issue41540@roundup.psfhosted.org> David Edelsohn added the comment: > About PSALLOC=early , I confirm that it perfectly fixes the issue. > I'm surprised, because it is unspeakably slow on this machine, These statements are not contradictory. No one is suggesting that Python always should run with PSALLOC=early. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:25:43 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 17 Aug 2020 22:25:43 +0000 Subject: [issue41100] Build failure on macOS 11 (beta) In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1597703143.46.0.208630365424.issue41100@roundup.psfhosted.org> Ned Deily added the comment: New changeset a0ad82959652ff64c99231f457fd740b17330514 by Ned Deily in branch '3.7': bpo-41100: additional fixes for testing on macOS 11 Big Sur Intel https://github.com/python/cpython/commit/a0ad82959652ff64c99231f457fd740b17330514 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:35:10 2020 From: report at bugs.python.org (Stefan Krah) Date: Mon, 17 Aug 2020 22:35:10 +0000 Subject: [issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX In-Reply-To: <1597320927.12.0.00429700709329.issue41540@roundup.psfhosted.org> Message-ID: <1597703710.86.0.314242734028.issue41540@roundup.psfhosted.org> Stefan Krah added the comment: Well, I misunderstood this sentence then, so it's just for testing. :) > Our customers should use it or use ulimit -d. One will hit this issue also when following the MAX_PREC section in the FAQ, but that is a rare case: https://docs.python.org/3.10/library/decimal.html#decimal-faq ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:40:25 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 22:40:25 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597704025.24.0.132345704257.issue41568@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +21027 pull_request: https://github.com/python/cpython/pull/21912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:40:16 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 22:40:16 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597704016.37.0.818351801526.issue41568@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4 by Paul Ganssle in branch 'master': bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907) https://github.com/python/cpython/commit/c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:50:12 2020 From: report at bugs.python.org (Arturo Escaip) Date: Mon, 17 Aug 2020 22:50:12 +0000 Subject: [issue40756] Second argument of LoggerAdapter.__init__ should default to None In-Reply-To: <1590343358.29.0.207811312221.issue40756@roundup.psfhosted.org> Message-ID: <1597704612.19.0.658277768774.issue40756@roundup.psfhosted.org> Change by Arturo Escaip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 18:50:38 2020 From: report at bugs.python.org (Arturo Escaip) Date: Mon, 17 Aug 2020 22:50:38 +0000 Subject: [issue40756] Second argument of LoggerAdapter.__init__ should default to None In-Reply-To: <1590343358.29.0.207811312221.issue40756@roundup.psfhosted.org> Message-ID: <1597704638.0.0.025045709477.issue40756@roundup.psfhosted.org> Arturo Escaip added the comment: Done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:24:30 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 17 Aug 2020 23:24:30 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597706670.9.0.660885365221.issue41568@roundup.psfhosted.org> miss-islington added the comment: New changeset e3cafebb5cb2bc4df03afb03fa206a37d076d7ee by Miss Islington (bot) in branch '3.9': bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907) https://github.com/python/cpython/commit/e3cafebb5cb2bc4df03afb03fa206a37d076d7ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:32:47 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:32:47 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597707167.99.0.55300407092.issue41568@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:38:43 2020 From: report at bugs.python.org (Greg Price) Date: Mon, 17 Aug 2020 23:38:43 +0000 Subject: [issue1524081] logging using the SysLog handler fails if locale is set Message-ID: <1597707523.77.0.286901741182.issue1524081@roundup.psfhosted.org> Greg Price added the comment: For the record because this issue is mentioned in a comment in logging/handlers.py and people are sometimes confused by it today: > This happens because in that particular locale, > "INFO".lower() != "info" Since Python 3, this no longer happens: str.lower() and friends do not depend on the current locale. Specifically, the lower() and similar methods on Unicode strings (now "str", previously "unicode") were always independent of the current locale. The corresponding methods on byte strings (now "bytes", previously "str") did have this locale-dependent behavior, but that was replaced in commit 6ccd3f2dbcb98b33a71ffa6eae949deae797c09c, in 2007. See also #37848, for a 2019 discussion of potentially adding an optional parameter to use an *explicit* locale. ---------- nosy: +Greg Price _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:39:18 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:39:18 +0000 Subject: [issue41560] pathlib.Path.glob fails on empty string In-Reply-To: <1597543364.86.0.966636544489.issue41560@roundup.psfhosted.org> Message-ID: <1597707558.1.0.828261628553.issue41560@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > This is not the desired or expected behaviour, which would be to just return `path` if it exists. That's the expected behaviour if the call is successful (it does not violate any pre-condition. > This behaviour is also inconsistent with the documentation which states Not IMHO, what the documentation is described is the happy path/successful call. If the pattern is invalid, it can perfectly raise and error and the documentation will still be true. > And it is in contrast to the behaviour of glob.glob, which is just fine with the empty string, returning an empty list. This is the point that is interesting to discuss. Why is this behavior desirable? In my view, it can be the source of bugs if the user is not aware that what is placing there is an empty string. When is useful to pass something that can be an empty string?+ ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:40:00 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:40:00 +0000 Subject: [issue41555] re.sub replaces twice In-Reply-To: <1597444113.99.0.353653909979.issue41555@roundup.psfhosted.org> Message-ID: <1597707600.73.0.780226041288.issue41555@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:48:13 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:48:13 +0000 Subject: [issue41571] Allow pdb to switch to a different thread In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597708093.02.0.511797923882.issue41571@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:48:01 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:48:01 +0000 Subject: [issue41571] Allow pdb to switch to a different thread Message-ID: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Unfortunately, the thread experience with pdb is not as good as it could be due to the lack of thread-related commands. In other debuggers like gdb, is common to be able to do some of the following operations: * list all threads * switch the context to a different thread. * Stop all threads when attaching. * Place a breakpoint in a specific thread. I think the user experience will improve considerably if we could implement at least these features (and maybe some others that we deem useful). ---------- messages: 375579 nosy: pablogsal priority: normal severity: normal status: open title: Allow pdb to switch to a different thread versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:48:34 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:48:34 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597708114.21.0.686142389225.issue41571@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- title: Allow pdb to switch to a different thread -> Implement thread-related commands in pdb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 19:49:04 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 17 Aug 2020 23:49:04 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597708144.32.0.661518382854.issue41571@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will start preparing some pull requests unless someone has any concerns about this ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 20:02:54 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 Aug 2020 00:02:54 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597708974.76.0.451396348897.issue41571@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg375580 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 20:15:35 2020 From: report at bugs.python.org (Cleber Rosa) Date: Tue, 18 Aug 2020 00:15:35 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py Message-ID: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> New submission from Cleber Rosa : The docstring on asyncio.transports.BaseTransport.close() is missing a verb. ---------- assignee: docs at python components: Documentation messages: 375581 nosy: cleber.gnu, docs at python priority: normal severity: normal status: open title: Documentation wording fix on Lib/asyncio/transports.py type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 20:20:47 2020 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 18 Aug 2020 00:20:47 +0000 Subject: [issue30493] Increase coverage of base64 In-Reply-To: <1495917948.16.0.130856040345.issue30493@psf.upfronthosting.co.za> Message-ID: <1597710047.93.0.391175747433.issue30493@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +21029 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 20:21:43 2020 From: report at bugs.python.org (Roundup Robot) Date: Tue, 18 Aug 2020 00:21:43 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1597710103.71.0.415099417476.issue41572@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +21030 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21914 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 20:49:34 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Tue, 18 Aug 2020 00:49:34 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597711774.19.0.624759660431.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: Further note: login_tty will also enable us to set slave termios from the parent process in pty.spawn. Due to the fact that reviewing patches can be overwhelming, v0.5 removes a lot of stuff and instead simply performs window resize by calling ioctl TIOCSWINSZ on the master end of the pty. Still works as expected. ---------- Added file: https://bugs.python.org/file49402/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 21:07:48 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 18 Aug 2020 01:07:48 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ Message-ID: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> New submission from wyz23x2 : Release candidate is "rc" not "c"; Python 2.x is not supported anymore. ---------- assignee: docs at python components: Documentation messages: 375583 nosy: docs at python, wyz23x2 priority: normal severity: normal status: open title: Correct wrong sentences in General FAQ versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 21:11:03 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 18 Aug 2020 01:11:03 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1597713063.49.0.647227841768.issue41573@roundup.psfhosted.org> Change by wyz23x2 : ---------- keywords: +patch pull_requests: +21031 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21915 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 21:12:11 2020 From: report at bugs.python.org (wyz23x2) Date: Tue, 18 Aug 2020 01:12:11 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1597713131.16.0.47462194189.issue41573@roundup.psfhosted.org> wyz23x2 added the comment: GH-21915 submitted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 23:08:24 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 Aug 2020 03:08:24 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597720104.88.0.241487518656.issue41571@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: * Displaying all threads is trivial. * Stopping all threads is trivial because of the GIL. When pdb runs in a thread all other threads cannot execute python code. They can execute native code bit there is not much we can do about it. * Switching threads is the interesting one. The easiest way is to set the pdb trace function in the target thread and run until they thread executes python code. This has the following considerations: - All PSB commands will automatically work on that thread once the trace function is executed. - There will be a delay between the command and the thread being switched. This is due to the fact that we do not control what thread will run and we need to wait until the thread executes Python code. - Switching to a thread that is blocked on something (on a lock or on C code) will hang. For this reason, this method can work only for setting breakpoints on threads, not for 'switching threads'. The breakpoint will work because that's the expected behaviour: the day and the possibility of not hitting it is justified on the nature of the breakpoint. For switching threads, the best way would be to 'virtually switch threads'. This means that somehow we switch internally to the thread stack but we keep executing on the main thread, we merely switch our internal context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 23:08:40 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Aug 2020 03:08:40 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597720120.34.0.626698602657.issue41523@roundup.psfhosted.org> Raymond Hettinger added the comment: I recommend closing this. As Serhiy pointed out, they are profoundly different. Currently, a user can rely on the isinstance() check to differentiate them. So, changing the behavior would be a regression. AFAICT, a user would not be able to deduce anything useful from the isinstance() check returning True in all three cases. Essentially, all they have in common is the concept of caching; otherwise, the mechanisms and implications are entirely unrelated. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 23:13:51 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 Aug 2020 03:13:51 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597720431.79.0.216948076779.issue41571@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We may need to think as well how some commands interest when you are in a different thread context. For instance, stepping into something when you are in a different thread is equivalent to setting a breakpoints in the next thread instruction, so this has the same considerations as the breakpoints. We may want to disallow this or to emit some warning in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 23:25:44 2020 From: report at bugs.python.org (William Pickard) Date: Tue, 18 Aug 2020 03:25:44 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597721144.1.0.654778830557.issue41523@roundup.psfhosted.org> William Pickard added the comment: Another thing to note Raymond, as I stated before, example C is, from an external context, is a plain property object who's "fget" attribute is an instance of whatever "lru_cache" returns. isinstance won't be able to differentiate between example "a" and "c" without checking "fget" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 23:28:08 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 Aug 2020 03:28:08 +0000 Subject: [issue41571] Implement thread-related commands in pdb In-Reply-To: <1597708081.91.0.301663763083.issue41571@roundup.psfhosted.org> Message-ID: <1597721288.36.0.414261501326.issue41571@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Another possibility would be accept the reality of the switching delay (so all the other commands work without extra changes) and working to minimize it by setting sys.setswitchinterval() to something ridiculously low and then switching it back to the previous value once we are in the thread that we want. If this is not enough we could sed modify the Gil-adquire code to do something similar to what the Python 2 implementation did when signals arrive that is basically switch constantly between threads until the one that we want runs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 17 23:34:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Aug 2020 03:34:35 +0000 Subject: [issue41523] functools.cached_property does not satisfy the property check In-Reply-To: <1597166637.39.0.130570807543.issue41523@roundup.psfhosted.org> Message-ID: <1597721675.05.0.28509920463.issue41523@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 00:34:00 2020 From: report at bugs.python.org (Alexander Heger) Date: Tue, 18 Aug 2020 04:34:00 +0000 Subject: [issue41560] pathlib.Path.glob fails on empty string In-Reply-To: <1597543364.86.0.966636544489.issue41560@roundup.psfhosted.org> Message-ID: <1597725240.53.0.399930302129.issue41560@roundup.psfhosted.org> Alexander Heger added the comment: In my code, having been translated form use of `os.path` to `pathlib.Path` the change in behaviour caused errors and required significant refactoring. Why not just return the empty list if there is no match, as is done in other cases when there is no match, except when passing the empty string. For example, in my case, the base path already refers to a potentially existing file[name] and I then "glob" for appendices to the filename or suffices (or neither or both). So in this case the glob for empty strong would just return the file if it exists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 00:48:30 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Aug 2020 04:48:30 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597726110.44.0.0547667410282.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's a much cheaper way to get correctly rounded results almost all of the time. It uses Serhiy's idea for scaling by a power of two, Tim's idea for Veltkamp-Dekker splitting, my variant of Neumaier summation, and the paper's differential correction. Together, these allow the algorithm to simulate 128-bit quad precision throughout. # Veltkamp-Dekker splitting def split(x, T27=ldexp(1.0, 27)+1.0): t = x * T27 hi = t - (t - x) lo = x - hi assert hi + lo == x return hi, lo # Variant of Neumaier summation specialized # for cases where |csum| >= |x| for every x. # Establishes the invariant by setting *csum* # to 1.0, only adding *x* values of smaller # magnitude, and subtracting 1.0 at the end. def zero(): return 1.0, 0.0 # csum, frac def add_on(x, state): csum, frac = state assert fabs(csum) >= fabs(x) oldcsum = csum csum += x frac += (oldcsum - csum) + x return csum, frac def to_float(state): csum, frac = state return csum - 1.0 + frac def hypot(*xs): max_value = max(xs, key=fabs) _, max_e = frexp(max_value) scalar = ldexp(1.0, -max_e) parts = zero() for x in xs: x *= scalar a, b = split(x) parts = add_on(a*a, parts) parts = add_on(2.0*a*b, parts) parts = add_on(b*b, parts) result = sqrt(to_float(parts)) a, b = split(result) parts = add_on(-a*a, parts) parts = add_on(-2.0*a*b, parts) parts = add_on(-b*b, parts) x = to_float(parts) # best float approx to sum(x_i ** 2) - result**2 result += x / (2.0 * result) return result / scalar ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 00:58:51 2020 From: report at bugs.python.org (song super) Date: Tue, 18 Aug 2020 04:58:51 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597726731.26.0.249858554445.issue41565@roundup.psfhosted.org> song super <2262720766 at qq.com> added the comment: I mean?os.path.join('3', '{:3') return '{:3' in windows,However,os.path.join('3', '{:3') return '3/{:3'in linux,output result not '3'in windows,why? for example: >>> from os.path import join >>> join('3', '{:3') output:'{:3' >>> join('3', '{3') output:'3\\{3' I think 'join('3', '{:3') ' output '3\\{:3' in windows ---------- nosy: +2262720766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 02:16:59 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Tue, 18 Aug 2020 06:16:59 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597731419.86.0.132770669919.issue41566@roundup.psfhosted.org> Ruben Vorderman added the comment: > That might be an option then. CPython could use the existing library if it is available. Dynamic linking indeed seems like a great option here! Users who care about this will probably have the 'isal' and 'libdeflateO' packages installed on their machine anyway. I packaged isa-l on conda-forge, so it is available via the anaconda/miniconda installer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 03:06:30 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Aug 2020 07:06:30 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597734390.06.0.795874926955.issue41565@roundup.psfhosted.org> Serhiy Storchaka added the comment: Because '{' in '{:3' is a drive letter. When you open file with path '{:3' you open file with name '3' in the current directory of drive '{', not file with name '{:3' on current drive and directory. It is not a Python bug. If you think there is a bug, please file a report for Windows. The behavior of os.path.join() will be changed after Windows change its file path resolution rules. ---------- nosy: +serhiy.storchaka -2262720766 resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 03:10:50 2020 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 18 Aug 2020 07:10:50 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1597734650.35.0.402060677908.issue41564@roundup.psfhosted.org> Change by Eric V. Smith : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 03:36:54 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Tue, 18 Aug 2020 07:36:54 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597736214.21.0.779085351004.issue41566@roundup.psfhosted.org> Ruben Vorderman added the comment: I just find out that libdeflate does not support streaming: https://github.com/ebiggers/libdeflate/issues/73 . I should have read the manual better. So that explains the memory usage. Because of that I don't think it is suitable for usage in CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 03:45:06 2020 From: report at bugs.python.org (Eryk Sun) Date: Tue, 18 Aug 2020 07:45:06 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597736706.57.0.975755092107.issue41565@roundup.psfhosted.org> Eryk Sun added the comment: > I mean?os.path.join('3', '{:3') return '{:3' in windows, However, > os.path.join('3', '{:3') return '3/{:3'in linux, output result not > '3' in windows, why? The implementation of ntpath.join handles "{:" as a drive. Thus "{:3" is a drive-relative path, i.e. "3" is relative to the current working directory on drive "{:". In particular, for each joined component, ntpath.join calls ntpath.splitdrive, which splits at the second character if it's a colon, regardless of the first character. For example: >>> ntpath.splitdrive('{:3') ('{:', '3') As demonstrated in my previous post, the Windows file API supports drive names that use any basic multilingual plane (BMP) character, including symbol characters such as "{". So the long-standing behavior of ntpath.splitdrive in this regard is generally right. Except it shouldn't allow the first character to be a path separator, i.e. the following result is nonsense: >>> ntpath.splitdrive('/:/spam') ('/:', '/spam') > with path '{:3' you open file with name '3' in the current > directory of drive '{' The drive name would be "{:", not "{". It's a common usage, for example, to call "C:" the "C" drive, but the drive name actually includes the colon. This differs from the usage of colon in file streams, in which the colon is a delimiter that's not part of the name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 03:53:27 2020 From: report at bugs.python.org (Paul Moore) Date: Tue, 18 Aug 2020 07:53:27 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597737207.63.0.823262962082.issue41565@roundup.psfhosted.org> Paul Moore added the comment: I think the key point here is that os.path.join is *meant* to have platform-native semantics, so it treats '{:' as a drive letter on Windows, but Linux doesn't have drive letters, so os.path.join treats '{:' as a normal part of a filename on Linux. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 04:15:25 2020 From: report at bugs.python.org (Michael Felt) Date: Tue, 18 Aug 2020 08:15:25 +0000 Subject: [issue41401] Using non-ascii that require UTF-8 breaks AIX testing In-Reply-To: <1595772423.92.0.81107313537.issue41401@roundup.psfhosted.org> Message-ID: <1597738525.26.0.500101712379.issue41401@roundup.psfhosted.org> Michael Felt added the comment: As much as I wish I had the skills to do the cherry picking - I am not going to touch this. The AIX bots for 3.9 branch continue to report broken for test_io (ENV change) - as they still wait for the backport for that branch! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 04:41:25 2020 From: report at bugs.python.org (Eryk Sun) Date: Tue, 18 Aug 2020 08:41:25 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597740085.28.0.353009796124.issue41565@roundup.psfhosted.org> Eryk Sun added the comment: It's worth mentioning that pathlib restricts the first character of a Windows drive name to the set of ASCII letters in pathlib._WindowsFlavour.drive_letters. For example: >>> Path('3') / 'C:3' WindowsPath('C:3') vs. >>> Path('3') / '{:3' WindowsPath('3/{:3') This design supports normal DOS drive names such as drives assigned automatically or via diskmgmt.msc, diskpart.exe, and so on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 04:43:35 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Aug 2020 08:43:35 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597740215.3.0.203170076523.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Hmm, I tried-out a C implementation and the timings weren't bad, 60% slower in exchange for always being correctly rounded. Do you all think that would be worth it? # New correctly rounded $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.5, 0.3, 5.2)' 2000000 loops, best of 11: 101 nsec per loop $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.81)' 5000000 loops, best of 11: 82.8 nsec per loop # Current baseline for Python 3.10 $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.5, 0.3, 5.2)' 5000000 loops, best of 11: 65.6 nsec per loop $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.81)' 5000000 loops, best of 11: 56.6 nsec per loop # Current baseline for Python 3.9 $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.5, 0.3, 5.2)' 5000000 loops, best of 11: 72.2 nsec per loop ~/npython $ ./python.exe -m timeit -r11 -s 'from math import hypot' 'hypot(1.7, 15.81)' 5000000 loops, best of 11: 56.2 nsec per loop ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 04:50:45 2020 From: report at bugs.python.org (Prudent) Date: Tue, 18 Aug 2020 08:50:45 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. Message-ID: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> New submission from Prudent : I am writing codes for opening file dialog to select a file by clicking a button. The function I used was "askopenfilename()" in tkinter.filedialog module. However, a warning displayed when I ran the code. And, the file filter option was also disabled after one click. The displayed warning was below. ---------- components: macOS files: warning.png messages: 375601 nosy: Prudent, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49403/warning.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 04:54:23 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 18 Aug 2020 08:54:23 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597740863.99.0.482819639847.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +21032 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/21916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 05:15:41 2020 From: report at bugs.python.org (song super) Date: Tue, 18 Aug 2020 09:15:41 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597742141.18.0.244847377145.issue41565@roundup.psfhosted.org> song super <2262720766 at qq.com> added the comment: Think you very much,I am a college student, do not understand these underlying principles, this problem is I wrote a program on Linux, later moved to the windows system found, thank you very much for your answers ---------- nosy: +2262720766 status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 05:35:22 2020 From: report at bugs.python.org (=?utf-8?q?Denilson_Figueiredo_de_S=C3=A1?=) Date: Tue, 18 Aug 2020 09:35:22 +0000 Subject: [issue41575] Please use active voice "Return foobar" instead of passive voice "foobar is returned" Message-ID: <1597743322.05.0.268987971288.issue41575@roundup.psfhosted.org> New submission from Denilson Figueiredo de S? : When reading the documentation for call_soon(), call_later(), call_at(), and several other functions, the sentence that describes the return value is in passive voice: https://docs.python.org/3/library/asyncio-eventloop.html > An instance of asyncio.TimerHandle is returned which can be used to cancel the callback. The problem: Most functions in Python documentation describe the return value by "Return foobar", an active voice sentence at the beginning of a paragraph. (e.g. https://docs.python.org/3/library/functions.html ) Thus, for the reader, it's easy to quickly skim the text for the return value. Even easier because the reader is already trained to do so, given other occurrences in the documentation. However, by hiding "is returned" in the middle of the sentence/paragraph, the reader can't easily find the return value, having to carefully read through all the text. Not only this is slower, but way more difficult if the reader is in a hurry or tired. (That was my case, I missed that sentence even after looking at the documentation several times.) Solution: Change it to: Return an instance of asyncio.TimerHandle which can be used to cancel the callback. Further solution: Search the documentation for other cases of "is returned" and consider if it is worth rewording as active voice. Bonus link: https://developers.google.com/tech-writing/one/active-voice ---------- assignee: docs at python components: Documentation messages: 375603 nosy: denilsonsa, docs at python priority: normal severity: normal status: open title: Please use active voice "Return foobar" instead of passive voice "foobar is returned" type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 05:59:27 2020 From: report at bugs.python.org (E. Paine) Date: Tue, 18 Aug 2020 09:59:27 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597744767.07.0.27658695603.issue41574@roundup.psfhosted.org> E. Paine added the comment: To help us to reproduce the issue, please give your Python version, Tcl/Tk patchlevel (`tkinter.test.support.get_tk_patchlevel()`), MacOS version and a small demonstration script (along with exact keystrokes/clicks if necessary). I suspect this is another Tcl/Tk issue rather than a tkinter problem with this warning being because the MacOS API has changed slightly. ---------- components: +Tkinter nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 06:33:30 2020 From: report at bugs.python.org (Prudent) Date: Tue, 18 Aug 2020 10:33:30 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597746810.31.0.861093744693.issue41574@roundup.psfhosted.org> Prudent added the comment: The versions of Python, Tcl/Tk and MacOS I used are 3.8.5, 8.5.9 and the newest Catalina 10.15.6, respectively. Your words give me a hint about the version of Tcl/Tk. So I checked it. The version I used seems too old, the newest version for it is 8.6. In my thoughts, I always thought those embedded packages could be automatically upgraded after I re-installed a newer python. However, it seems the packages are not be updated as expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 06:41:33 2020 From: report at bugs.python.org (E. Paine) Date: Tue, 18 Aug 2020 10:41:33 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597747293.48.0.576805914163.issue41574@roundup.psfhosted.org> E. Paine added the comment: Ned, does it appear like Python is using the MacOS built-in Tcl version? My (very limited) understanding is that Python will default to the Tcl version packaged with it (which is currently 8.6.8). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 06:56:07 2020 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 18 Aug 2020 10:56:07 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial Message-ID: <1597748167.25.0.315179093688.issue41576@roundup.psfhosted.org> Change by Thomas Grainger : ---------- assignee: docs at python components: Documentation nosy: docs at python, graingert priority: normal pull_requests: 21033 severity: normal status: open title: document BaseException in favour of bare except in error tutorial _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 06:58:46 2020 From: report at bugs.python.org (Prudent) Date: Tue, 18 Aug 2020 10:58:46 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597748326.65.0.660520923436.issue41574@roundup.psfhosted.org> Prudent added the comment: Yes, you are right. Just now, I re-installed Python3.8.5. But when I opened my .py file with tkinter and ran it, it still linked to the old Tcl/Tk(8.5.9) in Python3.7.5. However, when I ran the command "python3 -m tkinter" to check its version. It showed me the new version 8.6. My understanding is that when a newer python is installed, the old files are not replaced. Both of them are kept in computer. Is it right? So, I should manually remove those old files, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 07:10:08 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 18 Aug 2020 11:10:08 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial Message-ID: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> New submission from Serhiy Storchaka : What a problem do you try to solve? What is wrong with the current documentation? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 07:11:53 2020 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 18 Aug 2020 11:11:53 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1597749113.0.0.573406264788.issue41576@roundup.psfhosted.org> Thomas Grainger added the comment: it seems odd to document digging around in sys.exc_info() in favour of the more ergonomic syntax to do the same thing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 07:43:36 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 18 Aug 2020 11:43:36 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597751016.04.0.777614113984.issue41574@roundup.psfhosted.org> Ronald Oussoren added the comment: How did you install Python? Did you use the installer on Python.org or some other method? A script that demonstrates the problem would be useful as well, I've tried to reproduce the problem in an interactive session in the terminal: >>> from tkinter import filedialog >>> filedialog.askopenfilename() This works for me, I also don't get the warning in the attached image. --- Which version of Tk is used depends on how Python is installed. The Python.org installers ship with a copy of Tk for use by Tkinter. Every version (3.7, 3.8, ...) you install ships with its own copy of Tk and won't use the copy of Tk from a different install. Other distributions of Python (home-brew, anaconda, ...) might arrange thing differently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 07:55:05 2020 From: report at bugs.python.org (Mika Hawkins) Date: Tue, 18 Aug 2020 11:55:05 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1597751705.23.0.198997109258.issue41573@roundup.psfhosted.org> Mika Hawkins added the comment: Submitted. Regards, Mika Hawkins ---------- nosy: +Mika_Hawkins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 07:57:09 2020 From: report at bugs.python.org (Mika Hawkins) Date: Tue, 18 Aug 2020 11:57:09 +0000 Subject: [issue41553] encoded-word abused for header line folding causes RFC 2047 violation In-Reply-To: <1597405998.37.0.935240009064.issue41553@roundup.psfhosted.org> Message-ID: <1597751829.59.0.263111103544.issue41553@roundup.psfhosted.org> Mika Hawkins added the comment: Truly for the vault changes. I thought we had fixed the bug that was causing message-id to get encoded, yet perhaps it despite everything exists in 3.7? I don't recall when we fixed it (and I might be recollecting incorrectly!) With respect to X-"unstructured headers" getting destroyed, by *definition* in the rfc, if the header body is unstructured it must help RFC encoding. In the event that doesn't, it's anything but an unstructured header field. Which is the reason I said we have to consider what attributes the default parser ought to have. The RFC doesn't generally address that, it anticipates that each header should be one of the characterized types...but while a X-header may be of a characterized type, the email bundle can't realize that except if it is told, so what would it be a good idea for us to use as the default parsing procedure? "text without encoded words" isn't generally RFC consistent, I think. (In spite of the fact that I'll let it be known has been some time since I last explored the important RFCs.) Note that I accept that we have an open issue (or if nothing else an open conversation) that we should change the 'refold_source' default from 'long' to 'none', which implies that X-headers would in any event be gone through of course. It would likewise alleviate this issue, and can be utilized as a nearby workaround for headers that are simply getting gone through and not altered. Regards, Mika Hawkins ---------- nosy: +Mika_Hawkins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 08:45:26 2020 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 18 Aug 2020 12:45:26 +0000 Subject: [issue33051] IDLE: Create new tab for editor options in configdialog In-Reply-To: <1520796379.91.0.467229070634.issue33051@psf.upfronthosting.co.za> Message-ID: <1597754726.61.0.828616372252.issue33051@roundup.psfhosted.org> Cheryl Sabella added the comment: @epaine, thank you for taking a look at that PR and for your feedback. I agree with you that the changes can still be taken further than we've already done. `init_validators` was added after the initial refactoring and I'm not sure if we've gone back to it to really use it or any other input validators. There's another bug issue (#31306) that addresses the validation on configdialog, so maybe your ideas can be incorporated with that issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 09:47:45 2020 From: report at bugs.python.org (Fieschi) Date: Tue, 18 Aug 2020 13:47:45 +0000 Subject: [issue39345] Py_Initialize Hangs on Windows 10 In-Reply-To: <1579114556.26.0.996943969176.issue39345@roundup.psfhosted.org> Message-ID: <1597758465.1.0.328401276276.issue39345@roundup.psfhosted.org> Change by Fieschi : ---------- nosy: +feellemon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 12:59:41 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 18 Aug 2020 16:59:41 +0000 Subject: [issue41560] pathlib.Path.glob fails on empty string In-Reply-To: <1597543364.86.0.966636544489.issue41560@roundup.psfhosted.org> Message-ID: <1597769981.56.0.251543723064.issue41560@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 13:21:46 2020 From: report at bugs.python.org (Bob Fang) Date: Tue, 18 Aug 2020 17:21:46 +0000 Subject: [issue41577] Cannot use ProcessPoolExecutor if in a decorator? Message-ID: <1597771306.07.0.252837170253.issue41577@roundup.psfhosted.org> New submission from Bob Fang : I have this minimal example: ``` from functools import wraps from concurrent import futures import random def decorator(func): num_process = 4 def impl(*args, **kwargs): with futures.ProcessPoolExecutor() as executor: fs = [] for i in range(num_process): fut = executor.submit(func, *args, **kwargs) fs.append(fut) result = [] for f in futures.as_completed(fs): result.append(f.result()) return result return impl @decorator def get_random_int(): return random.randint(0, 100) if __name__ == "__main__": result = get_random_int() print(result) ``` If we try to run this function I think we will have the following error: ``` _pickle.PicklingError: Can't pickle : it's not the same object as __main__.get_random_int ``` I think the main issue here is that the "wraps" decorator itself alters the `func` object and thus make it impossible to pickle. I found this rather strange. I am just wondering if there is any way to get around this behavior? I would want to use `wraps` if possible. Thanks! ---------- components: Library (Lib) messages: 375614 nosy: bob.fang.london priority: normal severity: normal status: open title: Cannot use ProcessPoolExecutor if in a decorator? type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 13:34:53 2020 From: report at bugs.python.org (Bob Fang) Date: Tue, 18 Aug 2020 17:34:53 +0000 Subject: [issue41577] Cannot use ProcessPoolExecutor if in a decorator? In-Reply-To: <1597771306.07.0.252837170253.issue41577@roundup.psfhosted.org> Message-ID: <1597772093.95.0.178005639314.issue41577@roundup.psfhosted.org> Change by Bob Fang : ---------- versions: +Python 3.6, Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 13:56:34 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Aug 2020 17:56:34 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence Message-ID: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> New submission from Brett Cannon : https://docs.python.org/3/reference/datamodel.html#object.__ror__ has a note saying: "If the right operand's type is a subclass of the left operand's type and that subclass provides the reflected method for the operation, this method will be called before the left operand's non-reflected method." The slightly unclear part (at least to me) is the "provides the reflected method." What this actually means according to https://bugs.python.org/issue30140 is that the subclass **implements** the `__r*__` method, not just that the method is reachable on the subclass via getattr(). That wasn't clear to me when I initially read this. ---------- assignee: docs at python components: Documentation messages: 375621 nosy: brett.cannon, docs at python priority: normal severity: normal stage: needs patch status: open title: Clarify documentation for binary arithmetic operation subclass __r*__ precedence versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 13:56:56 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Aug 2020 17:56:56 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1597773416.93.0.43089291375.issue41584@roundup.psfhosted.org> Change by Brett Cannon : ---------- assignee: docs at python -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 13:58:25 2020 From: report at bugs.python.org (Eryk Sun) Date: Tue, 18 Aug 2020 17:58:25 +0000 Subject: [issue41565] from os.path import join join('3', '{:3') return '{:3' in windows In-Reply-To: <1597640574.94.0.668991787867.issue41565@roundup.psfhosted.org> Message-ID: <1597773505.22.0.927190233102.issue41565@roundup.psfhosted.org> Change by Eryk Sun : ---------- status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 13:59:41 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Aug 2020 17:59:41 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1597773581.49.0.729313713716.issue41584@roundup.psfhosted.org> Brett Cannon added the comment: Or to be more clear, the RHS subclass must provide a **different** implementation of the method than the LHS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 14:29:16 2020 From: report at bugs.python.org (Tim Peters) Date: Tue, 18 Aug 2020 18:29:16 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597775356.44.0.870034861754.issue41513@roundup.psfhosted.org> Tim Peters added the comment: About speed, the fsum() version I posted ran about twice as fast as the all-Decimal approach, but the add_on() version runs a little slower than all-Decimal. I assume that's because fsum() is coded in C while the add_on() prototype makes mounds of additional Python-level function calls. Using released Windows 3.8.5 CPython and on argument vectors of length 50. Is it worth it? Up to you ;-) There are good arguments to be made in favor of increased accuracy, and in favor of speed. About "correctly rounded", such a claim can only be justified by proof, not by testing (unless testing exhaustively covers the entire space of inputs). Short of that, best you can claim is stuff like "max error < 0.51 ulp" (or whatever other bound can be proved). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 14:42:10 2020 From: report at bugs.python.org (Brett Cannon) Date: Tue, 18 Aug 2020 18:42:10 +0000 Subject: [issue35024] Incorrect logging in importlib when '.pyc' file creation fails In-Reply-To: <1539921641.62.0.788709270274.issue35024@psf.upfronthosting.co.za> Message-ID: <1597776130.1.0.752744139748.issue35024@roundup.psfhosted.org> Brett Cannon added the comment: It looks like it! Thanks, Irit! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 16:47:21 2020 From: report at bugs.python.org (Erik Quaeghebeur) Date: Tue, 18 Aug 2020 20:47:21 +0000 Subject: [issue41585] policy.max_line_length is incorrectly assumed to never be None Message-ID: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org> New submission from Erik Quaeghebeur : I?got the following error (Python 3.7.8): Traceback (most recent call last): File "/home/equaeghe/.local/bin/html2alternative.py", line 68, in replaceable.add_alternative(plain) File "/usr/lib/python3.7/email/message.py", line 1153, in add_alternative self._add_multipart('alternative', *args, **kw) File "/usr/lib/python3.7/email/message.py", line 1144, in _add_multipart part.set_content(*args, **kw) File "/usr/lib/python3.7/email/message.py", line 1171, in set_content super().set_content(*args, **kw) File "/usr/lib/python3.7/email/message.py", line 1101, in set_content content_manager.set_content(self, *args, **kw) File "/usr/lib/python3.7/email/contentmanager.py", line 37, in set_content handler(msg, obj, *args, **kw) File "/usr/lib/python3.7/email/contentmanager.py", line 185, in set_text_content cte, payload = _encode_text(string, charset, cte, msg.policy) File "/usr/lib/python3.7/email/contentmanager.py", line 154, in _encode_text max(len(x) for x in lines) <= policy.max_line_length): TypeError: '<=' not supported between instances of 'int' and 'NoneType' This is triggered because it is incorrectly assumed that policy.max_line_length cannot be None. This issue is still present in current master: https://github.com/python/cpython/blob/c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4/Lib/email/contentmanager.py#L149 ---------- components: email messages: 375625 nosy: barry, equaeghe, r.david.murray priority: normal severity: normal status: open title: policy.max_line_length is incorrectly assumed to never be None type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 17:07:26 2020 From: report at bugs.python.org (Stefan Krah) Date: Tue, 18 Aug 2020 21:07:26 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1597784846.76.0.0488438747007.issue19521@roundup.psfhosted.org> Stefan Krah added the comment: The original patch is a bit dated, do we still need the export symbol generation? https://www.ibm.com/support/knowledgecenter/en/SSGH3R_16.1.0/com.ibm.xlcpp161.aix.doc/proguide/compiling_shared_aix.html "Use the -G option to create a shared library from the generated object files, and to enable runtime linking with applications that support it." "If you do not specify a -bE option, all the global symbols are exported except for those symbols that have the hidden or internal visibility attribute." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 17:10:01 2020 From: report at bugs.python.org (David Edelsohn) Date: Tue, 18 Aug 2020 21:10:01 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1597785001.81.0.935814610416.issue19521@roundup.psfhosted.org> David Edelsohn added the comment: Yes, export file generation still is required. Python does not need to utilize runtime linking. Using -G is a very bad choice and severely discouraged with severe performance and other penalties. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 17:50:43 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 18 Aug 2020 21:50:43 +0000 Subject: [issue39345] Py_Initialize Hangs on Windows 10 In-Reply-To: <1579114556.26.0.996943969176.issue39345@roundup.psfhosted.org> Message-ID: <1597787443.8.0.683664279498.issue39345@roundup.psfhosted.org> Steve Dower added the comment: Are you able to capture a process dump at the hang? I haven't seen this anywhere else, and don't even know how to go about trying to reproduce it with this information - Py_Initialize is called by every single Python process, so there's something special about your situation that isn't obvious yet :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 18:11:22 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Aug 2020 22:11:22 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1597788682.58.0.855474913018.issue41483@roundup.psfhosted.org> Irit Katriel added the comment: I think it is unlikely that this change would make a measurable speedup (benchmarks would be needed to prove that it does). And even if it does, it's for the case where no target has been set, in which case the logger isn't doing anything anyway. Why is this a case worth optimizing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 18:26:58 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 18 Aug 2020 22:26:58 +0000 Subject: [issue23802] patch: __deepcopy__ memo dict argument usage In-Reply-To: <1427608901.41.0.0640545279461.issue23802@psf.upfronthosting.co.za> Message-ID: <1597789618.61.0.976612078967.issue23802@roundup.psfhosted.org> Irit Katriel added the comment: This seems resolved, can it be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 18:41:27 2020 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 18 Aug 2020 22:41:27 +0000 Subject: [issue23802] patch: __deepcopy__ memo dict argument usage In-Reply-To: <1427608901.41.0.0640545279461.issue23802@psf.upfronthosting.co.za> Message-ID: <1597790487.95.0.638076334578.issue23802@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 22:38:35 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Wed, 19 Aug 2020 02:38:35 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1597804715.03.0.802684779011.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: v0.5 had introduced minor mistakes + one hack [ was using master instead of slave to set window size ]. v0.6 removes all such mistakes. ---------- Added file: https://bugs.python.org/file49404/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 23:12:40 2020 From: report at bugs.python.org (Kyle Stanley) Date: Wed, 19 Aug 2020 03:12:40 +0000 Subject: [issue41577] Cannot use ProcessPoolExecutor if in a decorator? In-Reply-To: <1597771306.07.0.252837170253.issue41577@roundup.psfhosted.org> Message-ID: <1597806760.27.0.816159981046.issue41577@roundup.psfhosted.org> Kyle Stanley added the comment: Due to the way pickle works, it's not presently possible to serialize wrapped functions directly, at least not in a way that allows you to pass it to executor.submit() within the inner function (AFAICT). I'm also not certain what it would involve to provide that, or if it would be feasible to do so in a manner that would be backwards compatible. In the meantime, this is a decent work-around: ``` from concurrent import futures import random class PPEWrapper: def __init__(self, func, num_proc=4): self.fn = func self.num_proc = num_proc def __call__(self, *args, **kwargs): with futures.ProcessPoolExecutor() as executor: fs = [] for i in range(self.num_proc): fut = executor.submit(self.fn, *args, **kwargs) fs.append(fut) result = [] for f in futures.as_completed(fs): result.append(f.result()) return result def _get_random_int(): return random.randint(0, 100) # it's often quite useful anyways to have a parallel and non-parallel version # (for testing and devices that don't support MP) get_random_int = PPEWrapper(_get_random_int, num_proc=4) if __name__ == "__main__": result = get_random_int() print(result) ``` This doesn't allow you to use the decorator syntax, but it largely provides the same functionality. That being said, my familiarity with the pickle protocol isn't overly strong, so the above is mostly based on my own recent investigation. There could very well be a way to accomplish what you're looking for in a way that I was unable to determine. ---------- nosy: +aeros, alexandre.vassalotti, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 23:28:26 2020 From: report at bugs.python.org (Dima Tisnek) Date: Wed, 19 Aug 2020 03:28:26 +0000 Subject: [issue31861] add aiter() and anext() functions to operator module In-Reply-To: <1508851575.6.0.213398074469.issue31861@psf.upfronthosting.co.za> Message-ID: <1597807706.45.0.644316994542.issue31861@roundup.psfhosted.org> Dima Tisnek added the comment: Might as well re-target for 3.10 as 3.9 seems feature-complete now. ---------- versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 18 23:46:08 2020 From: report at bugs.python.org (Tim Peters) Date: Wed, 19 Aug 2020 03:46:08 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597808768.81.0.0493816911886.issue41513@roundup.psfhosted.org> Tim Peters added the comment: Here's a "correct rounding" fail for the add_on approach: xs = [16.000000000000004] * 9 decimal result = 48.00000000000001065814103642 which rounds to float 48.000000000000014 add_on result: 48.00000000000001 That's about 0.5000000000026 ulp too small - shocking ;-) The fsum approach got this one right, but has similar failures on other inputs of the same form; i.e., [i + ulp(i)] * 9 for various integers `i`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 01:00:59 2020 From: report at bugs.python.org (Tim Peters) Date: Wed, 19 Aug 2020 05:00:59 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597813259.64.0.857820021347.issue41513@roundup.psfhosted.org> Tim Peters added the comment: > That's about 0.5000000000026 ulp too small - shocking ;-) Actually, that's an illusion due to the limited precision of Decimal. The rounded result is exactly 1/2 ulp away from the infinitely precise result - it's a nearest/even tie case. To make analysis easy, just note that the mathematical hypot(*([x] * 9)) is exactly 3*x. For x = 16 + ulp(16), 3*x moves to a higher binade and has two trailing one bits. The last has to be rounded away, rounding up to leave the last retained bit even. Any source of error, no matter how tiny, can be enough so that doesn't happen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 01:31:42 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 19 Aug 2020 05:31:42 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1597815102.9.0.291965241562.issue41109@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- keywords: +patch pull_requests: +21034 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 01:46:00 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 19 Aug 2020 05:46:00 +0000 Subject: [issue41586] Allow to set pipe size on subprocess.Popen. Message-ID: <1597815960.69.0.196461399013.issue41586@roundup.psfhosted.org> New submission from Ruben Vorderman : Pipes block if reading from an empty pipe or when writing to a full pipe. When this happens the program waiting for the pipe still uses a lot of CPU cycles when waiting for the pipe to stop blocking. I found this while working with xopen. A library that pipes data into an external gzip process. (This is more efficient than using python's gzip module, because the subprocess escapes the GIL, so your main algorithm can fully utilize one CPU core while the compression is offloaded to another). It turns out that increasing the pipe size on Linux from the default of 64KB to the maximum allowed pipe size in /proc/sys/fs/max-pipe-size (1024KB) drastically improves performance: https://github.com/marcelm/xopen/issues/35. TLDR: full utilization of CPU cores, a 40%+ decrease in wall-clock time and a 20% decrease in the number of compute seconds (indicating that 20% was wasted waiting on blocking pipes). However, doing this with subprocess is quite involved as it is now. 1. You have to find out which constants to use in fcntl for setting the pipesize (these constants are not in python). 2. You have to start the Popen process with routing stdout to subprocess.Pipe. 3. You have to get my_popen_process.stdout.fileno() 4. Use fcntl.fcntl to modify the pipe size. It would be much easier to do `subprocess.Popen(args, pipesize=1024 *1024)` for example. I am currently working on a PR implementing this. It will also make F_GETPIPE_SZ and F_SETPIPE_SZ available to the fcntl module. ---------- components: Library (Lib) messages: 375636 nosy: rhpvorderman priority: normal severity: normal status: open title: Allow to set pipe size on subprocess.Popen. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 02:09:55 2020 From: report at bugs.python.org (Prudent) Date: Wed, 19 Aug 2020 06:09:55 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597817395.9.0.508724339907.issue41574@roundup.psfhosted.org> Prudent added the comment: Sorry, I forget how I installed the old python 3.7.5, but I installed the new python 3.8.5 using the downloaded installer from Python.org. Besides, I checked the "Tcl" under the path: "/System/Library/Tcl", its version still is 8.5. I think my code used the library here, and this is the reason why the warning showed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 02:25:13 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 19 Aug 2020 06:25:13 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1597818313.6.0.684308839067.issue41109@roundup.psfhosted.org> Jeffrey Kintscher added the comment: I created a PR that should provide the desired behavior: __init__() and __new__() get called in subclass objects that are created by Path and PurePath. Also, Path and PurePath now have __init__() functions, and the __new__() functions only return new objects and rely upon __init__() to perform the object initialization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 02:37:57 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Wed, 19 Aug 2020 06:37:57 +0000 Subject: [issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__ In-Reply-To: <1593053483.35.0.664517914864.issue41109@roundup.psfhosted.org> Message-ID: <1597819077.15.0.962724154936.issue41109@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 03:34:18 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 19 Aug 2020 07:34:18 +0000 Subject: [issue41586] Allow to set pipe size on subprocess.Popen. In-Reply-To: <1597815960.69.0.196461399013.issue41586@roundup.psfhosted.org> Message-ID: <1597822458.75.0.799823382257.issue41586@roundup.psfhosted.org> Change by Ruben Vorderman : ---------- keywords: +patch pull_requests: +21035 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 04:32:09 2020 From: report at bugs.python.org (Eric Wieser) Date: Wed, 19 Aug 2020 08:32:09 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1597825929.13.0.958398449428.issue41584@roundup.psfhosted.org> Change by Eric Wieser : ---------- nosy: +Eric Wieser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 05:00:03 2020 From: report at bugs.python.org (Fieschi) Date: Wed, 19 Aug 2020 09:00:03 +0000 Subject: [issue39345] Py_Initialize Hangs on Windows 10 In-Reply-To: <1579114556.26.0.996943969176.issue39345@roundup.psfhosted.org> Message-ID: <1597827603.56.0.89220958105.issue39345@roundup.psfhosted.org> Fieschi added the comment: Personally, I have the same problem of Py_Initialize() hanging indefinitely. Here is the context in which it happens : I am developing an application in Java, in which I use the library jep (https://github.com/ninia/jep), that enables me to get a Python interpreter from Java, and I am developing and testing it on Windows. My Python version is 3.8.2 and I am on Windows 10 - version 1903. When I test this library outside my app in a simple Java project, everything works fine, and the interpreter works. But when I try to use it in the app, it hangs indefinitely when I create the interpreter. When I digged into the code of the library, I found out that it occurs in the native code of jep, during the call to Py_Initialize(). I posted an issue on the github of jep, and they brought me here. I bet this is related to stdin and stdout when I see what dhamilton posted. My Java's stdout is normal and writes in the console. I tried to reset or redirect Java's stdin an stdout, but it doesn't change nothing. And when I try to do this on Linux (my application is also on Linux), on Ubuntu 16, everything works fine and it doesn't hang indefinitely. So this only happens on Windows. About capturing a process dump, all I can get is a message displayed on the Java console when I close the app (because it hangs indefinitely) : # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000302b9d8f, pid=11960, tid=0x0000000000003f98 # # JRE version: Java(TM) SE Runtime Environment (8.0_241-b07) (build 1.8.0_241-b07) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.241-b07 mixed mode windows-amd64 compressed oops) # Problematic frame: # C 0x00000000302b9d8f # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # The crash happened outside the Java Virtual Machine in native code. All of this is just my personal case, and it's probably not the same for dhamilton. I hope it helped you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 05:02:47 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Aug 2020 09:02:47 +0000 Subject: [issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL In-Reply-To: <1534298908.58.0.56676864532.issue34410@psf.upfronthosting.co.za> Message-ID: <1597827767.32.0.198681296624.issue34410@roundup.psfhosted.org> Irit Katriel added the comment: This seems resolved, can it be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 05:16:21 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Aug 2020 09:16:21 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597828581.67.0.964847185553.issue41574@roundup.psfhosted.org> Ronald Oussoren added the comment: the version of Tk in /System is not relevant, as I wrote the Tkinter in the Python.org installer uses a copy of Tcl/Tk that's installed by the Python.org installer (somewhere in /Library/Frameworks/Python.framework). This can be checked using the otool(1) command: $ otool -vL /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_tkinter.cpython-38-darwin.so: /Library/Frameworks/Python.framework/Versions/3.8/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.8) /Library/Frameworks/Python.framework/Versions/3.8/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.8) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) As you can see _tkinter is linked with Tcl/Tk 8.6 inside the Python framework. I'm also using the Python.org installer (although the system I tested on has a slightly out of date copy of Python 3.8) and don't get this warning. That might be because I've been testing something different from what you're doing. Could you attach a script that demonstrates the problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 05:49:29 2020 From: report at bugs.python.org (=?utf-8?b?5p2O6LaF54S2?=) Date: Wed, 19 Aug 2020 09:49:29 +0000 Subject: [issue41587] Potential memory leak while using shared memory Message-ID: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> New submission from ??? : We find an issue while using shared memory. When opening another process to overwrite the shared memory, the memory of this process will increase to about the size of this shared memory. So when several processes try to read or write the shared memory, there will be N times memory usage. ``` import os, psutil import numpy as np from multiprocessing import Process, shared_memory SHM_SIZE = 100000 * 30 * 20 def f(name): print('[Sub] (Before) Used Memory of {}: {} MiB'.format( os.getpid(), psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024, )) shm = shared_memory.SharedMemory(name=name) b = np.ndarray(shape=(SHM_SIZE, 1), dtype=np.float64, buffer=shm.buf) for i in range(SHM_SIZE): b[i, 0] = 1 print('[Sub] (After) Used Memory of {}: {} MiB'.format( os.getpid(), psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024, )) def main(): print('[Main] Used Memory of {}: {} MiB'.format( os.getpid(), psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024, )) shm = shared_memory.SharedMemory(create=True, size=8*SHM_SIZE, name='shm') p = Process(target=f, args=('shm',)) p.start() p.join() print('[Main] Used Memory of {}: {} MiB'.format( os.getpid(), psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024, )) input() shm.close() shm.unlink() if __name__ == '__main__': main() ``` ---------- components: Library (Lib) messages: 375642 nosy: seraphlivery priority: normal severity: normal status: open title: Potential memory leak while using shared memory type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 06:03:03 2020 From: report at bugs.python.org (Prudent) Date: Wed, 19 Aug 2020 10:03:03 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597831383.97.0.126764327664.issue41574@roundup.psfhosted.org> Prudent added the comment: Sorry, maybe I missed to share a critical point that I wrote Python codes using ?VS Code? software, rather than IDEL. That warning only showed in VS Code software when I ran it. After I re-opened my code in IDEL and ran it again. No any warnings or errors existed at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 07:40:35 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 19 Aug 2020 11:40:35 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597837235.39.0.281812388856.issue41574@roundup.psfhosted.org> Ronald Oussoren added the comment: Weird. Maybe VS Code uses a different Python installation? You can add "import sys; print(sys.prefix)" to your script to check. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 08:22:22 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 19 Aug 2020 12:22:22 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1597839742.43.0.250242585869.issue41584@roundup.psfhosted.org> Vedran ?a?i? added the comment: Yes, there is a corner case here. If A derives from B and B derives from C, A doesn't implement __rsub__ and B does, A()-C() will call B's __rsub__. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 08:26:32 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 19 Aug 2020 12:26:32 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1597839992.47.0.487670759943.issue41584@roundup.psfhosted.org> Vedran ?a?i? added the comment: Sorry, of course I meant C()-A(). The point is that the class A _doesn't_ have to implement __rsub__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 09:55:15 2020 From: report at bugs.python.org (Or Yahalom) Date: Wed, 19 Aug 2020 13:55:15 +0000 Subject: [issue41588] Potential Memory leak with concurrent.futures.ThreadPoolExecutor's map Message-ID: <1597845315.75.0.199249722825.issue41588@roundup.psfhosted.org> New submission from Or Yahalom : I've been debugging a high memory consumption in one of my scripts and traced it back to the `concurrent.futures.ThreadPoolExecutor`. When further investigating and playing around, I found out that when using `concurrent.futures.ThreadPoolExecutor` with the map function, and passing a dictionary to the map's function as an argument, the memory used by the pool won't be freed and as a result the total memory consumption will continue to rise. (Seems like it also happens when passing a list and maybe even other types). Here is an example of a code to recreate this issue: ``` #!/usr/bin/env python3 import os import time import psutil import random import concurrent.futures from memory_profiler import profile as mem_profile p = psutil.Process(os.getpid()) def do_magic(values): return None @mem_profile def foo(): a = {i: chr(i) for i in range(1024)} with concurrent.futures.ThreadPoolExecutor(max_workers=10) as pool: proccessed_data = pool.map(do_magic, a) def fooer(): while True: foo() time.sleep(1) fooer() ``` ---------- components: Extension Modules messages: 375647 nosy: or12 priority: normal severity: normal status: open title: Potential Memory leak with concurrent.futures.ThreadPoolExecutor's map type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 10:01:09 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 Aug 2020 14:01:09 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597845669.7.0.239530009693.issue41587@roundup.psfhosted.org> Eric V. Smith added the comment: It's likely that the same memory is being counted by both processes, to the output is misleading. Shared memory is notoriously difficult to allocate per-process. For example, it's definitely true that the shared memory is consuming virtual address space in both processes. That's often the value that's reported. But since the actual memory is shared, it's not consuming more physical memory than expected. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 10:45:08 2020 From: report at bugs.python.org (=?utf-8?b?5p2O6LaF54S2?=) Date: Wed, 19 Aug 2020 14:45:08 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597848308.9.0.519844229416.issue41587@roundup.psfhosted.org> ??? added the comment: You mean if I have a machine that has 16GB RAM, and the maximum shared memory size is 8GB. I then create two processes to write to this shared memory, and the system won't run out of memory. Is it right? I can try this experiment later on. But I can not understand this. I can see this memory increment in `htop`. I think the memory stat from `htop` is correct, otherwise, any system monitor software could deliver a fake warning message about the memory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 10:50:29 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 Aug 2020 14:50:29 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597848629.47.0.0558049973736.issue41587@roundup.psfhosted.org> Eric V. Smith added the comment: You'll have to play with it. I'm just saying that it's a very complicated subject, and not as simple as asking how much memory an individual process is using. For example, see https://www.howtogeek.com/659529/how-to-check-memory-usage-from-the-linux-terminal/ for the many statistics that are involved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 11:10:54 2020 From: report at bugs.python.org (Tim Peters) Date: Wed, 19 Aug 2020 15:10:54 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597849854.95.0.491526837042.issue41513@roundup.psfhosted.org> Tim Peters added the comment: Here's an amusing cautionary tale: when looking at correct-rounding failures for the fsum approach, I was baffled until I realized it was actually the _decimal_ method that was failing. Simplest example I have is 9 instances of b=4.999999999999999, which is 1 ulp less than 5. Of course the best-possible hypot is 3*b rounded, but that's not what default decimal precision computes (when rounded back). In fact, it bounces between "off by 1" and "correct" until decimal precision exceeds 96: >>> pfailed = [] >>> for p in range(28, 300): ... with decimal.localcontext() as c: ... c.prec = p ... if float(sum([decimal.Decimal(b) ** 2] * 9).sqrt()) != 3*b: ... pfailed.append(p) >>> pfailed [28, 29, 30, 31, 34, 36, 37, 39, 41, 42, 43, 44, 45, 57, 77, 96] In a nutshell, it takes in the ballpark of 50 decimal digits to represent b exactly, then twice as many to represent its square exactly, then another to avoid losing a digit when summing 9 of those. So if decimal prec is less than about 100, it can lose info. So the fsum method is actually more reliable (it doesn't lose any info until the fsum step). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 11:14:27 2020 From: report at bugs.python.org (=?utf-8?b?5p2O6LaF54S2?=) Date: Wed, 19 Aug 2020 15:14:27 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597850067.96.0.297214762688.issue41587@roundup.psfhosted.org> ??? added the comment: Okay. I know this is complicated. So how can I make sure this is not an issue? Can you provide some steps or a bash script to prove that the memory increment issue does not exist? I'm now not being persuaded because I don't know how to prove there is no issue about the memory. Will the experiment in the last message prove it? Or maybe you can provide an simple example showing there is no memory issue. Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 11:16:39 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Aug 2020 15:16:39 +0000 Subject: [issue41585] policy.max_line_length is incorrectly assumed to never be None In-Reply-To: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org> Message-ID: <1597850199.74.0.69042473032.issue41585@roundup.psfhosted.org> Irit Katriel added the comment: Are you able to post a script that reproduces the issue? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 11:45:30 2020 From: report at bugs.python.org (Alexander Boeckmann) Date: Wed, 19 Aug 2020 15:45:30 +0000 Subject: [issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs In-Reply-To: <1588884932.92.0.367303002443.issue40553@roundup.psfhosted.org> Message-ID: <1597851930.36.0.807870641211.issue40553@roundup.psfhosted.org> Alexander Boeckmann added the comment: Hey! I have the exact same thing as described happening! Python freezes when I try to save new files which sucks. I'm on Catalina: 10.15.6 IDLE: 3.8.5 Brand new MacBook Air As said earlier the only way out is to force quit. Would taking a video help? I'll make one anyways ---------- nosy: +aboeckmann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 12:08:07 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 Aug 2020 16:08:07 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597853287.35.0.464043409199.issue41587@roundup.psfhosted.org> Eric V. Smith added the comment: Sorry, I don't have any particular suggestion other than accounting for all virtual, shared, and physical memory of all types, and seeing how they're being used and allocated per-process by the various tools. There are probably guides for this on the internet, but I haven't been able to find any with a quick search. I'm not saying there isn't a problem, but I'm saying it's going to require more analysis before we can verify that a problem does exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 12:13:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Aug 2020 16:13:54 +0000 Subject: [issue41568] test_zoneinfo leaked [84, 84, 84] references In-Reply-To: <1597674693.07.0.000622636153165.issue41568@roundup.psfhosted.org> Message-ID: <1597853634.64.0.884044641275.issue41568@roundup.psfhosted.org> STINNER Victor added the comment: https://buildbot.python.org/all/#/builders/84 is back to green, I close the issue. ---------- nosy: +vstinner resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 12:14:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Aug 2020 16:14:21 +0000 Subject: [issue41025] C implementation of ZoneInfo cannot be subclassed In-Reply-To: <1592490411.18.0.433446521396.issue41025@roundup.psfhosted.org> Message-ID: <1597853661.3.0.121597538269.issue41025@roundup.psfhosted.org> STINNER Victor added the comment: > test_zoneinfo leaked [84, 84, 84] references, sum=252 Reported as bpo-41568 and fixed there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 12:28:55 2020 From: report at bugs.python.org (=?utf-8?b?5p2O6LaF54S2?=) Date: Wed, 19 Aug 2020 16:28:55 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597854535.35.0.952030463307.issue41587@roundup.psfhosted.org> ??? added the comment: Sorry, I don't know what I can do about it. In my perspective, I think there is a memory leak because monitor software have provided proof for me to believe that. I have provided a script to reproduce this issue. I think that is enough for developers to conduct other tests to verify whether this issue does exist. I don't think I can provide any more information since you can reproduce this problem. As a user, I just need some advice about how to fix this issue or confirmation about this issue, or some explanations that make me believe that there is no issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 12:58:30 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 Aug 2020 16:58:30 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597856310.85.0.146864618029.issue41587@roundup.psfhosted.org> Eric V. Smith added the comment: Okay. We'll see if someone else can provide more info. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 13:18:37 2020 From: report at bugs.python.org (browser.365) Date: Wed, 19 Aug 2020 17:18:37 +0000 Subject: [issue41589] Strange behavior with sparse.dok_matrix decimal is cast to integer Message-ID: <1597857517.39.0.5072524691.issue41589@roundup.psfhosted.org> New submission from browser.365 : import numpy as np from scipy import sparse import decimal D = decimal.Decimal Al = sparse.dok_matrix((10, 10), dtype=np.dtype(D)) Al.astype(D) Al[1,1] = D('0.1') print(Al[1,1]) print(type(Al[1,1])) Al[0,0] = D('0') print(Al[0,0]) print(type(Al[0,0])) z = decimal.Decimal('0') print(z) print(type(z)) print(' - ') Running the above code gives: 0.1 0 0 - All of the elements should be decimal. ---------- messages: 375660 nosy: browser.365 priority: normal severity: normal status: open title: Strange behavior with sparse.dok_matrix decimal is cast to integer type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 13:25:34 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Aug 2020 17:25:34 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597857934.08.0.804323458702.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8f88190af529543c84d5dc78f19abbfd73335cf4 by Victor Stinner in branch '3.9': [3.9] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901) https://github.com/python/cpython/commit/8f88190af529543c84d5dc78f19abbfd73335cf4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 13:33:13 2020 From: report at bugs.python.org (email0.ya) Date: Wed, 19 Aug 2020 17:33:13 +0000 Subject: [issue41590] "zip()" very slowly for this Message-ID: <1597858393.53.0.732585687531.issue41590@roundup.psfhosted.org> New submission from email0.ya : https://docs.python.org/3.9/tutorial/datastructures.html Nested List Comprehensions ---------- assignee: docs at python components: Documentation files: nested_lists.py messages: 375662 nosy: docs at python, email0.ya priority: normal severity: normal status: open title: "zip()" very slowly for this type: performance versions: Python 3.9 Added file: https://bugs.python.org/file49405/nested_lists.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 13:34:17 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Aug 2020 17:34:17 +0000 Subject: [issue26332] OSError: exception: access violation writing <...> (Windows 10 x64, Python 3.5.1) In-Reply-To: <1455129398.68.0.407875580594.issue26332@psf.upfronthosting.co.za> Message-ID: <1597858457.77.0.0258589384732.issue26332@roundup.psfhosted.org> Irit Katriel added the comment: Access violation is a very general error which means that a bad pointer was dereferenced in c++. This can happen in many ways. You need to provide a way to reproduce this error in order to make this an actual bug report. In your case, it is happening when you call a function in a third party library, which could mean that this library has a bug or that you are passing bad parameters to it. If you cannot provide more information than what is here, this ticket should be closed on the basis that there is not enough information do anything about the issue. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 13:34:31 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 19 Aug 2020 17:34:31 +0000 Subject: [issue41589] Strange behavior with sparse.dok_matrix decimal is cast to integer In-Reply-To: <1597857517.39.0.5072524691.issue41589@roundup.psfhosted.org> Message-ID: <1597858471.32.0.472459518617.issue41589@roundup.psfhosted.org> Eric V. Smith added the comment: This seems like a scipy or numpy issue, not a Python bug. You might have better luck asking about this behavior on a scipy or numpy forum of some kind, or maybe on Stackoverflow. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 13:40:02 2020 From: report at bugs.python.org (Walid Taha) Date: Wed, 19 Aug 2020 17:40:02 +0000 Subject: [issue41591] Comprehensions documentation Message-ID: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> New submission from Walid Taha : The documentation for list comprehensions contains the following phrase: "As we saw in the previous section, the nested listcomp is evaluated in the context of the for that follows it, so this example is equivalent to:" This should be corrected, as it currently contradicts what was said previously, which is that list comprehensions and the conditional they contain are scoped in the same order as they appear (rather than the reverse). This issue can be found on this page: https://docs.python.org/3/tutorial/datastructures.html It also seems to appear in the most recent version: https://docs.python.org/3.10/tutorial/datastructures.html To confirm that the first (and not the second statement) is correct, you may consider the following code: l=[] for x in range(0,3): for y in range (0,x+1): l.append((x,y)) print(l) l=[(x,y) for x in range (0,3) for y in range (0,x+1)] print(l) Which run on 3.7.5 produces the following output [(0, 0), (1, 0), (1, 1), (2, 0), (2, 1), (2, 2)] [(0, 0), (1, 0), (1, 1), (2, 0), (2, 1), (2, 2)] ---------- assignee: docs at python components: Documentation messages: 375665 nosy: docs at python, wtaha priority: normal severity: normal status: open title: Comprehensions documentation versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 14:08:20 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 19 Aug 2020 18:08:20 +0000 Subject: [issue41590] "zip()" very slowly for this In-Reply-To: <1597858393.53.0.732585687531.issue41590@roundup.psfhosted.org> Message-ID: <1597860500.09.0.171964101267.issue41590@roundup.psfhosted.org> Steven D'Aprano added the comment: What are you actually reporting? What part of the documentation do you think should be changed, why should it be changed, and what should it be changed to? It is normal for different algorithms to perform with different speed. I'm not sure what the purpose of the "nested_lists" file is. You have discovered that different programs perform differently. Okay. What do you want us to do? One last comment: using time() as you did is unreliable, especially for small code snippets that are very fast. The best way to time small snippets of Python code is to use the timeit module. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 14:10:05 2020 From: report at bugs.python.org (Tim Peters) Date: Wed, 19 Aug 2020 18:10:05 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597860605.0.0.216616652072.issue41587@roundup.psfhosted.org> Tim Peters added the comment: There's no evidence of a Python issue here, so I recommend closing this. It's not the Python bug tracker's job to try to make sense of platform-specific reporting tools, which, as already explained, can display exceedingly confusing numbers. We (the Python project) didn't write them, have no control over what they display, and have no special insight into them. Here's a similar simple program that creates a 4 GiB block of shared memory, and passes it to 16 processes. I'm running this on Windows 10, on a machine with 4 physical cores and 16 GiB of RAM. If the memory weren't actually being shared, Windows would have killed the job (there's no "over allocation" allowed at all on Windows), because there's nowhere near 4 * 17 = 68 GiB of RAM available. Instead, the program brings the machine to its knees, but because it created 16 processes each of which is 100% CPU- and memory-bound. The Windows task manager detailed view shows less than a MiB of non-shared memory in use by each of the worker processes, with the 4 GiB in the "memory in use that can be shared with other processes" column for each worker process. I'm running lots of other stuff too, and Windows still says there's over 5 GiB of my 16 GiB of RAM free for use. Windows reporting has its own quirks. For example, the shared memory block doesn't show up at all in the workers at first. Instead the amount reported steadily increases, as the write loop in each worker process forces the OS to materialize shared pages in the worker's virtual address space (that is, Windows reports pages actually in use by a process, not virtual address space reservations). from multiprocessing import Process, shared_memory SHM_SIZE = 2 ** 32 # 4 GiB def f(name): shm = shared_memory.SharedMemory(name=name) print(f"shm of size {shm.size:,}") buf = shm.buf for i in range(shm.size): buf[i] = 123 shm.close() def main(): shm = shared_memory.SharedMemory(create=True, size=SHM_SIZE, name='shm') ps = [] for i in range(16): p = Process(target=f, args=('shm',)) p.start() ps.append(p) for p in ps: p.join() shm.close() shm.unlink() if __name__ == '__main__': main() ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 14:37:37 2020 From: report at bugs.python.org (Brett Cannon) Date: Wed, 19 Aug 2020 18:37:37 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1597862257.84.0.391167906242.issue41584@roundup.psfhosted.org> Brett Cannon added the comment: Right, there is a `lhs.__rsub__ is not rhs.__rsub__` check which needs to be clearly communicated in that note. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 14:53:55 2020 From: report at bugs.python.org (=?utf-8?b?5p2O6LaF54S2?=) Date: Wed, 19 Aug 2020 18:53:55 +0000 Subject: [issue41587] Potential memory leak while using shared memory In-Reply-To: <1597830569.16.0.0101746791101.issue41587@roundup.psfhosted.org> Message-ID: <1597863235.36.0.181260959624.issue41587@roundup.psfhosted.org> ??? added the comment: Thank you Tim Peters for replying to me. I tried your demo and it is a proof exactly I want. It did prove that there is no memory issue. And I tried to modify my own code and showed the same result. I will close this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 15:01:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 19 Aug 2020 19:01:12 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597863672.53.0.8771442626.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21036 pull_request: https://github.com/python/cpython/pull/21924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 15:21:34 2020 From: report at bugs.python.org (Eric Pederson) Date: Wed, 19 Aug 2020 19:21:34 +0000 Subject: [issue41592] Make _SubParsersAction public Message-ID: <1597864894.48.0.159581898725.issue41592@roundup.psfhosted.org> New submission from Eric Pederson : ArgumentParser.add_subparsers() returns a _SubParsersAction. This requires user code using type annotations to use a protected type which causes type checkers like PyCharm to complain. For example: def add_subparser(name: str, subparser: _SubParsersAction, subparsers: dict) -> ArgumentParser: parser = subparser.add_parser(name) parser.add_argument('-v', '--verbose', action='store_true') subparsers[name] = parser return parser You can't use plain Action because Action doesn't have the add_parser() method. ---------- components: Library (Lib) messages: 375670 nosy: sourcedelica priority: normal severity: normal status: open title: Make _SubParsersAction public type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 15:30:55 2020 From: report at bugs.python.org (Mika Hawkins) Date: Wed, 19 Aug 2020 19:30:55 +0000 Subject: [issue41502] Option for Colored Logging in http.server Module In-Reply-To: <1596805896.61.0.531750689021.issue41502@roundup.psfhosted.org> Message-ID: <1597865455.65.0.0136866747127.issue41502@roundup.psfhosted.org> Mika Hawkins added the comment: Yes I totally agree that it would be useful if the http.server module had an option for colored logging, That would be extremly helpful/useful. Thank you for putting that in... ---------- nosy: +Mika_Hawkins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 16:09:48 2020 From: report at bugs.python.org (email0.ya) Date: Wed, 19 Aug 2020 20:09:48 +0000 Subject: [issue41590] "zip()" very slowly for this In-Reply-To: <1597858393.53.0.732585687531.issue41590@roundup.psfhosted.org> Message-ID: <1597867788.25.0.0907426291326.issue41590@roundup.psfhosted.org> email0.ya added the comment: Above is a link to part of the tutorial. An example with a for statement at the beginning is good. I am not saying that it needs to be replaced with something. The above example reads: "A list comprehension consists of brackets containing an expression followed by a for clause, then zero or more for or if clauses". ________________________________ def transpose1_3_1 (a: list) -> list: "" "Transpose matrix version 1.3.1" "" max_j = len (max (a)) return [ [row [j] if j _______________________________________ From report at bugs.python.org Wed Aug 19 16:19:29 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 19 Aug 2020 20:19:29 +0000 Subject: [issue41590] "zip()" very slowly for this In-Reply-To: <1597858393.53.0.732585687531.issue41590@roundup.psfhosted.org> Message-ID: <1597868369.19.0.434007982278.issue41590@roundup.psfhosted.org> Vedran ?a?i? added the comment: First, what you wrote with if...else is _not_ "if clause". It's a conditional expression. You'll recognize them easily if you remember that "if clause" in comprehensions never has an "else", while conditional expression always does. Second, speed is just one of many, many criteria by which we evaluate programs. If only speed matters to you, you probably shouldn't be writing in Python at all. There are much faster languages. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 16:24:38 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 19 Aug 2020 20:24:38 +0000 Subject: [issue41590] "zip()" very slowly for this In-Reply-To: <1597858393.53.0.732585687531.issue41590@roundup.psfhosted.org> Message-ID: <1597868678.22.0.693698559619.issue41590@roundup.psfhosted.org> Vedran ?a?i? added the comment: Third, where did you get the idea that transposing a "matrix" consisting of lists of varying length is a sensible operation? Your reference (Wikipedia) tells nothing about that case. I've never seen [[],[1]] called "a matrix". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 16:39:43 2020 From: report at bugs.python.org (Raphael Grewe) Date: Wed, 19 Aug 2020 20:39:43 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars In-Reply-To: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> Message-ID: <1597869583.41.0.236864838532.issue41550@roundup.psfhosted.org> Raphael Grewe added the comment: I used SimpleQueue on purpose because I only need the functions get and put. Of course I could also use Queue but that would be just a workaround for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 17:01:27 2020 From: report at bugs.python.org (Irit Katriel) Date: Wed, 19 Aug 2020 21:01:27 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars In-Reply-To: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> Message-ID: <1597870887.72.0.927790025747.issue41550@roundup.psfhosted.org> Irit Katriel added the comment: The get and put functions of Queue have the optional 'block' and 'timeout' args that you need, and SimpleQueue doesn't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 18:28:29 2020 From: report at bugs.python.org (leonyxz) Date: Wed, 19 Aug 2020 22:28:29 +0000 Subject: [issue41593] pathlib PermissionError problem Message-ID: <1597876109.8.0.763662606664.issue41593@roundup.psfhosted.org> New submission from leonyxz : python 3.x FreeBSD 11.3-RELEASE-p12 with custom settings mentioned later. On vanilla configuration of FreeBSD there is no issue. Installation of FreeBSD in question has mac_bsdextended turned on (https://www.freebsd.org/cgi/man.cgi?query=mac_bsdextended&sektion=4&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports) Using ugidfw (https://www.freebsd.org/cgi/man.cgi?query=ugidfw&sektion=8&manpath=freebsd-release-ports), the following rule has been set: --------------------------------------------------------------- 0 subject not uid root gid nobody object gid wheel type d mode sx --------------------------------------------------------------- The following code shows the minimal reproducible example: --------------------------------------------------------------- from pathlib import Path BASE_DIR = Path(__file__).resolve(strict=True).parent.parent print(BASE_DIR) --------------------------------------------------------------- Running the code directly works: --------------------------------------------------------------- $ python test.py /usr/home/example --------------------------------------------------------------- But importing it as a module does not: --------------------------------------------------------------- $ python -m test Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/home/example/django_3136test/test.py", line 2, in BASE_DIR = Path(__file__).resolve(strict=True).parent.parent File "/usr/local/lib/python3.6/pathlib.py", line 1141, in resolve s = self._flavour.resolve(self, strict=strict) File "/usr/local/lib/python3.6/pathlib.py", line 346, in resolve return _resolve(base, str(path)) or sep File "/usr/local/lib/python3.6/pathlib.py", line 330, in _resolve target = accessor.readlink(newpath) File "/usr/local/lib/python3.6/pathlib.py", line 440, in readlink return os.readlink(path) PermissionError: [Errno 13] Permission denied: '/usr' --------------------------------------------------------------- The issue seems to be comnected with following piece code https://github.com/python/cpython/blob/master/Lib/pathlib.py#L342-L346 --------------------------------------------------------------- try: target = accessor.readlink(newpath) except OSError as e: if e.errno != EINVAL and strict: raise # Not a symlink, or non-strict mode. We just leave the path # untouched. path = newpath --------------------------------------------------------------- With ugidfw enabled, `os.readlink` raises a `PermissionError`, which is unhandled by pathlib. ---------- components: FreeBSD, Library (Lib) messages: 375677 nosy: koobs, leonyxz priority: normal severity: normal status: open title: pathlib PermissionError problem versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 18:58:25 2020 From: report at bugs.python.org (Julia Frances) Date: Wed, 19 Aug 2020 22:58:25 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597877905.53.0.0899255588239.issue41566@roundup.psfhosted.org> Julia Frances added the comment: welcome to python.org in this website there are many ways to do python coding. You need to follow the guide and the rules on how to do python coding. ---------- hgrepos: +392 keywords: +patch message_count: 8.0 -> 9.0 nosy: +jfrances21 nosy_count: 3.0 -> 4.0 pull_requests: +21037 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 19:17:40 2020 From: report at bugs.python.org (JustAnotherArchivist) Date: Wed, 19 Aug 2020 23:17:40 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1597879060.0.0.835481745208.issue18233@roundup.psfhosted.org> Change by JustAnotherArchivist : ---------- nosy: +JustAnotherArchivist _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 19:50:54 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 19 Aug 2020 23:50:54 +0000 Subject: [issue41590] "zip()" very slowly for this In-Reply-To: <1597867788.25.0.0907426291326.issue41590@roundup.psfhosted.org> Message-ID: <20200819235002.GZ23924@ando.pearwood.info> Steven D'Aprano added the comment: If you know about timeit, why aren't you using it? In any case, I have just ran your nested_lists.py file, and on my computer, the last version with zip is the fastest version: 0 transpose1_0(lT) Time = 1.0627508163452149e-05 7 zip(*lT) Time = 1.5511512756347657e-06 1.55e-6 is smaller than 1.06e-5: py> 1.55e-6 < 1.06e-5 True Smaller times are faster, and the first version transpose1_0 takes nearly seven times longer to run than the last version with zip. As for the other comments, the purpose of the tutorial is to teach the language in the simplest way possible. It is aimed at beginners, not intermediate or expert programmers. The purpose of this section is to demonstrate the basic features of list comprehensions, not to overwhelm the beginner with complicated details. Making the example more complicated so that it is a tiny bit faster would not a good tradeoff for the tutorial, but in fact all the more complicated versions are slower, not faster. You are also confused about the structure of comprehensions. The comprehension consists of expression-part for-part (optional for- and if-parts) There is no else-part in the comprehension, and the for-part always comes before any if-part. Your code: row[j] if j < len(row) else 0 is not an "if statement" as you call it, neither is it part of the comprehension syntax. It is the expression-part of the comprehension, containing a ternary if-expression. It is not part of the structure of the comprehension. See the full language specification, in particular the grammar: https://docs.python.org/3.9/reference/grammar.html We could re-write the if-expression like this: (j < len(row)) and row[j] or 0 That doesn't mean that comprehensions consist of an "and" part followed by an "or" part followed by a for-part. The "and" and "or" are just part of the expression part of the comprehension. Adding this level of technical detail and complexity to an introductory tutorial aimed at beginners would not be a good idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 20:24:11 2020 From: report at bugs.python.org (Kyle Meyer) Date: Thu, 20 Aug 2020 00:24:11 +0000 Subject: [issue41594] Intermittent failures of loop.subprocess_exec() to capture output Message-ID: <1597883051.54.0.163691000969.issue41594@roundup.psfhosted.org> New submission from Kyle Meyer : I've been debugging an intermittent test failure in code that calls `loop.subprocess_exec` with an `asyncio.SubprocessProtocol` subclass. Here's a minimal example that I hope captures the issue. It's based closely off of the `DateProtocol` [example][1] in the asyncio protocol documentation. import asyncio class Protocol(asyncio.SubprocessProtocol): def __init__(self, exit_future): self.exit_future = exit_future self.output = bytearray() def pipe_data_received(self, fd, data): self.output.extend(data) def process_exited(self): self.exit_future.set_result(True) async def get_stdout(): loop = asyncio.get_running_loop() exit_future = asyncio.Future(loop=loop) transport, protocol = await loop.subprocess_exec( lambda: Protocol(exit_future), "printf", "ok", stdin=None, stderr=None) await exit_future transport.close() return bytes(protocol.output) The attached script adds some debugging statements to what's above and then repeats the specified number of calls to `asyncio.run(get_stdout())`, aborting if `asyncio.run(get_stdout())` returns an empty byte string rather then the expected `b'ok'`. With Python 3.7.3 on a Debian system, I see occasional aborts. For example, after two runs of the script with no unexpectedly empty output, I saw $ python3 reproducer.py 500 Iteration: 32 of 500 Failed on iteration 32 logfile: /tmp/asyncio-debug-bqehu8f3.log $ tail /tmp/asyncio-debug-bqehu8f3.log DEBUG: process_exited() called DEBUG: Starting iteration 31 DEBUG: Using selector: EpollSelector DEBUG: pipe_data_received(): fd=1, data=b'ok' DEBUG: process_exited() called DEBUG: Starting iteration 32 DEBUG: Using selector: EpollSelector DEBUG: process_exited() called DEBUG: pipe_data_received(): fd=1, data=b'ok' DEBUG: Failed on iteration 32 Based on the debug statements, it looks like `pipe_data_received` does get called with the output for the run that comes up empty, but only after `process_exited` is called. On my first try with a python built from a recent commit (0be7c216e1), I triggered the failure: $ python -V Python 3.10.0a0 $ python reproducer.py 500 Iteration: 8 of 500 Failed on iteration 8 logfile: /tmp/asyncio-debug-m5fba4ga.log $ tail /tmp/asyncio-debug-m5fba4ga.log DEBUG: process_exited() called DEBUG: Starting iteration 7 DEBUG: Using selector: EpollSelector DEBUG: pipe_data_received(): fd=1, data=b'ok' DEBUG: process_exited() called DEBUG: Starting iteration 8 DEBUG: Using selector: EpollSelector DEBUG: process_exited() called DEBUG: pipe_data_received(): fd=1, data=b'ok' DEBUG: Failed on iteration 8 As I'm following the example from the documentation closely, I hope I'm not committing a silly error that leads to an expected race here. [1]: https://docs.python.org/3/library/asyncio-protocol.html#loop-subprocess-exec-and-subprocessprotocol ---------- components: asyncio files: reproducer.py messages: 375680 nosy: asvetlov, kyleam, yselivanov priority: normal severity: normal status: open title: Intermittent failures of loop.subprocess_exec() to capture output type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49406/reproducer.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 20:39:50 2020 From: report at bugs.python.org (Maarten) Date: Thu, 20 Aug 2020 00:39:50 +0000 Subject: [issue41595] curses' window.chgat does not change color when specifying curses.A_COLOR Message-ID: <1597883990.64.0.646746547163.issue41595@roundup.psfhosted.org> New submission from Maarten : Or'ing curses.A_COLOR in the `attr` argument of curses.window.chgat ends of with the line not showing. Actual Problem: The text is invisible/hidden/not shown. Using only the attribute curses.A_BLINK is fine. Expected: The color of the line is changed +the text starts blinking. I have attached a small python reproducer and a small c source that shows the correct behavior. The c example should be compiled as `gcc chgat.c -lncurses -o chgat`. This is using ncurses 6.1 The c code is from https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/attrib.html, and the python script is a translation of it. ---------- components: Library (Lib) files: chgat.py messages: 375681 nosy: maarten priority: normal severity: normal status: open title: curses' window.chgat does not change color when specifying curses.A_COLOR versions: Python 3.7 Added file: https://bugs.python.org/file49407/chgat.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 20:40:32 2020 From: report at bugs.python.org (Maarten) Date: Thu, 20 Aug 2020 00:40:32 +0000 Subject: [issue41595] curses' window.chgat does not change color when specifying curses.A_COLOR In-Reply-To: <1597883990.64.0.646746547163.issue41595@roundup.psfhosted.org> Message-ID: <1597884032.26.0.41975717783.issue41595@roundup.psfhosted.org> Maarten added the comment: Equivalent c script of chgat.py Compile with: gcc chgat.c -lncurses -o chgat ---------- Added file: https://bugs.python.org/file49408/chgat.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 21:24:12 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 20 Aug 2020 01:24:12 +0000 Subject: [issue41595] curses' window.chgat does not change color when specifying curses.A_COLOR In-Reply-To: <1597883990.64.0.646746547163.issue41595@roundup.psfhosted.org> Message-ID: <1597886652.39.0.726488060273.issue41595@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 21:39:15 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 20 Aug 2020 01:39:15 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597887555.03.0.0354773695062.issue41566@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: -21037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 21:41:35 2020 From: report at bugs.python.org (Maarten) Date: Thu, 20 Aug 2020 01:41:35 +0000 Subject: [issue2889] curses for windows (alternative patch) In-Reply-To: <1210919907.42.0.842256015219.issue2889@psf.upfronthosting.co.za> Message-ID: <1597887695.43.0.22332916139.issue2889@roundup.psfhosted.org> Maarten added the comment: Current ncurses master is buildable on Visual Studio, using msys2. It should be possible to create a vcxproject and integrate it in the Visual Studio build. ---------- nosy: +maarten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 21:57:41 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 20 Aug 2020 01:57:41 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597888661.39.0.236701725461.issue41566@roundup.psfhosted.org> Gregory P. Smith added the comment: fwiw, no PEP is needed for things like this. it'd just be an alternative library implementing the core of the zlib and/or gzip modules behind the scenes. normally this kind of thing would be done using a check for the availability of the library in configure.ac with conditional compilation via #ifdef's from the configure output that controls what is set in pyconfig.h in the zlib and gzip modules itself. Within the stdlib, I'd focus only on using things that can be used in a 100% api compatible way with the existing modules. Otherwise creating a new module and putting it up on PyPI to expose the functionality from the libraries you want makes sense and will be easier to make available to everyone on existing Python versions rather than waiting on getting something into CPython. FWIW I tend to avoid software provided by Intel given any other choice. Look instead at Chromium's zlib as discussed in https://github.com/madler/zlib/issues/346 or possibly at a project like https://github.com/zlib-ng/zlib-ng. These are much more likely to be drop in zlib replacements making this simply a build time thing which is more a matter of making sure we get the relevant compiler flags correct when the faster libraries are detected by configure.ac as available. There is a caveat to using any of these: how well maintained and security vetted are all of the code paths in the implementation? zlib proper gets massive security attention. Its low rate of change and staleness are a feature. Chromium's zlib also gets proper security attention. No idea about zlib-ng and even less about Intels self serving arm-ignoring oddity. ---------- nosy: +gregory.p.smith stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 22:15:48 2020 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 20 Aug 2020 02:15:48 +0000 Subject: [issue34215] streams.py:IncompleteReadError message is unclear when expected is None In-Reply-To: <1532465024.45.0.56676864532.issue34215@psf.upfronthosting.co.za> Message-ID: <1597889748.11.0.0550752528572.issue34215@roundup.psfhosted.org> Change by Zackery Spytz : ---------- components: +asyncio nosy: +ZackerySpytz title: streams.py:IncompleteReadError is message is unclear when expected is None -> streams.py:IncompleteReadError message is unclear when expected is None versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 22:21:37 2020 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 20 Aug 2020 02:21:37 +0000 Subject: [issue34215] streams.py:IncompleteReadError message is unclear when expected is None In-Reply-To: <1532465024.45.0.56676864532.issue34215@psf.upfronthosting.co.za> Message-ID: <1597890097.7.0.226996605292.issue34215@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +21038 pull_request: https://github.com/python/cpython/pull/21925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 22:40:18 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 20 Aug 2020 02:40:18 +0000 Subject: [issue41593] pathlib PermissionError problem In-Reply-To: <1597876109.8.0.763662606664.issue41593@roundup.psfhosted.org> Message-ID: <1597891218.28.0.232876789953.issue41593@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 19 23:01:25 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 20 Aug 2020 03:01:25 +0000 Subject: [issue41585] policy.max_line_length is incorrectly assumed to never be None In-Reply-To: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org> Message-ID: <1597892485.15.0.437047836275.issue41585@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 00:21:55 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 20 Aug 2020 04:21:55 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597897315.14.0.449606933854.issue41513@roundup.psfhosted.org> Tim Peters added the comment: Just FYI, if the "differential correction" step seems obscure to anyone, here's some insight, following a chain of mathematical equivalent respellings: result + x / (2 * result) = result + (sumsq - result**2) / (2 * result) = result + (sumsq - result**2) / result / 2 = result + (sumsq / result - result**2 / result) / 2 = result + (sumsq / result - result) / 2 = result + sumsq / result / 2 - result / 2 = result / 2 + sumsq / result / 2 = (result + sumsq / result) / 2 I hope the last line is an "aha!" for you then: it's one iteration of Newton's square root method, for improving a guess "result" for the square root of "sumsq". Which shouldn't be too surprising, since Newton's method is also derived from a first-order Taylor expansion around 0. Note an implication: the quality of the initial square root is pretty much irrelevant, since a Newton iteration basically doubles the number of "good bits". Pretty much the whole trick relies on computing "sumsq - result**2" to greater than basic machine precision. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 00:38:08 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 20 Aug 2020 04:38:08 +0000 Subject: [issue41560] pathlib.Path.glob fails on empty string In-Reply-To: <1597543364.86.0.966636544489.issue41560@roundup.psfhosted.org> Message-ID: <1597898288.67.0.807996117507.issue41560@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 00:50:28 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Thu, 20 Aug 2020 04:50:28 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1597899028.73.0.158006807206.issue41564@roundup.psfhosted.org> Change by Jeffrey Kintscher : ---------- nosy: +Jeffrey.Kintscher status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 01:26:01 2020 From: report at bugs.python.org (Kenta Tsubouchi) Date: Thu, 20 Aug 2020 05:26:01 +0000 Subject: [issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc' In-Reply-To: <1443130331.16.0.912755488197.issue25229@psf.upfronthosting.co.za> Message-ID: <1597901161.54.0.421287320615.issue25229@roundup.psfhosted.org> Kenta Tsubouchi added the comment: This patch seems good for proprietary compilers in linux. Because such compilers need gcc-style link option. So I'll make PR. ---------- nosy: +ketsubouchi type: -> enhancement versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 02:37:02 2020 From: report at bugs.python.org (Prudent) Date: Thu, 20 Aug 2020 06:37:02 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597905422.1.0.639648506432.issue41574@roundup.psfhosted.org> Prudent added the comment: It is also very weird to me. I checked the python version used in VS code, the version in use was 3.8. But it seems the used Tcl/Tk package still linked to the system-embedded Tck/Tk 8.5.9 on macOS. I found this description from "https://www.python.org/download/mac/tcltk/", which may help us know more. Anyway, this warning doesn't affect running codes too much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 02:43:18 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Thu, 20 Aug 2020 06:43:18 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597905798.04.0.584497168286.issue41566@roundup.psfhosted.org> Ruben Vorderman added the comment: > Within the stdlib, I'd focus only on using things that can be used in a 100% api compatible way with the existing modules. > Otherwise creating a new module and putting it up on PyPI to expose the functionality from the libraries you want makes sense and will be easier to make available to everyone on existing Python versions rather than waiting on getting something into CPython. Agreed. 100% backwards compatibility is more important than speed. And getting it available to users is faster as a module than implementing it in CPython. I already have a PR open in the xopen module to implement the use of the igzip program. Implementing a module like the gzip module in CPython will be more work, but I will certainly consider it. Thanks for the suggestion! > There is a caveat to using any of these: how well maintained and security vetted are all of the code paths in the implementation? zlib proper gets massive security attention. Its low rate of change and staleness are a feature. I didn't consider that. So I looked at the CVE page for ZLIB. The latest issues are from 2017. Before that 2005. This is the 2017 report: https://wiki.mozilla.org/images/0/09/Zlib-report.pdf. Note how it states that the old compiler support etc. are a basis for vulnerabilities. Precisely zlib-ng did get rid of these parts. On the other hand, Mozilla notes that Zlib is a great candidate for periodic security audits, precisely for the same reasons you mention. > FWIW I tend to avoid software provided by Intel given any other choice. I know the feeling. They rightfully have a very bad reputation for things they did in the past. But this particular code is open source and compilable with open source compilers. Part of it is written in Assembly, to get the speed advantage. I benchmarked it on my AMD processor and I too get enormous speed advantages out of it. > even less about Intels self serving arm-ignoring oddity. They *do* provide instructions to build for arm. Right on their README. https://github.com/intel/isa-l#building-isa-l. I think it is very unfair to be so dismissive just because Intel pays the developers. This is good work, which speeds up bioinformatics workloads, which in turn helps us to help more patients. On the whole I think the arguments to make a module are very strong. So I think that is the appropriate way forward. I'd love everyone to switch to more efficient deflate algorithms, but CPython may not be the right project to drive this change. At least this discussion is now here as a reference for other people who are curious about improving this performance aspect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 03:47:51 2020 From: report at bugs.python.org (Mototsugu Emori) Date: Thu, 20 Aug 2020 07:47:51 +0000 Subject: [issue41596] Re: Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range Message-ID: <1597909671.37.0.412048973684.issue41596@roundup.psfhosted.org> New submission from Mototsugu Emori : When using SSL with websocket, _process_write_backlog function throws IndexError. --------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 827, in transfer_data message = await self.read_message() File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 895, in read_message frame = await self.read_data_frame(max_size=self.max_size) File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 971, in read_data_frame frame = await self.read_frame(max_size) File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 1051, in read_frame extensions=self.extensions, File "/usr/local/lib/python3.7/site-packages/websockets/framing.py", line 105, in read data = await reader(2) File "/usr/local/lib/python3.7/asyncio/streams.py", line 679, in readexactly await self._wait_for_data('readexactly') File "/usr/local/lib/python3.7/asyncio/streams.py", line 473, in _wait_for_data await self._waiter File "/usr/local/lib/python3.7/asyncio/sslproto.py", line 689, in _process_write_backlog del self._write_backlog[0] IndexError: deque index out of range --------------------------------------------------------------- Websocket has a keepalive feature and periodically pings the server. If ping sending process occurs at the same time when sending data, the data operation to the array (_write_backlog) will be duplicated and the error will occur. --------------------------------------------------------------- asyncio/sslproto.py --------------------------------------------------------------- class SSLProtocol(protocols.Protocol) def _write_appdata(self, data): self._write_backlog.append((data, 0)) <--- append data to _write_backlog self._write_buffer_size += len(data) self._process_write_backlog() def _process_write_backlog(self): del self._write_backlog[0] <--- !!!ERROR!!! IndexError: deque index out of range --------------------------------------------------------------- I made a patch(sslproto.sy.patch) to exclude data operations on the array (_write_backlog). Could you check it? Environments: debian 4.19.46 Python 3.7.3 OpenSSL 1.1.0l 10 Sep 2019 Reference: Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range https://bugs.python.org/issue37226 ---------- components: asyncio files: sslproto.py.patch keywords: patch messages: 375689 nosy: asvetlov, ben.brown, christian.heimes, m_emori, maayank, yselivanov priority: normal severity: normal status: open title: Re: Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49409/sslproto.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 03:57:45 2020 From: report at bugs.python.org (Mototsugu Emori) Date: Thu, 20 Aug 2020 07:57:45 +0000 Subject: [issue41597] Fatal Error on SSL Transport - sslv3 alert bad record mac Message-ID: <1597910265.16.0.778996337527.issue41597@roundup.psfhosted.org> New submission from Mototsugu Emori : When using SSL with websocket, I get an SSLError. --------------------------------------------------------------- [2020-08-17 15:02:51,078] websockets.protocol : Error in data transfer [MainProcess - MainThread] Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 827, in transfer_data message = await self.read_message() File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 895, in read_message frame = await self.read_data_frame(max_size=self.max_size) File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 971, in read_data_frame frame = await self.read_frame(max_size) File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 1051, in read_frame extensions=self.extensions, File "/usr/local/lib/python3.7/site-packages/websockets/framing.py", line 106, in read data = await reader(2) File "/usr/local/lib/python3.7/asyncio/streams.py", line 679, in readexactly await self._wait_for_data('readexactly') File "/usr/local/lib/python3.7/asyncio/streams.py", line 473, in _wait_for_data await self._waiter File "guac_ws_client.py", line 166, in read await websocket.send(instruction) File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 567, in send await self.write_frame(True, opcode, data) File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 1077, in write_frame await self._drain() File "/usr/local/lib/python3.7/site-packages/websockets/protocol.py", line 306, in _drain raise exc File "/usr/local/lib/python3.7/asyncio/sslproto.py", line 530, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "/usr/local/lib/python3.7/asyncio/sslproto.py", line 202, in feed_ssldata chunk = self._sslobj.read(self.max_size) File "/usr/local/lib/python3.7/ssl.py", line 707, in read v = self._sslobj.read(len) ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2488) --------------------------------------------------------------- When data reception (SSL_read) and data transmission (SSL_write) occur at the same time, the error seems to occur. I made a patch(ssl.py.patch) that excludes SSL_read and SSL_write. Could you check it? Environments: debian 4.19.46 Python 3.7.3 OpenSSL 1.1.0l 10 Sep 2019 Reference: Re: Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range https://bugs.python.org/issue41596 ---------- assignee: christian.heimes components: SSL files: ssl.py.patch keywords: patch messages: 375690 nosy: alex, christian.heimes, dstufft, janssen, m_emori priority: normal severity: normal status: open title: Fatal Error on SSL Transport - sslv3 alert bad record mac type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49410/ssl.py.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 04:11:18 2020 From: report at bugs.python.org (Erik Quaeghebeur) Date: Thu, 20 Aug 2020 08:11:18 +0000 Subject: [issue41585] policy.max_line_length is incorrectly assumed to never be None In-Reply-To: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org> Message-ID: <1597911078.91.0.561690407969.issue41585@roundup.psfhosted.org> Erik Quaeghebeur added the comment: The script that triggered the issue can be found at https://github.com/equaeghe/mailfilters/blob/master/html2alternative.py You'll have to remove ", cte='8bit'" on line 68 to expose the bug (that was added as a workaround for this bug). I was consistently able to trigger the bug when applying it to a mail with a multipart/alternative with text and html parts already present. It should replace that html part by a (nested) multipart/alternative part, but it crashes unless you keep the workaround. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 04:50:43 2020 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Aug 2020 08:50:43 +0000 Subject: [issue41597] Fatal Error on SSL Transport - sslv3 alert bad record mac In-Reply-To: <1597910265.16.0.778996337527.issue41597@roundup.psfhosted.org> Message-ID: <1597913443.17.0.9492237284.issue41597@roundup.psfhosted.org> Christian Heimes added the comment: This looks like a bug in the websocket package. You cannot share an SSLSocket across threads safely without locking. I/O operations on a shared resource (file, socket, SSLSocket) are generally not thread safe. Locking has to be implemented in the layer that uses the resource, in your case websocket package. Please report the issue with websocket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 04:51:26 2020 From: report at bugs.python.org (Raphael Grewe) Date: Thu, 20 Aug 2020 08:51:26 +0000 Subject: [issue41550] SimpleQueues put blocks if feeded with strings greater than 2**16-13 chars In-Reply-To: <1597397796.53.0.606306315718.issue41550@roundup.psfhosted.org> Message-ID: <1597913486.05.0.588479218074.issue41550@roundup.psfhosted.org> Raphael Grewe added the comment: Soo... I think I use the functions indeed incorrectly then. Thank you for your time. Regards Raphael ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 04:52:47 2020 From: report at bugs.python.org (Christian Heimes) Date: Thu, 20 Aug 2020 08:52:47 +0000 Subject: [issue41596] Re: Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range In-Reply-To: <1597909671.37.0.412048973684.issue41596@roundup.psfhosted.org> Message-ID: <1597913567.53.0.0600949189704.issue41596@roundup.psfhosted.org> Christian Heimes added the comment: This also looks like a concurrency issue in the websocket package. Also see #41597 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 05:39:37 2020 From: report at bugs.python.org (marco_ocram) Date: Thu, 20 Aug 2020 09:39:37 +0000 Subject: [issue41598] rnd() + rndup() in math Message-ID: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> New submission from marco_ocram : hello, please insert following simple but useful roundings in new lib math. def rnd(x, n=0): a = x*10**n b = int(a) if abs(a - b) >= 0.5: b += 1 if x >= 0 else -1 return b/10**n def rndup(x, n=0): a = x*10**n b = int(a) if abs(a - b) > 0: b += 1 if x >= 0 else -1 return b/10**n thanks a lot, marco. ---------- components: Library (Lib) messages: 375695 nosy: marco_ocram priority: normal severity: normal status: open title: rnd() + rndup() in math type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 05:40:49 2020 From: report at bugs.python.org (Erik Quaeghebeur) Date: Thu, 20 Aug 2020 09:40:49 +0000 Subject: [issue41599] get/set_payload deprecated, but get_set_content do not provide full replacement functionality Message-ID: <1597916449.63.0.470625371504.issue41599@roundup.psfhosted.org> New submission from Erik Quaeghebeur : >From Python 3.6 onwards, get/set_payload methods are deprecated on the basic email message class, email.message.EmailMessage (changed from email.message.Message). The get/set_content methods are suggested instead. However, with get/set_payload one can ?transplant? whole MIME subtrees, while get/set_content cannot deal with multipart parts. I would like to suggest to not remove get/set_payload until its functionality is present in other methods. Perhaps they should even be un-deprecated. ---------- components: email messages: 375696 nosy: barry, equaeghe, r.david.murray priority: normal severity: normal status: open title: get/set_payload deprecated, but get_set_content do not provide full replacement functionality type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 06:30:43 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Aug 2020 10:30:43 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597919443.45.0.406206706482.issue40994@roundup.psfhosted.org> miss-islington added the comment: New changeset 2ce39631f679e14132a54dc90ce764259d26e166 by Sydney Pemberton in branch 'master': bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880) https://github.com/python/cpython/commit/2ce39631f679e14132a54dc90ce764259d26e166 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 06:31:11 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Aug 2020 10:31:11 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597919471.04.0.383636376586.issue40994@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21040 pull_request: https://github.com/python/cpython/pull/21927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 06:31:02 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Aug 2020 10:31:02 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597919462.38.0.976280908776.issue40994@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21039 pull_request: https://github.com/python/cpython/pull/21926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:09:35 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 20 Aug 2020 11:09:35 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597921775.25.0.500609930714.issue41598@roundup.psfhosted.org> Ronald Oussoren added the comment: Adding new functions that are extreme similar to existing functions requires a better rationale than your giving. In particular, both are similar to the builtin function "round" (https://docs.python.org/3/library/functions.html#round>). ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:12:05 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 20 Aug 2020 11:12:05 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597921925.04.0.856071538449.issue41574@roundup.psfhosted.org> Ronald Oussoren added the comment: But does VS Code use the installation of 3.8 your expecting (the one in /Library/Frameworks/Python.framework)? I'm closing the issue because this appears to be a problem with 3th-party code (VS Code), not with the Python.org installer. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:13:56 2020 From: report at bugs.python.org (Prudent) Date: Thu, 20 Aug 2020 11:13:56 +0000 Subject: [issue41574] Python[11231:143796] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. In-Reply-To: <1597740645.65.0.491610324996.issue41574@roundup.psfhosted.org> Message-ID: <1597922036.97.0.659315056286.issue41574@roundup.psfhosted.org> Prudent added the comment: Yes, I agree with you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:17:30 2020 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 20 Aug 2020 11:17:30 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1597922250.07.0.540194484188.issue40994@roundup.psfhosted.org> Cheryl Sabella added the comment: @Sydney Pemberton, thank you for the bug report and for the PR! ---------- nosy: +cheryl.sabella resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:20:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Aug 2020 11:20:50 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597922450.64.0.829740958654.issue40204@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21041 pull_request: https://github.com/python/cpython/pull/21928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:24:14 2020 From: report at bugs.python.org (Vegard Stikbakke) Date: Thu, 20 Aug 2020 11:24:14 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings Message-ID: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> New submission from Vegard Stikbakke : I'm not sure if this is a bug, but I had a problem when I was trying to use argparse recently, and I was wondering about the expected behavior. For context: We invoke a Python program from a deployment tool, where we provide input in a text box. We were using argparse to read and parse the input arguments. The scenario we had was we were requiring two named arguments to be given, as illustrated in the minimal example below. ``` # a.py import argparse parser = argparse.ArgumentParser() parser.add_argument("--a", required=True) parser.add_argument("--b", required=True) parser.parse_args() ``` When invoking this program from this deployment tool giving `--a=1 --b=2` as input, we got the error message `a.py: error: the following arguments are required: --a, --b`. As it turns out, the input was provided in the same way as if you had given the program a quoted string in the shell: ``` $ python a.py "--a=1 --b=2" usage: a.py [-h] --a A --b B a.py: error: the following arguments are required: --a, --b ``` When given a quoted string like this, `sys.argv` only has two elements, namely `a.py` and `--a=1 --b=2`. This was new to me! But it makes sense. This was a bit annoying! One way to get around it, which we did indeed implement, is to mutate `sys.argv`, effectively unpacking the input string such that `sys.argv` ends up as `["a.py", "--a=1`, `--b=2`]. Given that the string contains named arguments, it seems to me that it could be possible, and safe, to unpack this quoted string. Would that make sense? Or am I using it incorrectly? Or is there some other way to provide input such that I don't have to do this hack that I mentioned? If we make a similar program where the arguments `a` and `b` are not named arguments, but rather positional arguments, ``` # b.py import argparse parser = argparse.ArgumentParser() parser.add_argument("a") parser.add_argument("b") parser.parse_args() ``` and we call the program as before with `python b.py "1 2"`, then `a` will be set to the string `1 2`, whereas `b` will not be set (and so the program will, of course, exit). This seems entirely reasonable. And perhaps it isn't possible to both get this behaviour, as well as the behaviour that I mentioned above. ---------- components: Library (Lib) messages: 375702 nosy: vegarsti priority: normal severity: normal status: open title: Expected behavior of argparse given quoted strings type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:28:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Aug 2020 11:28:54 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597922934.67.0.639178137963.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7d0fef56d8eaac6309a66cb8c6ba6fd96f8c8a94 by Victor Stinner in branch '3.8': bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901) (GH-21928) https://github.com/python/cpython/commit/7d0fef56d8eaac6309a66cb8c6ba6fd96f8c8a94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:33:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 20 Aug 2020 11:33:09 +0000 Subject: [issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration In-Reply-To: <1586183568.2.0.322929459864.issue40204@roundup.psfhosted.org> Message-ID: <1597923189.07.0.305453259501.issue40204@roundup.psfhosted.org> STINNER Victor added the comment: I merged my changes to add Sphinx 3.2 and newer support into 3.8, 3.9 and master branches. I close the issue. Sadly, it seems like it's not possible to keep Sphinx 2 support if we add Sphinx 3.0 and Sphinx 3.1 support. For now, only Sphinx 2 and Sphinx 3.2+ are supported: 3.0 and 3.1 are not supported. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:33:40 2020 From: report at bugs.python.org (Vegard Stikbakke) Date: Thu, 20 Aug 2020 11:33:40 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597923220.39.0.611409140589.issue41600@roundup.psfhosted.org> Vegard Stikbakke added the comment: For what it's worth, I'd love to work on this if it's something that could be nice to have. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 07:56:07 2020 From: report at bugs.python.org (Vegard Stikbakke) Date: Thu, 20 Aug 2020 11:56:07 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597924567.1.0.765668555004.issue41600@roundup.psfhosted.org> Vegard Stikbakke added the comment: It seems that I mixed up something in the post here. If the quoted string is `"--a=1 --b=2` as I said in the post, then the program will only complain about `b` missing. In this case, it sets `a` to be `1 --b=2`. Whereas if the quoted string is `"--a 1 --b 2"` (i.e. space and not `=` is used to separate), then it will say that both `a` and `b` are missing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:00:44 2020 From: report at bugs.python.org (Vegard Stikbakke) Date: Thu, 20 Aug 2020 12:00:44 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597924844.66.0.620020425851.issue41600@roundup.psfhosted.org> Vegard Stikbakke added the comment: In fact, what happens in the latter case (i.e. `"--a 1 --b 2"`), inside the call to `_parse_optional`, is that it fails to get the optional tuple. And so it continues to this line in argparse.py: https://github.com/python/cpython/blob/2ce39631f679e14132a54dc90ce764259d26e166/Lib/argparse.py#L2227 Here it says that if there's a space in the string, it was meant to be a positional, and so the function returns `None`, causing it to not find the argument. In conclusion, it seems to me that argparse is not, in fact, meant to handle quoted strings, or rather, strings where there are spaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:33:32 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 Aug 2020 12:33:32 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597926812.97.0.207324300365.issue41600@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:40:13 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 Aug 2020 12:40:13 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1597927213.2.0.0172622810431.issue41572@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 1afb42cfa82dad0ddd726f59c6c5fcb3962314db by Cleber Rosa in branch 'master': bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914) https://github.com/python/cpython/commit/1afb42cfa82dad0ddd726f59c6c5fcb3962314db ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:41:52 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Aug 2020 12:41:52 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1597927312.55.0.864436089295.issue41572@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21043 pull_request: https://github.com/python/cpython/pull/21930 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:41:39 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 20 Aug 2020 12:41:39 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1597927299.44.0.569526850731.issue41572@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21042 pull_request: https://github.com/python/cpython/pull/21929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:46:58 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 Aug 2020 12:46:58 +0000 Subject: [issue41585] policy.max_line_length is incorrectly assumed to never be None In-Reply-To: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org> Message-ID: <1597927618.83.0.267456414129.issue41585@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +maxking _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 08:47:40 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 20 Aug 2020 12:47:40 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597927660.77.0.0266470320569.issue41598@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mark.dickinson, rhettinger, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 09:12:16 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 20 Aug 2020 13:12:16 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597929136.09.0.155821496563.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: If we want to proceed with this, much better way would be to add a rounding mode optional argument to `round` builtin. But really, anyone trying to precisely round a decimal representation of a binary floating point number is, to paraphrase von Neumann, living in the state of sin. See https://stackoverflow.com/a/51146310/1875565. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 09:32:21 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 20 Aug 2020 13:32:21 +0000 Subject: [issue10399] AST Optimization: inlining of function calls In-Reply-To: <1289593012.28.0.71054855235.issue10399@psf.upfronthosting.co.za> Message-ID: <1597930341.47.0.729666887158.issue10399@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 09:44:24 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 Aug 2020 13:44:24 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597931064.16.0.0258289650981.issue41600@roundup.psfhosted.org> Eric V. Smith added the comment: This is all working as designed. We do not want to modify argparse to split parameters. You probably want to split the input with shlex.split(). See https://stackoverflow.com/questions/44945815/how-to-split-a-string-into-command-line-arguments-like-the-shell-in-python You shouldn't need to mutate sys.argv. You can break the input up into multiple strings with shlex.split() (or whatever you decide to use) and pass those to ArgumentParser.parse_args(). ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 09:54:57 2020 From: report at bugs.python.org (Vegard Stikbakke) Date: Thu, 20 Aug 2020 13:54:57 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597931697.84.0.746053597597.issue41600@roundup.psfhosted.org> Vegard Stikbakke added the comment: I see! Thanks, had not heard about shlex. I also had not realized `parse_args` takes arguments. Doh. That makes sense. Thanks a lot! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 09:56:57 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 Aug 2020 13:56:57 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597931817.27.0.557416093431.issue41600@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:11:18 2020 From: report at bugs.python.org (Shubham Upreti) Date: Thu, 20 Aug 2020 15:11:18 +0000 Subject: [issue41591] Comprehensions documentation In-Reply-To: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> Message-ID: <1597936278.95.0.362291510427.issue41591@roundup.psfhosted.org> Shubham Upreti added the comment: Is this open? Can i take this up? ---------- nosy: +shubh07 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:15:51 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 20 Aug 2020 15:15:51 +0000 Subject: [issue41591] Comprehensions documentation In-Reply-To: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> Message-ID: <1597936551.47.0.802416923743.issue41591@roundup.psfhosted.org> Vedran ?a?i? added the comment: This is not nested listcomp. Nested listcomp is a listcomp inside a listcomp. What you wrote is one listcomp, with two for-clauses. It does "desugar" into a nested loop, but that doesn't make it a nested listcomp. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:20:13 2020 From: report at bugs.python.org (Ned Deily) Date: Thu, 20 Aug 2020 15:20:13 +0000 Subject: [issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs In-Reply-To: <1588884932.92.0.367303002443.issue40553@roundup.psfhosted.org> Message-ID: <1597936813.71.0.226384107701.issue40553@roundup.psfhosted.org> Ned Deily added the comment: > Would taking a video help? It couldn't hurt and might very well help. > I'll make one anyways Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:26:09 2020 From: report at bugs.python.org (paul j3) Date: Thu, 20 Aug 2020 15:26:09 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597937169.02.0.370396225736.issue41600@roundup.psfhosted.org> paul j3 added the comment: I'd say the problem is with the deployment tool. Inputs like that should be split regardless of who's doing the commandline parsing. With normal shell input, quotes are used to prevent splitting, or to otherwise prevent substitutions and special character handling. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:28:26 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 20 Aug 2020 15:28:26 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597922654.76.0.585650879506.issue41600@roundup.psfhosted.org> Message-ID: <1597937306.43.0.666000367098.issue41600@roundup.psfhosted.org> Eric V. Smith added the comment: Completely agree with paul j3. The calling tool is breaking the "argv" conventions. If the OP can control the calling tool, it should be fixed there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:46:18 2020 From: report at bugs.python.org (Vegard Stikbakke) Date: Thu, 20 Aug 2020 15:46:18 +0000 Subject: [issue41600] Expected behavior of argparse given quoted strings In-Reply-To: <1597937306.43.0.666000367098.issue41600@roundup.psfhosted.org> Message-ID: Vegard Stikbakke added the comment: Great idea, thanks! It's open source, so I'll see if I can fix it. On Thu, 20 Aug 2020 at 17:28, Eric V. Smith wrote: > > > Eric V. Smith added the comment: > > > > Completely agree with paul j3. The calling tool is breaking the "argv" > conventions. If the OP can control the calling tool, it should be fixed > there. > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 11:48:27 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 20 Aug 2020 15:48:27 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1597938507.79.0.147261482447.issue41566@roundup.psfhosted.org> Stefan Behnel added the comment: > On the whole I think the arguments to make a module are very strong. So I think that is the appropriate way forward. If you take this route, please don't write it directly against the CPython C-API (as you would for a CPython stdlib module). It is much easier to get something working, correct, testable and feature-rich with Cython. Once you have that, put it on PyPI to give it more testing. If you then decide to come back and provide a patch to get it integrated into CPython's zlib module, it's relatively easy to manually translate the Cython code to equivalent C-API code. But by that time, your code will be known to work, will have a test suite, and we can run real benchmarks on it before investing the time into spelling it out in C. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:03:21 2020 From: report at bugs.python.org (Julia Frances) Date: Thu, 20 Aug 2020 16:03:21 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597938507.79.0.147261482447.issue41566@roundup.psfhosted.org> Message-ID: Julia Frances added the comment: those are strong and good vocabulary skills you have just keep on making more comments or responses and get that to me as soon as possible *Julia Frances pascack hills* On Thu, Aug 20, 2020 at 11:48 AM Stefan Behnel wrote: > > Stefan Behnel added the comment: > > > On the whole I think the arguments to make a module are very strong. So > I think that is the appropriate way forward. > > If you take this route, please don't write it directly against the CPython > C-API (as you would for a CPython stdlib module). It is much easier to get > something working, correct, testable and feature-rich with Cython. Once you > have that, put it on PyPI to give it more testing. If you then decide to > come back and provide a patch to get it integrated into CPython's zlib > module, it's relatively easy to manually translate the Cython code to > equivalent C-API code. But by that time, your code will be known to work, > will have a test suite, and we can run real benchmarks on it before > investing the time into spelling it out in C. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:04:39 2020 From: report at bugs.python.org (Walid Taha) Date: Thu, 20 Aug 2020 16:04:39 +0000 Subject: [issue41591] Comprehensions documentation In-Reply-To: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> Message-ID: <1597939479.2.0.464931408269.issue41591@roundup.psfhosted.org> Walid Taha added the comment: Thank you, and good point, Vedran. That takes care of the example that I gave. What remains is the source of confusion, namely, the reference to the "previous section". With a quick search I was not able to find what this was referring to (other than the one that you correctly pointed out is not nested). Can you point me to that reference? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:26:50 2020 From: report at bugs.python.org (Tim Peters) Date: Thu, 20 Aug 2020 16:26:50 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1597940810.98.0.187117810009.issue41513@roundup.psfhosted.org> Tim Peters added the comment: My apologies if nobody cares about this ;-) I just think it's helpful if we all understand what really helps here. > Pretty much the whole trick relies on computing > "sumsq - result**2" to greater than basic machine > precision. But why is that necessary at all? Because we didn't compute the sqrt of the sum of the squares to begin with - the input to sqrt was a _rounded_-to-double approximation to the sum of squares. The correction step tries to account for the sum-of-squares bits sqrt() didn't see to begin with. So, e.g., instead of doing result = sqrt(to_float(parts)) a, b = split(result) parts = add_on(-a*a, parts) parts = add_on(-b*b, parts) parts = add_on(-2.0*a*b, parts) x = to_float(parts) result += x / (2.0 * result) it works just as well to do just result = float((D(parts[0] - 1.0) + D(parts[1])).sqrt()) where D is the default-precision decimal.Decimal constructor. Then sqrt sees all the sum-of-squares bits we have (although the "+" rounds away those following the 28th decimal digit). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:30:59 2020 From: report at bugs.python.org (Clemens) Date: Thu, 20 Aug 2020 16:30:59 +0000 Subject: [issue41601] Performance issue using isspace() in extension module on Windows Message-ID: <1597941059.18.0.402030297208.issue41601@roundup.psfhosted.org> New submission from Clemens : Function isspace() is significantly slower in extension modules in Python 3.7 or later than in Python 3.6 on Windows 10. Python 3.6: >python test.py Locale: C Set locale: C Locale: C Duration: 0.19718074798583984 Python 3.7: >python test.py Locale: C Set locale: C Locale: C Duration: 2.9086477756500244 Python 3.8: >python test.py Locale: LC_COLLATE=C;LC_CTYPE=English_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C Set locale: C Locale: C Duration: 2.99224853515625 Python 3.9.0a5: >python test.py Locale: LC_COLLATE=C;LC_CTYPE=English_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C Set locale: C Locale: C Duration: 2.90370512008667 Building the extension module: > python setup.py build_ext A similar issue already exists, but I am not sure if it is the same problem since the suggested solution is about embedding Python rather then extending it: https://bugs.python.org/issue35195 ---------- components: Distutils, Windows messages: 375722 nosy: Clemens, dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Performance issue using isspace() in extension module on Windows type: performance versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:31:31 2020 From: report at bugs.python.org (Clemens) Date: Thu, 20 Aug 2020 16:31:31 +0000 Subject: [issue41601] Performance issue using isspace() in extension module on Windows In-Reply-To: <1597941059.18.0.402030297208.issue41601@roundup.psfhosted.org> Message-ID: <1597941091.64.0.66560895001.issue41601@roundup.psfhosted.org> Change by Clemens : Added file: https://bugs.python.org/file49411/isspace_ext.cpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:32:03 2020 From: report at bugs.python.org (Clemens) Date: Thu, 20 Aug 2020 16:32:03 +0000 Subject: [issue41601] Performance issue using isspace() in extension module on Windows In-Reply-To: <1597941059.18.0.402030297208.issue41601@roundup.psfhosted.org> Message-ID: <1597941123.19.0.355269193198.issue41601@roundup.psfhosted.org> Change by Clemens : Added file: https://bugs.python.org/file49413/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 12:31:52 2020 From: report at bugs.python.org (Clemens) Date: Thu, 20 Aug 2020 16:31:52 +0000 Subject: [issue41601] Performance issue using isspace() in extension module on Windows In-Reply-To: <1597941059.18.0.402030297208.issue41601@roundup.psfhosted.org> Message-ID: <1597941112.94.0.989552715836.issue41601@roundup.psfhosted.org> Change by Clemens : Added file: https://bugs.python.org/file49412/setup.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 13:23:18 2020 From: report at bugs.python.org (hai shi) Date: Thu, 20 Aug 2020 17:23:18 +0000 Subject: [issue41073] [C API] PyType_GetSlot() should accept static types In-Reply-To: <1592815094.33.0.264745776024.issue41073@roundup.psfhosted.org> Message-ID: <1597944198.9.0.538997124345.issue41073@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +21044 pull_request: https://github.com/python/cpython/pull/21931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 13:50:28 2020 From: report at bugs.python.org (marco_ocram) Date: Thu, 20 Aug 2020 17:50:28 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597945828.14.0.435380701121.issue41598@roundup.psfhosted.org> marco_ocram added the comment: about floats ... https://docs.python.org/3/library/functions.html#round "if two multiples are equally close, rounding is done toward the even choice (so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2)" i'm sure lots of users don't need this but a common math rounding as ... https://docs.python.org/3/library/decimal.html#rounding-modes decimal.ROUND_HALF_UP and as option in some cases decimal.ROUND_UP the proposed function realize just this, for either positive and negative vals. if you need to realize decimal.ROUND_DOWN function trunc is already fine. i'm as mathematician have never used other roundings, i know the current round function work well in the accounting fiels but only there. in other languages sometimes the same problem (for example ms ones as old vb), really i and others don't know the reason. about the revision of the standard function to accept an additional argument for different rounding types, for example all available for decimals, is ok for me, better if the default will be the normal accepted math rounding decimal.ROUND_HALF_UP ... https://docs.python.org/3/library/decimal.html#decimal.BasicContext decimal.BasicContext This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to ROUND_HALF_UP. about the floating point approximation in my opinion if you aren't a scientist you can find it pretty nice if you apply the right roundings. i think to have documented enough my request. take care. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 13:53:04 2020 From: report at bugs.python.org (marco_ocram) Date: Thu, 20 Aug 2020 17:53:04 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597945984.71.0.895766989866.issue41598@roundup.psfhosted.org> marco_ocram added the comment: revision of "if you need to realize decimal.ROUND_DOWN function trunc is already fine." --> "if you need to realize decimal.ROUND_DOWN function int() or math.trunc() are already fine." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 14:12:52 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 20 Aug 2020 18:12:52 +0000 Subject: [issue41591] Comprehensions documentation In-Reply-To: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> Message-ID: <1597947172.15.0.417646191837.issue41591@roundup.psfhosted.org> Vedran ?a?i? added the comment: It refers to the sentence """The result will be a new list resulting from evaluating the expression in the context of the for and if clauses which follow it. """ The expression at the start of listcomp is the one that's evaluated in the context of clauses following it, no matter what kind of expression it is. If it is another listcomp, then you have a nested listcomp, but that's just a nonspecial case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 14:27:43 2020 From: report at bugs.python.org (Walid Taha) Date: Thu, 20 Aug 2020 18:27:43 +0000 Subject: [issue41591] Comprehensions documentation In-Reply-To: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> Message-ID: <1597948063.6.0.779974889701.issue41591@roundup.psfhosted.org> Walid Taha added the comment: That makes perfect sense now, and I see what threw me off. Basically, there were not enough cues for me to see that there was an extra pair of square brackets in the example that had nested listcomps, and as a result, I assumed that a nested listcomp simply meant one with multiple for clauses in it (which you clarified is not considered a nested listcomp). If I may make a suggestion, the phrase "the nested listcomp is evaluated" would not have confused me if it simply said "the main part of the outer listcomp is evaluated". This can help in two ways. First, it avoids the possible confusion that the discussion in the previous section was about nested listcomp (which you rightly point out it is not). Second, adding the word "outer" gives an additional cue that we actually have two nested listcomps here. Thank you very much for your quick response and help with this issue! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 14:38:15 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 20 Aug 2020 18:38:15 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597948695.47.0.21411312994.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: ROUND_HALF_UP is not chosen because it's popular, but because it's the best way to compensate for errors in representing decimal numbers by binary numbers. Thinking that floats are decimal numbers is going to bite you anyway sooner or later. For example, would you expect (with your implementation) rnd(2.8-1.3) == rnd(1.8-1.3) ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 14:41:02 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 20 Aug 2020 18:41:02 +0000 Subject: [issue41591] Comprehensions documentation In-Reply-To: <1597858802.77.0.294724913479.issue41591@roundup.psfhosted.org> Message-ID: <1597948862.05.0.637610734445.issue41591@roundup.psfhosted.org> Vedran ?a?i? added the comment: On the contrary, I think it would be much more clearer if it focused on the one that was evaluated in the context. So, _inner_ listcomp is... (instead of "nested listcomp is..."). "Main part of outer" is just beating around the bush. But in fact I'm not motivated enough (nor powerful enough) to actually change this on my own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 14:50:54 2020 From: report at bugs.python.org (marco_ocram) Date: Thu, 20 Aug 2020 18:50:54 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597949454.84.0.245145238796.issue41598@roundup.psfhosted.org> marco_ocram added the comment: i want to be more clear, these could be useful. https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/round-function This VBA function returns something commonly referred to as bankers rounding. So be careful before using this function. For more predictable results, use Worksheet Round functions in Excel VBA. https://docs.microsoft.com/en-us/dotnet/api/system.math.round?view=netcore-3.1 Rounding to nearest, or banker's rounding Midpoint values are rounded to the nearest even number. For example, both 3.75 and 3.85 round to 3.8, and both -3.75 and -3.85 round to -3.8. This form of rounding is represented by the MidpointRounding.ToEven enumeration member. Rounding to nearest is the standard form of rounding used in financial and statistical operations. It conforms to IEEE Standard 754, section 4. When used in multiple rounding operations, it reduces the rounding error that is caused by consistently rounding midpoint values in a single direction. In some cases, this rounding error can be significant. this is how work the current round() function, but if i don't need to do successive rounding but only adjust data i prefer... https://docs.microsoft.com/en-us/dotnet/api/system.math.round?view=netcore-3.1 Rounding away from zero Midpoint values are rounded to the next number away from zero. For example, 3.75 rounds to 3.8, 3.85 rounds to 3.9, -3.75 rounds to -3.8, and -3.85 rounds to -3.9. This form of rounding is represented by the MidpointRounding.AwayFromZero enumeration member. Rounding away from zero is the most widely known form of rounding. i can understand in decimal the default is banking or accounting rounding and i can adjust the context, but in normal calculations i think will be more usefule the common rounding, or also the possibility to choose with an argument. i have simply implemented my functions, this is only for the sake of improving the language. cheers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 15:21:01 2020 From: report at bugs.python.org (marco_ocram) Date: Thu, 20 Aug 2020 19:21:01 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597951260.99.0.0287103139743.issue41598@roundup.psfhosted.org> marco_ocram added the comment: print(a := rnd(rnd(2.8-1.3, 15))) print(b := rnd(rnd(1.8-1.3, 15))) print(a == b) results ... 2.0 1.0 False it's the last significative digit that have problems, we could work on the code to correct this and experiment if someone is interested. by the way the last ultra successful excel 365 - i've just tried - have the same problem. we can do better then ms? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 15:30:37 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 20 Aug 2020 19:30:37 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597951837.56.0.489993124073.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: Yes, we can do better than ms (whatever that means). And we do exactly that in the `decimal` module. Floats are not the right target for your algorithms, because they don't have decimal digits. It's as if you're trying to round words in English language. :-D (In fact, with words you'd probably have better luck, since they _can_ represent decimal numbers exactly.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 15:58:37 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 19:58:37 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy Message-ID: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> New submission from Thomas Grainger : when running "python -m ham.py" KeyboardInterrupt should result in -2, but results in 1 see test case ---------- components: Interpreter Core files: test_exit.py messages: 375732 nosy: graingert priority: normal severity: normal status: open title: Python doesn't exit with proper resultcode on SIGINT in runpy versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49414/test_exit.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 15:58:51 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 19:58:51 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597953531.05.0.982703745928.issue41602@roundup.psfhosted.org> Thomas Grainger added the comment: see also https://bugs.python.org/issue1054041 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 16:02:50 2020 From: report at bugs.python.org (Aymeric Augustin) Date: Thu, 20 Aug 2020 20:02:50 +0000 Subject: [issue41597] Fatal Error on SSL Transport - sslv3 alert bad record mac In-Reply-To: <1597910265.16.0.778996337527.issue41597@roundup.psfhosted.org> Message-ID: <1597953770.5.0.502347075609.issue41597@roundup.psfhosted.org> Aymeric Augustin added the comment: websockets doesn't use threads (except where asyncio uses them under the hood e.g. for resolving addresses). Perhaps the OP's code passes asyncio connections (wrapped in websocket connections) unsafely across threads. ---------- nosy: +aymeric.augustin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 16:12:12 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 20:12:12 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597954332.92.0.245105333942.issue41602@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 16:12:31 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 20:12:31 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597954351.48.0.507193079782.issue41602@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 16:16:49 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 20:16:49 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597954609.43.0.676696815596.issue41602@roundup.psfhosted.org> Change by Thomas Grainger : Added file: https://bugs.python.org/file49415/test_exit.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 18:08:44 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 22:08:44 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597961324.93.0.70315316545.issue41602@roundup.psfhosted.org> Thomas Grainger added the comment: I think I've eliminated runpy.py, as I still get a `-2` when using: import runpy runpy.run_module("ham") or runpy._run_module_as_main("ham") see attached test_exit_runpy.py It seems the only difference is if pymain_run_file or pymain_run_module is used. ---------- Added file: https://bugs.python.org/file49416/test_exit_runpy.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 18:13:33 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 22:13:33 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597961613.69.0.821761576833.issue41602@roundup.psfhosted.org> Change by Thomas Grainger : ---------- title: Python doesn't exit with proper resultcode on SIGINT in runpy -> Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 19:31:18 2020 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 20 Aug 2020 23:31:18 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1597966278.76.0.993641424961.issue41602@roundup.psfhosted.org> Thomas Grainger added the comment: I've now eliminated pymain_run_stdin and pymain_run_command, both process a KeyboardInterrupt as -2 see attached test_exit_command_stdin.py ---------- Added file: https://bugs.python.org/file49417/test_exit_command_stdin.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 19:40:27 2020 From: report at bugs.python.org (Thangamani) Date: Thu, 20 Aug 2020 23:40:27 +0000 Subject: [issue41603] Compilation issue 3.8.5 with Redhat 7.8 and Red Hat 4.8.5-39 Message-ID: <1597966827.71.0.80485708689.issue41603@roundup.psfhosted.org> New submission from Thangamani : gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Python/frozen.o Python/frozen.c rm -f libpython3.8.a ar rcs libpython3.8.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o Modules/xxsubtype.o Python/frozen.o gcc -pthread -Xlinker -export-dynamic -o python Programs/python.o libpython3.8.a -lcrypt -lpthread -ldl -lutil -lm -lm ./python -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi Could not import runpy module Traceback (most recent call last): File "/opt/hadoop_admin/Python-3.8.5/Lib/runpy.py", line 15, in import importlib.util File "/opt/hadoop_admin/Python-3.8.5/Lib/importlib/util.py", line 14, in from contextlib import contextmanager File "/opt/hadoop_admin/Python-3.8.5/Lib/contextlib.py", line 4, in import _collections_abc SystemError: returned NULL without setting an error generate-posix-vars failed make[1]: *** [pybuilddir.txt] Error 1 make[1]: Leaving directory `/opt/hadoop_admin/Python-3.8.5' make: *** [profile-opt] Error 2 ---------- components: Installation messages: 375737 nosy: thangmanims priority: normal severity: normal status: open title: Compilation issue 3.8.5 with Redhat 7.8 and Red Hat 4.8.5-39 type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 19:41:28 2020 From: report at bugs.python.org (Thangamani) Date: Thu, 20 Aug 2020 23:41:28 +0000 Subject: [issue41603] Compilation issue 3.8.5 with Redhat 7.8 and gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) In-Reply-To: <1597966827.71.0.80485708689.issue41603@roundup.psfhosted.org> Message-ID: <1597966888.69.0.335522613052.issue41603@roundup.psfhosted.org> Change by Thangamani : ---------- title: Compilation issue 3.8.5 with Redhat 7.8 and Red Hat 4.8.5-39 -> Compilation issue 3.8.5 with Redhat 7.8 and gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 20:16:11 2020 From: report at bugs.python.org (Maarten) Date: Fri, 21 Aug 2020 00:16:11 +0000 Subject: [issue41604] [curses.panel] Failed panel.set_userptr will decrement refcount of original userptr Message-ID: <1597968971.01.0.83582874982.issue41604@roundup.psfhosted.org> New submission from Maarten : When ncurses' function `set_panel_userptr` fails, panel.set_userptr should not decrement the reference count of the previous userptr. ---------- components: Library (Lib) messages: 375738 nosy: maarten priority: normal severity: normal status: open title: [curses.panel] Failed panel.set_userptr will decrement refcount of original userptr versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 20:27:14 2020 From: report at bugs.python.org (Maarten) Date: Fri, 21 Aug 2020 00:27:14 +0000 Subject: [issue1723038] Curses Menu Message-ID: <1597969634.39.0.623160255546.issue1723038@roundup.psfhosted.org> Change by Maarten : ---------- nosy: +maarten nosy_count: 5.0 -> 6.0 pull_requests: +21045 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 20:27:55 2020 From: report at bugs.python.org (Maarten) Date: Fri, 21 Aug 2020 00:27:55 +0000 Subject: [issue1723038] Curses Menu Message-ID: <1597969675.65.0.193546710775.issue1723038@roundup.psfhosted.org> Change by Maarten : ---------- pull_requests: -21045 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 20:28:17 2020 From: report at bugs.python.org (Maarten) Date: Fri, 21 Aug 2020 00:28:17 +0000 Subject: [issue41604] [curses.panel] Failed panel.set_userptr will decrement refcount of original userptr In-Reply-To: <1597968971.01.0.83582874982.issue41604@roundup.psfhosted.org> Message-ID: <1597969697.9.0.432943906729.issue41604@roundup.psfhosted.org> Change by Maarten : ---------- keywords: +patch pull_requests: +21046 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 20:51:50 2020 From: report at bugs.python.org (Dima Tisnek) Date: Fri, 21 Aug 2020 00:51:50 +0000 Subject: [issue34730] aclose() doesn't stop raise StopAsyncIteration / GeneratorExit to __anext__() In-Reply-To: <1537316846.03.0.956365154283.issue34730@psf.upfronthosting.co.za> Message-ID: <1597971110.96.0.748257105211.issue34730@roundup.psfhosted.org> Dima Tisnek added the comment: https://github.com/python/cpython/pull/7468 (prohibit asend/etc. reentrance) was merged ~a year ago. Perhaps it's time to restart the original discussion, whether `aclose()` should cancel pending `anext`. ---------- nosy: +Dima.Tisnek versions: +Python 3.10 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 20:57:25 2020 From: report at bugs.python.org (Jens Troeger) Date: Fri, 21 Aug 2020 00:57:25 +0000 Subject: =?utf-8?q?=5Bissue37943=5D_mimetypes=2Eguess=5Fextension=28=29_doesn?= =?utf-8?q?=E2=80=99t_get_JPG_right?= In-Reply-To: <1566687977.17.0.676940180845.issue37943@roundup.psfhosted.org> Message-ID: <1597971445.96.0.940465036235.issue37943@roundup.psfhosted.org> Jens Troeger added the comment: This is still not working: tried it on Python 3.8.5 and Python 3.7.8. >>> import mimetypes >>> mimetypes.guess_extension('image/jpg') >>> mimetypes.guess_extension('image/jpeg') '.jpg' Both should return the same value; I expected the mimetype 'image/jpg' to return extension '.jpg' because that mimetype is used a lot. ---------- resolution: out of date -> remind status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 21:01:05 2020 From: report at bugs.python.org (soyoo) Date: Fri, 21 Aug 2020 01:01:05 +0000 Subject: [issue41605] t = re.sub(".*", "*", src) has different ouput Message-ID: <1597971665.44.0.864871063473.issue41605@roundup.psfhosted.org> New submission from soyoo : import re src = "123" # can be anything t = re.sub(".*", "*", src) """ The output of 't' is different in python2 and python3; When python version is python3, it's depend on OS version. When python version is python2, it seem always output single '*'. When python version is python3, and OS is Linux, it output single '*'; When python version is python3, and OS is Mac or windows, it output double '**'. """ ---------- components: 2to3 (2.x to 3.x conversion tool) files: python3 on windows.png messages: 375741 nosy: soyoo priority: normal severity: normal status: open title: t = re.sub(".*", "*", src) has different ouput type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49418/python3 on windows.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 22:58:28 2020 From: report at bugs.python.org (Nathaniel Smith) Date: Fri, 21 Aug 2020 02:58:28 +0000 Subject: [issue34730] aclose() doesn't stop raise StopAsyncIteration / GeneratorExit to __anext__() In-Reply-To: <1537316846.03.0.956365154283.issue34730@psf.upfronthosting.co.za> Message-ID: <1597978708.12.0.178084101368.issue34730@roundup.psfhosted.org> Nathaniel Smith added the comment: > Perhaps it's time to restart the original discussion, whether `aclose()` should cancel pending `anext`. I'm still not aware of any way to make this work, technically. So it's a moot point unless someone has a proposal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 23:12:19 2020 From: report at bugs.python.org (Dima Tisnek) Date: Fri, 21 Aug 2020 03:12:19 +0000 Subject: [issue34730] aclose() doesn't stop raise StopAsyncIteration / GeneratorExit to __anext__() In-Reply-To: <1537316846.03.0.956365154283.issue34730@psf.upfronthosting.co.za> Message-ID: <1597979539.23.0.607884443937.issue34730@roundup.psfhosted.org> Dima Tisnek added the comment: Then perhaps the issue should be closed ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 20 23:42:56 2020 From: report at bugs.python.org (Maarten) Date: Fri, 21 Aug 2020 03:42:56 +0000 Subject: [issue1723038] Curses Menu Message-ID: <1597981376.52.0.160256605453.issue1723038@roundup.psfhosted.org> Change by Maarten : ---------- pull_requests: +21047 pull_request: https://github.com/python/cpython/pull/21933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 02:25:39 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 21 Aug 2020 06:25:39 +0000 Subject: [issue41586] Allow to set pipe size on subprocess.Popen. In-Reply-To: <1597815960.69.0.196461399013.issue41586@roundup.psfhosted.org> Message-ID: <1597991139.24.0.87068450075.issue41586@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 02:53:29 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 21 Aug 2020 06:53:29 +0000 Subject: [issue4356] Add "key" argument to "bisect" module functions In-Reply-To: <1227115048.67.0.318831592843.issue4356@psf.upfronthosting.co.za> Message-ID: <1597992809.22.0.740787822904.issue4356@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 03:48:03 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 21 Aug 2020 07:48:03 +0000 Subject: [issue41605] t = re.sub(".*", "*", src) has different ouput In-Reply-To: <1597971665.44.0.864871063473.issue41605@roundup.psfhosted.org> Message-ID: <1597996083.89.0.435006715787.issue41605@roundup.psfhosted.org> Eric V. Smith added the comment: I'm suspicious that this differs per-OS. Please provide exact Python version information for each OS you list in your initial report. I suspect what you're seeing is related to this change: Changed in version 3.7: Empty matches for the pattern are replaced when adjacent to a previous non-empty match. ---------- components: +Regular Expressions -2to3 (2.x to 3.x conversion tool) nosy: +eric.smith, ezio.melotti, mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 04:01:43 2020 From: report at bugs.python.org (Salvatore Ingala) Date: Fri, 21 Aug 2020 08:01:43 +0000 Subject: [issue41606] multiprocessing.Event.wait hangs when interrupted by signal that sets the event Message-ID: <1597996903.36.0.845550593577.issue41606@roundup.psfhosted.org> New submission from Salvatore Ingala : According to the docs, multiprocessing.Event is a clone of threading.Event. Yet, there is a strange behavior that is observed only on multiprocessing.Event. If an event.wait() is interrupted by a SIGINT and the signal handler sets the event, then the call to event.set() hangs if event is an instance of multiprocessing.Event, in what looks like a deadlock; instead, it works as expected if it's an instance of threading.Event. See the file attached for a reproduction. It seems to have been so for a long time, see: https://stackoverflow.com/questions/24422154/multiprocessing-event-wait-hangs-when-interrupted-by-a-signal/30831867 ---------- files: event-test.py messages: 375745 nosy: salvatore.ingala priority: normal severity: normal status: open title: multiprocessing.Event.wait hangs when interrupted by signal that sets the event type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49419/event-test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 04:02:28 2020 From: report at bugs.python.org (marco_ocram) Date: Fri, 21 Aug 2020 08:02:28 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1597996948.14.0.70028770611.issue41598@roundup.psfhosted.org> marco_ocram added the comment: thank you very much about the hints, i've improved the code as follows. def rnd(x, n=0): a = x*10**(n + 1) b = int(a) if abs(a - b) >= 0.5: b += 1 if x >= 0 else -1 a = b/10 b = int(a) if abs(a - b) >= 0.5: b += 1 if x >= 0 else -1 return b/10**n def rndup(x, n=0): a = x*10**(n + 1) b = int(a) if abs(a - b) > 0: b += 1 if x >= 0 else -1 a = b/10 b = int(a) if abs(a - b) > 0: b += 1 if x >= 0 else -1 return b/10**n now it manage well your cases ... print(rnd(2.8 - 1.3), 2.8 - 1.3) print(rnd(1.8 - 1.3), 1.8 - 1.3) print(rnd(-2.8 + 1.3), -2.8 + 1.3) print(rnd(-1.8 + 1.3), -1.8 + 1.3) results ... 2.0 1.4999999999999998 1.0 0.5 -2.0 -1.4999999999999998 -1.0 -0.5 we have to define limits caused by the floating point internal representation but for general use in my opinion can work fine. do you see other cases where it cracks? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 04:49:30 2020 From: report at bugs.python.org (Michael Mussato) Date: Fri, 21 Aug 2020 08:49:30 +0000 Subject: [issue41607] pdb - Clickabler path to breakpoints Message-ID: <1597999770.47.0.222044983618.issue41607@roundup.psfhosted.org> New submission from Michael Mussato : Wouldn't it be helpful if the pdb showed the path to the current breakpoint as a clickable link? For this to work, it seems that the path needs to follow a specific format, like so: "File "/full/path/to/file.py", line XY" Currently, it displays the breakpoint like this: "> /full/path/to/file.py(XY).func()" This might be very IDE dependent, but i. e. PyCharm interprets the first format as a clickable link and takes you straight to the line of code that contains the breakpoint. Very helpful. ---------- components: Library (Lib) files: Screenshot 2020-06-12 at 08.37.35.png messages: 375747 nosy: michimussato priority: normal severity: normal status: open title: pdb - Clickabler path to breakpoints type: enhancement Added file: https://bugs.python.org/file49420/Screenshot 2020-06-12 at 08.37.35.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 04:50:30 2020 From: report at bugs.python.org (Michael Mussato) Date: Fri, 21 Aug 2020 08:50:30 +0000 Subject: [issue41607] pdb - Clickable path to breakpoints In-Reply-To: <1597999770.47.0.222044983618.issue41607@roundup.psfhosted.org> Message-ID: <1597999830.62.0.166544324613.issue41607@roundup.psfhosted.org> Change by Michael Mussato : ---------- title: pdb - Clickabler path to breakpoints -> pdb - Clickable path to breakpoints _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 05:11:23 2020 From: report at bugs.python.org (marco_ocram) Date: Fri, 21 Aug 2020 09:11:23 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598001083.91.0.797514115913.issue41598@roundup.psfhosted.org> marco_ocram added the comment: rndup is not correct and rnd work smooth only for numbers about < e16 until they have a fractional part. it's interesting but not simple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 05:38:43 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 21 Aug 2020 09:38:43 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598002723.15.0.254238527296.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: Yes, and these functions are completely fine for your personal library, if you need such things. But they really have no place in math module, since (1) they aren't always correct, (2) it's incredibly difficult to characterize exactly when they are, and (3) even when they are correct, they just give people wrong impression about floats somehow being decimal numbers. If you need to use floats, reconcile yourself with the idea that they don't represent all decimal numbers, not even the ones with just one decimal place, and any algorithm dealing with decimal digits will be just an approximation. If you want the best approximation the humanity can muster, backed with empirical data and theoretical considerations, use the round() builtin. If you want to just have something that works according to your preconceived notions in some cases, while failing mysteriously in others, use your quick-and-dirty implementations. If you want exact decimal results, use the decimal module, and specify the rounding mode as you wish. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 07:27:37 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 11:27:37 +0000 Subject: [issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...) In-Reply-To: <1580120758.52.0.283644207368.issue39461@roundup.psfhosted.org> Message-ID: <1598009257.59.0.0886376010078.issue39461@roundup.psfhosted.org> Terry J. Reedy added the comment: os.environ is initially a copy of the os string-string mapping. That some string values happen to represent file paths is opaque to the mapping. So, to me, looking at os.environ by itself, there is no particular reason to autoconvert Path values but not anything else nor to autoconvert values but not keys. If os.environ['key'] = Path('boo') worked, I would expect os.environ['key2'] = 333 to work. I would consider a new inconsistency here to be worse than the existing one between os.environ and subprocess.Popen(env=...). It would be OK with me if the latter were fixed. It is not unheard of for CPython to accept objects that conceptually should not be. Some instances have be 'grandparented', others not. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 08:19:48 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 21 Aug 2020 12:19:48 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1598012388.5.0.800245134084.issue41572@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset a2d00f04733491a56abec45e7a20fb42282bb4d1 by Miss Islington (bot) in branch '3.9': bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914) (#21929) https://github.com/python/cpython/commit/a2d00f04733491a56abec45e7a20fb42282bb4d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 08:20:05 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 21 Aug 2020 12:20:05 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1598012405.97.0.192780489457.issue41572@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 1370d9dd9fbd71e9d3c250c8e6644e0ee6534fca by Miss Islington (bot) in branch '3.8': bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914) (GH-21930) https://github.com/python/cpython/commit/1370d9dd9fbd71e9d3c250c8e6644e0ee6534fca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 08:20:57 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 21 Aug 2020 12:20:57 +0000 Subject: [issue41572] Documentation wording fix on Lib/asyncio/transports.py In-Reply-To: <1597709735.56.0.50136505299.issue41572@roundup.psfhosted.org> Message-ID: <1598012457.08.0.240394164307.issue41572@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks Cleber. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 09:26:29 2020 From: report at bugs.python.org (E. Paine) Date: Fri, 21 Aug 2020 13:26:29 +0000 Subject: [issue41608] IDLE: not remove multiple spaces if not at start of line Message-ID: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> New submission from E. Paine : I could not think of a better title so will attempt to explain myself better here. Currently, the IDLE smart backspace will delete multiple whitespace up to the tab width even if it is not at the start of the line. Consider the following examples (where the | is where the cursor is when backspace is clicked - the backticks are just to show code not part of the example text): ` |abc def `: IDLE correctly deletes all four spaces as this is considered the indentation of the code. ` abc |def `: IDLE incorrectly deletes both spaces rather than just one (annoying when correcting a typo). The patch proposes IDLE just deletes one space as is normal/expected behaviour. ` abc def |`: IDLE will currently delete both spaces but the proposed patch will just delete one. This behaviour is up for debate as I personally think all trailing whitespace should be cleared by a backspace, but I also think the proposed behaviour is more consistent than the existing behaviour. The patch (a PR to be linked shortly after issue creation) is very simple as we already have the compiled `_line_indent_re` which we can check for a full match on all text before the cursor (`chars`). ---------- assignee: terry.reedy components: IDLE messages: 375754 nosy: epaine, taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE: not remove multiple spaces if not at start of line type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 09:27:36 2020 From: report at bugs.python.org (E. Paine) Date: Fri, 21 Aug 2020 13:27:36 +0000 Subject: [issue41608] IDLE: not remove multiple spaces if not at start of line In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1598016456.33.0.323641759168.issue41608@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch pull_requests: +21048 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 09:33:14 2020 From: report at bugs.python.org (E. Paine) Date: Fri, 21 Aug 2020 13:33:14 +0000 Subject: [issue41608] IDLE: not remove multiple spaces if not at start of line In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1598016794.11.0.0489105178402.issue41608@roundup.psfhosted.org> E. Paine added the comment: Further clarification on the new behaviour: in the shell whitespace after the prompt (>>>) will not be considered an indent and only have one character deleted at a time. However, on a continuation line, any initial whitespace will be considered an indent and the smart backspace behaviour will apply. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 11:31:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Aug 2020 15:31:01 +0000 Subject: [issue41609] pdb's whatis command reports method as function Message-ID: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> New submission from Irit Katriel : pdb's whatis command prints 'Function' instead of 'Method' for a bound method: > python.bat Running Release|Win32 interpreter... Python 3.10.0a0 (heads/master-dirty:12695f4c6d, Aug 21 2020, 15:48:06) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class MyClass: ... def mymethod(self): ... pass ... >>> import pdb >>> pdb.set_trace() --Return-- > (1)()->None (Pdb) whatis MyClass().mymethod Function mymethod (Pdb) MyClass().mymethod > (Pdb) ---------- components: Library (Lib) messages: 375756 nosy: iritkatriel priority: normal severity: normal status: open title: pdb's whatis command reports method as function type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 11:34:02 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Aug 2020 15:34:02 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598024042.67.0.690981362649.issue41609@roundup.psfhosted.org> Irit Katriel added the comment: The reason for this that it first checks whether there is a __code__ attribute (which both methods and functions have) and only afterwards checks for __func__.__code__. I will submit a patch with a test and fix shortly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 11:46:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Aug 2020 15:46:01 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598024761.37.0.906567215769.issue41609@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +21049 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 11:48:35 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 21 Aug 2020 15:48:35 +0000 Subject: [issue41605] t = re.sub(".*", "*", src) has different ouput In-Reply-To: <1597971665.44.0.864871063473.issue41605@roundup.psfhosted.org> Message-ID: <1598024915.53.0.20704086031.issue41605@roundup.psfhosted.org> Ronald Oussoren added the comment: in 3.6 t == '*', in 3.7 and later it is '**'. To be honest I don't like the 3.7 behaviour, it is very surprising even if it is technically correct (the first '*' is from a match from the entire string, the second one is from an empty match at the end of the string). A workaround is to explicitly anchor the regular expression (for example by adding '^' to the start). ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 12:44:22 2020 From: report at bugs.python.org (supriya singh) Date: Fri, 21 Aug 2020 16:44:22 +0000 Subject: [issue41610] Any Raspberry Pi Zero Projects to try? Message-ID: <1598028262.16.0.0744145450871.issue41610@roundup.psfhosted.org> New submission from supriya singh : Not any error or issue just wanted to get some work or to find new friends. Recently I started learning python during this lockdown and with the help of YouTube tutorials I learned a lot. Now I am here to find some Raspberry Pi zero projects that include Python. I have searched on Google and found the project "self-driving car" Now, I want to learn more by trying some more projects so that I can master this language. ---------- messages: 375759 nosy: supriyasingh priority: normal severity: normal status: open title: Any Raspberry Pi Zero Projects to try? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 12:55:07 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 16:55:07 +0000 Subject: [issue41608] IDLE: multiple space deletion by Backspace after non-spaces In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1598028907.87.0.0896052094903.issue41608@roundup.psfhosted.org> Terry J. Reedy added the comment: Your example is 4 spaces, 3 (non-space) chars, 2 spaces, 3 chars, 2 spaces. With the cursor after the 2 internal spaces, backspace deletes 1 space, not 2. However, with the first block expanded from 3 chars to 4, backspace deletes both spaces. Without out looking at the code, the uniform rule, when deleting a space to the left with Backspace, seems to be "Delete up to Indent spaces, stopping at the first non-space char or at a slice position that is a multiple of Indent." Tabs in the text are interpreted as as many spaces needed to get to a position that is a multiple of 8. I tested this with longer space runs and with Indent set to 5. Deleting a space with Delete always deletes one char. So single space deletion is available anywhere. I consider the current behavior as a defensible design decision for a PEP 8 oriented Python code editor. Multiple space deletion is a plus when deleting large space blocks, a minus when lining up multiple continuation lines. While I could imagine turning off multiple space delete for internal blocks, I would rather trailing blocks be deleted all at once. All in all, I consider a change fairly low priority at the moment. The prompt is 4 chars: '>>> '. Anything after that is an indent and should be treated as such. It is the first line of a mini 'file' with one statement. Treating this line differently would be a bug. ---------- title: IDLE: not remove multiple spaces if not at start of line -> IDLE: multiple space deletion by Backspace after non-spaces _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 13:00:39 2020 From: report at bugs.python.org (Ammar Askar) Date: Fri, 21 Aug 2020 17:00:39 +0000 Subject: [issue41610] Any Raspberry Pi Zero Projects to try? In-Reply-To: <1598028262.16.0.0744145450871.issue41610@roundup.psfhosted.org> Message-ID: <1598029239.41.0.000814710679931.issue41610@roundup.psfhosted.org> Ammar Askar added the comment: Hi Supriya, this website is for reporting specific bugs about the Python language itself, not for general discussion. I'd suggest taking a look at https://www.python.org/community/ and https://www.reddit.com/r/learnpython/ to find people to chat with about Python projects. ---------- nosy: +ammar2 resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 13:11:13 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Aug 2020 17:11:13 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598029873.92.0.210939978309.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: > My apologies if nobody cares about this ;-) I care :-) Am in crunch right now, so won't have a chance to work through it for a week or so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 13:28:02 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 21 Aug 2020 17:28:02 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598030882.21.0.560921631586.issue41513@roundup.psfhosted.org> Tim Peters added the comment: > won't have a chance to work through it for a week or so These have been much more in the way of FYI glosses. There's no "suggestion" here to be pursued - just trying to get a deeper understanding of code already written :-) While I can concoct any number of cases where the add_on() method fails correct rounding, all the ones I dug into turned out to be "oops! went the wrong way" in nearest/even tie cases. By any non-anal measure, its accuracy is excellent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 13:51:37 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 21 Aug 2020 17:51:37 +0000 Subject: [issue41611] IDLE warnings and exceptions Message-ID: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> New submission from Raymond Hettinger : In case it is helpful, here is the error log from a recent full-day IDLE session. $ python3.9 --version Python 3.9.0rc1 $ python3.9 -m idlelib.idle Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1885, in __call__ return self.func(*args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 248, in winconfig_event acw_width, acw_height = acw.winfo_width(), acw.winfo_height() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1291, in winfo_width self.tk.call('winfo', 'width', self._w)) _tkinter.TclError: bad window path name ".!listedtoplevel4.!frame.text.!toplevel2" /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' 2020-08-20 15:00:38.074 Python[1512:2706287] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. 2020-08-20 16:29:29.880 Python[1512:2706287] WARNING: running implicitly; please run panels using NSSavePanel rather than NSApplication. ---------- assignee: terry.reedy components: IDLE messages: 375764 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: IDLE warnings and exceptions versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 14:18:01 2020 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 21 Aug 2020 18:18:01 +0000 Subject: [issue41605] t = re.sub(".*", "*", src) has different ouput In-Reply-To: <1597971665.44.0.864871063473.issue41605@roundup.psfhosted.org> Message-ID: <1598033881.56.0.20730944753.issue41605@roundup.psfhosted.org> Thomas Grainger added the comment: seems like a dupe? https://bugs.python.org/issue32308 ---------- keywords: +patch message_count: 3.0 -> 4.0 nosy: +graingert nosy_count: 5.0 -> 6.0 pull_requests: +21050 stage: -> patch review pull_request: https://github.com/python/cpython/pull/4846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 14:49:53 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 21 Aug 2020 18:49:53 +0000 Subject: [issue41605] t = re.sub(".*", "*", src) has different ouput In-Reply-To: <1597971665.44.0.864871063473.issue41605@roundup.psfhosted.org> Message-ID: <1598035793.55.0.387324291926.issue41605@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 16:28:15 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 21 Aug 2020 20:28:15 +0000 Subject: [issue41607] pdb - Clickable path to breakpoints In-Reply-To: <1597999770.47.0.222044983618.issue41607@roundup.psfhosted.org> Message-ID: <1598041695.88.0.81460575556.issue41607@roundup.psfhosted.org> Vedran ?a?i? added the comment: IDLE has Go to File/Line menu too. I think it would also help there. (Terry, can you confirm?) Not to mention that it would be one thing less to explain to beginners when using pdb. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 17:30:16 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 21:30:16 +0000 Subject: [issue41611] IDLE: problem In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1598045416.32.0.070247801757.issue41611@roundup.psfhosted.org> Terry J. Reedy added the comment: The Mac-specific shutdown warning from multiprocessing is not directly related to IDLE. 'multiprocessing' is not imported by IDLE and is not in sys.modules when IDLE starts. >From 'all-day' I assume that there was a time period between starting IDLE and getting the traceback. File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1885, in __call__ return self.func(*args) __call__ here is a method of CallWrapper, often used for event handlers. File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 248, in winconfig_event acw_width, acw_height = acw.winfo_width(), acw.winfo_height() winconfig_event handles tk '' events. "A Configure event is sent to a window whenever its size, position, or border width changes, and sometimes when it has changed position in the stacking order." IDLE triggers it somehow. It has had intermittent bugs before. File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1291, in winfo_width self.tk.call('winfo', 'width', self._w)) _tkinter.TclError: bad window path name ".!listedtoplevel4.!frame.text.!toplevel2" The name is for an editor window (listedtoplevel) with a frame with a text with a popup (unlisted toplevel). The toplevel2 suggests that this is the second popup for this text. The name looks correct except that I expected 'text' to maybe be '!text'. In any case, the name is generated by tkinter without IDLE being involved. ---------- components: +macOS nosy: +ned.deily, ronaldoussoren, serhiy.storchaka title: IDLE warnings and exceptions -> IDLE: problem _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 17:31:09 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 21:31:09 +0000 Subject: [issue41611] IDLE: problem In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1598045469.08.0.468411720627.issue41611@roundup.psfhosted.org> Terry J. Reedy added the comment: Serhiy, should 'text' be '!text' in a tkinter-generated widget name? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 17:34:37 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 21:34:37 +0000 Subject: [issue41611] IDLE: problem In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1598045677.05.0.0497364901038.issue41611@roundup.psfhosted.org> Terry J. Reedy added the comment: On my Macbook Air Mohave, I don't get completion boxes on either 3.8.3rc1 or 3.9.0rc1, even when clicking Edit => Show completions. Nor does IDLE quit or print anything in Terminal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 17:34:57 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 21:34:57 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1598045697.98.0.0142491797447.issue41611@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: IDLE: problem -> IDLE: problems with completions on Mac _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 17:54:32 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 21:54:32 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598046872.91.0.757226573794.issue41513@roundup.psfhosted.org> Terry J. Reedy added the comment: Tim, I have been reading this, without examining all the details, to learn more about FP accuracy problems. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:26:07 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 22:26:07 +0000 Subject: [issue41575] Please use active voice in async docs. In-Reply-To: <1597743322.05.0.268987971288.issue41575@roundup.psfhosted.org> Message-ID: <1598048767.64.0.622294943032.issue41575@roundup.psfhosted.org> Terry J. Reedy added the comment: Active voice is strongly recommended for docstrings in PEP 257 and commit messages somewhere in the Developer guide and applies to docs. The doc for the asyncio call_x functions all start with the active voice: 'Schedule', which is the main action of the function. 'is returned' occurs later in the entries and that case is less clear. ---------- nosy: +Yury.Selivanov, gvanrossum, terry.reedy title: Please use active voice "Return foobar" instead of passive voice "foobar is returned" -> Please use active voice in async docs. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:29:01 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 22:29:01 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1598048941.38.0.963535990181.issue41573@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 7173fc84e61b80b19261e47fca38030206a3a78e by wyz23x2 in branch 'master': bpo-41573: Update release versions in General FAQ (GH-21915) https://github.com/python/cpython/commit/7173fc84e61b80b19261e47fca38030206a3a78e ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:29:17 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 21 Aug 2020 22:29:17 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1598048957.42.0.609359381255.issue41573@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21051 pull_request: https://github.com/python/cpython/pull/21938 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:35:14 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 21 Aug 2020 22:35:14 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1598049314.6.0.918425054548.issue41576@roundup.psfhosted.org> Terry J. Reedy added the comment: PEP 8 discourages the use of bare except. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:38:24 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:38:24 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049504.9.0.0237819562236.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49386/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:38:41 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:38:41 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049521.11.0.0354624799176.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49402/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:38:32 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:38:32 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049512.56.0.901176046791.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49390/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:39:02 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:39:02 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049542.32.0.485579662525.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49395/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:39:07 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:39:07 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049547.75.0.579002815226.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49396/pty.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:38:55 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:38:55 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049535.64.0.688249301538.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49392/after.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:39:19 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:39:19 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049559.95.0.161033802539.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49393/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:38:49 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:38:49 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049529.24.0.629384718942.issue41541@roundup.psfhosted.org> Change by Soumendra Ganguly : Removed file: https://bugs.python.org/file49391/before.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:39:58 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:39:58 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1598049598.39.0.802513558014.issue26228@roundup.psfhosted.org> Change by Soumendra Ganguly : ---------- title: pty.spawn hangs on FreeBSD 9.3, 10.x -> pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:42:29 2020 From: report at bugs.python.org (Soumendra Ganguly) Date: Fri, 21 Aug 2020 22:42:29 +0000 Subject: [issue41541] [PATCH] Make pty.spawn set window size In-Reply-To: <1597340220.32.0.858165521017.issue41541@roundup.psfhosted.org> Message-ID: <1598049749.08.0.71473965768.issue41541@roundup.psfhosted.org> Soumendra Ganguly added the comment: All images, test programs, and old patches have been removed. window resize test is now being performed using stty. On linux: stty -F rows x cols y On BSDs: stty -f rows x cols y to change window size. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 18:50:11 2020 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 21 Aug 2020 22:50:11 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1598050211.39.0.475796079311.issue41602@roundup.psfhosted.org> Thomas Grainger added the comment: adding vstinner, as this seems related to pymain_run_module rather than runpy ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 19:08:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Aug 2020 23:08:01 +0000 Subject: [issue23832] pdb's `longlist` shows only decorator if that one contains a lambda In-Reply-To: <1427834112.73.0.627625379595.issue23832@psf.upfronthosting.co.za> Message-ID: <1598051281.74.0.988118186883.issue23832@roundup.psfhosted.org> Irit Katriel added the comment: I think this has been fixed by now, because I don't see the problem in Python 3.10: python.bat -mpdb tmp1.py Running Release|Win32 interpreter... > c:\users\user\src\cpython\tmp1.py(2)() -> def foo(x, y=None): (Pdb) c Traceback (most recent call last): File "C:\Users\User\src\cpython\lib\pdb.py", line 1740, in main pdb._runscript(mainpyfile) File "C:\Users\User\src\cpython\lib\pdb.py", line 1609, in _runscript self.run(statement) File "C:\Users\User\src\cpython\lib\bdb.py", line 580, in run exec(cmd, globals, locals) File "", line 1, in File "c:\users\user\src\cpython\tmp1.py", line 2, in def foo(x, y=None): File "c:\users\user\src\cpython\tmp1.py", line 9, in spam 1/0 ZeroDivisionError: division by zero Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > c:\users\user\src\cpython\tmp1.py(9)spam() -> 1/0 (Pdb) longlist 5 @foo(foo, lambda a:a) 6 def spam(): 7 0+0 8 1+1 9 -> 1/0 (Pdb) ---------- components: +Library (Lib) nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 19:17:42 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Aug 2020 23:17:42 +0000 Subject: [issue26794] curframe can be None in pdb.py In-Reply-To: <1460965664.24.0.92280915097.issue26794@psf.upfronthosting.co.za> Message-ID: <1598051862.68.0.649544008918.issue26794@roundup.psfhosted.org> Irit Katriel added the comment: Jacek, did you see this happen? My reading of the code is that curframe is initialized in setup(), which is called before curframe is accessed. It can later be modified in _select_frame. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 21 19:25:39 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 21 Aug 2020 23:25:39 +0000 Subject: [issue26794] curframe can be None in pdb.py In-Reply-To: <1460965664.24.0.92280915097.issue26794@psf.upfronthosting.co.za> Message-ID: <1598052339.99.0.145855880451.issue26794@roundup.psfhosted.org> Irit Katriel added the comment: Maybe it was fixed in issue9230 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 00:45:44 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Aug 2020 04:45:44 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598071544.2.0.699850394141.issue41598@roundup.psfhosted.org> Steven D'Aprano added the comment: Vedran: you are quoting von Neumann out of context, he was talking about generating random numbers, not rounding, and in the seven decades since he made his famous witticism, we of course know that there is absolutely nothing wrong with generating random numbers via arithmetical methods so long as you do it correctly :-) I have read your comments in the linked Stackoverflow answer, and I don't agree that we shouldn't be rounding binary floats. I do, however, agree with your comment here that we ought to add a rounding mode to the built-in round function, that would be a much better idea than adding a multitude of individual rounding functions. I proposed this idea some time ago: https://mail.python.org/archives/list/python-dev at python.org/message/DVS3XSAKW37NDD37BE3IOCKRBRV3Y5A6/ ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 01:13:34 2020 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 22 Aug 2020 05:13:34 +0000 Subject: [issue30434] multiprocessing AuthenticationError "digest sent was rejected" In-Reply-To: <1495484655.04.0.0387717474918.issue30434@psf.upfronthosting.co.za> Message-ID: <1598073214.89.0.112632212127.issue30434@roundup.psfhosted.org> Zackery Spytz added the comment: Python 2.7 is no longer supported, so I think this issue should be closed. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 01:17:02 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Aug 2020 05:17:02 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598073422.18.0.723164641361.issue41598@roundup.psfhosted.org> Steven D'Aprano added the comment: Marco, it is better to give a description of the functionality required rather than a simplistic and incorrect implementation :-) (Not that I am likely to provide a better implementation without a lot of study.) Regardless of whether you or I agree with the decision to move to Banker's Rounding, that was done about a decade ago, and it matches decisions made by other languages such as Julia. Changing the default will break people's code and we do not do that lightly, or at all, without a very good reason. As Tim Peters describes here: https://mail.python.org/pipermail/python-dev/2008-January/075873.html many older languages implemented rounding by "add half and chop", more because it was cheap than for its mathematical properties. Are you satisfied that adding a rounding mode to the built-in `round` function is a better solution than a series of functions in the math module? If so, I will change the title to reflect that. Vedran: I don't think the availability of different rounding modes will have any effect at all on whether or not people believe floats are real decimal numbers rather than binary floats. People already believe that. I think we are better off acknowledging that there are reasonable use-cases for different rounding modes even when using floats. According to this: https://www.gnu.org/software/libc/manual/html_node/Rounding.html IEEE-754 only requires four rounding modes, defaulting to the same Banker's Rounding that Python uses. Wikipedia says there are five: https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules Regardless of whether there are four or five, I see no technical reason why we couldn't offer the full set of eight used by the decimal module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 01:21:07 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 22 Aug 2020 05:21:07 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1598073667.18.0.308655935734.issue41576@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a tutorial. The purpose of this part is documenting the bare except clause. It cannot be done without using a bare except in example. There is nothing wrong with a bare except if it used properly (e.g. if the caught exception is reraised). In any case "except BaseException" is not any better, because it is equivalent to a bare except. Note also that PR 21917 introduces an error: instead of printing the type of exception it prints the stringified exception itself (in some case it is an empty string). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 01:30:15 2020 From: report at bugs.python.org (Abael He) Date: Sat, 22 Aug 2020 05:30:15 +0000 Subject: [issue41612] python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame' Message-ID: <1598074215.76.0.483354536095.issue41612@roundup.psfhosted.org> New submission from Abael He : /opt/conda/lib/python3.8/site-packages/prompt_toolkit/shortcuts/prompt.py in prompt(self, message, editing_mode, refresh_interval, vi_mode, lexer, completer, complete_in_thread, is_password, key_bindings, bottom_toolbar, style, color_depth, include_default_pygments_style, style_transformation, swap_light_and_dark_colors, rprompt, multiline, prompt_continuation, wrap_lines, enable_history_search, search_ignore_case, complete_while_typing, validate_while_typing, complete_style, auto_suggest, validator, clipboard, mouse_support, input_processors, reserve_space_for_menu, enable_system_prompt, enable_suspend, enable_open_in_editor, tempfile_suffix, tempfile, default, accept_default, pre_run, set_exception_handler) 992 return get_event_loop().run_until_complete(self._dumb_prompt(self.message)) 993 --> 994 return self.app.run(set_exception_handler=set_exception_handler) 995 996 async def _dumb_prompt(self, message: AnyFormattedText = "") -> _T: /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in run(self, pre_run, set_exception_handler) 809 set_event_loop(loop) 810 --> 811 return loop.run_until_complete( 812 self.run_async(pre_run=pre_run, set_exception_handler=set_exception_handler) 813 ) /opt/conda/lib/python3.8/asyncio/base_events.py in run_until_complete(self, future) 614 raise RuntimeError('Event loop stopped before Future completed.') 615 --> 616 return future.result() 617 618 def stop(self): /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in run_async(self, pre_run, set_exception_handler) 776 loop.set_exception_handler(previous_exc_handler) 777 --> 778 return await _run_async2() 779 780 def run( /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in _run_async2() 764 # `KeyboardInterrupt`, we still want to wait for the 765 # background tasks. --> 766 await self.cancel_and_wait_for_background_tasks() 767 768 # Set the `_is_running` flag to `False`. Normally this /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in cancel_and_wait_for_background_tasks(self) 865 for task in self.background_tasks: 866 try: --> 867 await task 868 except CancelledError: 869 pass /opt/conda/lib/python3.8/site-packages/prompt_toolkit/buffer.py in new_coroutine(*a, **kw) 1852 while True: 1853 try: -> 1854 await coroutine(*a, **kw) 1855 except _Retry: 1856 continue /opt/conda/lib/python3.8/site-packages/prompt_toolkit/buffer.py in async_completer(select_first, select_last, insert_common_part, complete_event) 1681 return self.complete_state == complete_state 1682 -> 1683 async for completion in self.completer.get_completions_async( 1684 document, complete_event 1685 ): /opt/conda/lib/python3.8/site-packages/prompt_toolkit/completion/base.py in get_completions_async(self, document, complete_event) 267 completer = self.get_completer() or DummyCompleter() 268 --> 269 async for completion in completer.get_completions_async( 270 document, complete_event 271 ): /opt/conda/lib/python3.8/site-packages/prompt_toolkit/completion/base.py in get_completions_async(self, document, complete_event) 194 Asynchronous generator of :class:`.Completion` objects. 195 """ --> 196 for item in self.get_completions(document, complete_event): 197 yield item 198 /opt/conda/lib/python3.8/site-packages/IPython/terminal/ptutils.py in get_completions(self, document, complete_event) 114 except Exception as e: 115 from traceback import print_tb --> 116 print_tb(e) 117 118 @staticmethod /opt/conda/lib/python3.8/traceback.py in print_tb(tb, limit, file) 51 method. 52 """ ---> 53 print_list(extract_tb(tb, limit=limit), file=file) 54 55 def format_tb(tb, limit=None): /opt/conda/lib/python3.8/traceback.py in extract_tb(tb, limit) 70 whitespace stripped; if the source is not available it is None. 71 """ ---> 72 return StackSummary.extract(walk_tb(tb), limit=limit) 73 74 # /opt/conda/lib/python3.8/traceback.py in extract(klass, frame_gen, limit, lookup_lines, capture_locals) 345 result = klass() 346 fnames = set() --> 347 for f, lineno in frame_gen: 348 co = f.f_code 349 filename = co.co_filename /opt/conda/lib/python3.8/traceback.py in walk_tb(tb) 310 """ 311 while tb is not None: --> 312 yield tb.tb_frame, tb.tb_lineno 313 tb = tb.tb_next 314 AttributeError: 'KeyError' object has no attribute 'tb_frame' ---------- components: Library (Lib) messages: 375783 nosy: abaelhe priority: normal severity: normal status: open title: python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame' type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 01:50:20 2020 From: report at bugs.python.org (Abael He) Date: Sat, 22 Aug 2020 05:50:20 +0000 Subject: [issue41612] python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame' In-Reply-To: <1598074215.76.0.483354536095.issue41612@roundup.psfhosted.org> Message-ID: <1598075420.6.0.59248240325.issue41612@roundup.psfhosted.org> Abael He added the comment: This is a bug caused by IPython: /opt/conda/lib/python3.8/site-packages/IPython/terminal/ptutils.py in get_completions(self, document, complete_event) 114 except Exception as e: 115 from traceback import print_tb --> 116 print_tb(e) 117 118 @staticmethod ###################################################################### # Simulation investigation for above KeyError: In [3]: def fun(): ...: try: ...: s = {} ...: k = s['0'] ...: except Exception as e: ...: import sys ...: from traceback import print_tb ...: exc_type, exc_value, exc_traceback = sys.exc_info() ...: print_tb(exc_traceback) ...: In [4]: fun() File "", line 4, in fun k = s['0'] ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 03:47:45 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Aug 2020 07:47:45 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1598082465.43.0.995486955713.issue41573@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 429a86a12016ae42ea32d754e0725cbee8e99808 by Miss Islington (bot) in branch '3.9': bpo-41573: Update release versions in General FAQ (GH-21915) (#21938) https://github.com/python/cpython/commit/429a86a12016ae42ea32d754e0725cbee8e99808 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 03:48:09 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 22 Aug 2020 07:48:09 +0000 Subject: [issue41573] Correct wrong sentences in General FAQ In-Reply-To: <1597712868.36.0.452194180345.issue41573@roundup.psfhosted.org> Message-ID: <1598082489.91.0.411306182686.issue41573@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 04:09:03 2020 From: report at bugs.python.org (marco_ocram) Date: Sat, 22 Aug 2020 08:09:03 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598083743.78.0.447676898639.issue41598@roundup.psfhosted.org> marco_ocram added the comment: @Vedran: I'm sorry about my "quick-and-dirty implementations". As i've already stated the problem's more deep i expect, despite the second half up rounding for my needs now (after your observation) work well. I've verified other languages have the same problem with floats operations and roundings. @Steven: "Are you satisfied that adding a rounding mode to the built-in `round` function is a better solution than a series of functions in the math module? If so, I will change the title to reflect that." I fully agree with the sentence and with all the content of your writings. I think the decimal module is excellent and can do an extraordinary work (as extraordinary i suppose was the work of its coders) but floats also are fine for common people use, i see only the rounding as main them problem. It's very unpleasant to round 2.8-1.3 half up and without tricks obtain a misleading results. I think working on the last decimal digit if all are used the problem could be solved, but with a lot of study (at least for me if i have) cause one purpose have to be maintain good performances in addition to results always corrects. This is only a possibility to improve the core language, i think one function with more common rounding ways, as in wikipedia (in gnu c i don't see just "to nearest, ties away from zero" or half up we discuss) or in decimals module, can be useful to reduce the need of individual coders implementation on a not so simple question cause them needs not satisfied by the round() as banking rounding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 04:30:41 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 22 Aug 2020 08:30:41 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598085041.44.0.836079453666.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: I think you don't know what paraphrasing means. Or maybe I don't know it, but in any case, I'm well aware what Von Neumann said, and how it is usually misunderstood in today's society. "Living in the state of sin" is simply an emotionally powerful metaphor, and it pertains to the philosophical impossibility of something, whether or not there are strong reasons to "do it anyway" and even good methods of faking/approximating it. Same as "detecting infinite loops programmatically", "passing objects by value", or "having side effects in a referentially transparent language". :-) I agree that Python is a language where practicality beats purity, and as I said, there is a sensible interface for the implementation about which we agree (except for a detail: I'd actually _force_ people to import the rounding modes from decimal module, to at least hint to them what exactly they are doing and what the preferred approach is). But I still think that arguments for that are very weak. First, yes, there is a very small probability of calculations _randomly_ ending with abc.de50000...0 (in the Platonic sense) [so it actually manifests as a problem], but there is much greater probability (though still small) that calculations _theoretically_ ending with abc.de5 actually end with abc.de49999...7 [and thus are rounded down anyway, despite your insistence on modes]. People _will_ think "hey, I did the right thing by specifying the mode--why does it still acts funny?" "there are reasonable use-cases for different rounding modes even when using floats.": absolutely. But they are _binary_ rounding modes! I think you should read the standard. It is actually two standards, one for binary and one for decimal arithmetic. (The second one is implemented fairly faithfully in the decimal module; the first one is, through libc, the one that Python floats are based upon). The [binary] standard says, more or less, that the result should be as if the value was calculated with the infinite number or extra [binary] digits (of course, in practice it should just be some extra precision, but again, of _binary_ digits), and then, when fitting that value into a smaller [binary] register with smaller available number of [binary] digis, all extra [binary] digits are discarded (not stored) and some ending [binary] digits retained are modified according to the value of some of the discarded [binary] digits and the rounding mode. For example: """ The 24-bit significand will stop at position 23, shown as the underlined bit 0 above. The next bit, at position 24, is called the round bit or rounding bit. It is used to round the 33-bit approximation to the nearest 24-bit number (there are specific rules for halfway values, which is not the case here). This bit, which is 1 in this example, is added to the integer formed by the leftmost 24 bits. """ You see it speaks about _bits_, not decimal digits. In the same way, _decimal_ rounding would take a value calculated with some extra precision of _decimal_ digits, and when storing them with the smaller number of _decimal_ digits, discard extra... blah blah as above. But you cannot round binary numbers to decimal digits. It's as if you tried to round 0.45 to one trinary digit after the integer point. The answer is 0.1 in base 3, but it isn't expressible in decimals. And it doesn't work: >>> Decimal('0.45').quantize(Decimal(1/3)) decimal.InvalidOperation: [] because the authors of quantize have thought about that. The documentation says """Unlike other operations, if the length of the coefficient after the quantize operation would be greater than precision, then an InvalidOperation is signaled.""" In effect, rounding cannot increase the number of significant digits. And it would do that if you're rounding to an incompatible base, whether 2 to 10 or 10 to 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 04:41:43 2020 From: report at bugs.python.org (Yaroslav Pankovych) Date: Sat, 22 Aug 2020 08:41:43 +0000 Subject: [issue21041] pathlib.PurePath.parents rejects negative indexes In-Reply-To: <1395613011.22.0.29152070109.issue21041@psf.upfronthosting.co.za> Message-ID: <1598085703.31.0.572961274521.issue21041@roundup.psfhosted.org> Yaroslav Pankovych added the comment: Any thoughts about that folks? It's a pretty old bug, let's decide smth for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 05:06:39 2020 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 22 Aug 2020 09:06:39 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1598087199.75.0.17528679765.issue40994@roundup.psfhosted.org> Cheryl Sabella added the comment: New changeset 0694b82381ff27e10bb15172da0832a7e65aaa2d by Miss Islington (bot) in branch '3.8': bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880) (#21927) https://github.com/python/cpython/commit/0694b82381ff27e10bb15172da0832a7e65aaa2d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 05:07:01 2020 From: report at bugs.python.org (Cheryl Sabella) Date: Sat, 22 Aug 2020 09:07:01 +0000 Subject: [issue40994] Very confusing documenation for abc.Collections In-Reply-To: <1592334895.01.0.222155011801.issue40994@roundup.psfhosted.org> Message-ID: <1598087221.68.0.44663877564.issue40994@roundup.psfhosted.org> Cheryl Sabella added the comment: New changeset f497bbeed08e5a7f83adecf330b61fb88e9c3fa6 by Miss Islington (bot) in branch '3.9': bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880) (#21926) https://github.com/python/cpython/commit/f497bbeed08e5a7f83adecf330b61fb88e9c3fa6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 05:30:02 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 22 Aug 2020 09:30:02 +0000 Subject: [issue41613] get_type_hints regression for 3.9 and 3.10 Message-ID: <1598088602.53.0.71167650591.issue41613@roundup.psfhosted.org> New submission from Batuhan Taskaya : The attached script works perfectly fine under Python 3.8, but it crashes in 3.9/3.10. $ ./py38/python typing_fail.py (3.8.5+) {'a': , 'b': } $ ./py39/python typing_fail.py (3.9.0rc1+) [SNIP] TypeError: 'NoneType' object is not subscriptable $ ./cpython/python typing_fail.py (3.10.0a0) [SNIP] TypeError: 'NoneType' object is not subscriptable ---------- files: typing_fail.py messages: 375791 nosy: BTaskaya, gvanrossum, levkivskyi, lukasz.langa priority: normal severity: normal status: open title: get_type_hints regression for 3.9 and 3.10 Added file: https://bugs.python.org/file49421/typing_fail.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 05:30:39 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 22 Aug 2020 09:30:39 +0000 Subject: [issue41613] get_type_hints regression for 3.9 and 3.10 In-Reply-To: <1598088602.53.0.71167650591.issue41613@roundup.psfhosted.org> Message-ID: <1598088639.01.0.493730028072.issue41613@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- components: +Library (Lib) versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 05:38:44 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 22 Aug 2020 09:38:44 +0000 Subject: [issue41613] get_type_hints regression for 3.9 and 3.10 In-Reply-To: <1598088602.53.0.71167650591.issue41613@roundup.psfhosted.org> Message-ID: <1598089124.69.0.890639193842.issue41613@roundup.psfhosted.org> Batuhan Taskaya added the comment: This looks like a problem with the __globals__ of the NamedTuple.__new__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 06:01:41 2020 From: report at bugs.python.org (Thomas Grainger) Date: Sat, 22 Aug 2020 10:01:41 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1598090501.38.0.380610348581.issue41576@roundup.psfhosted.org> Thomas Grainger added the comment: The purpose of this tutorial section is to document how to catch all types of exceptions and extract the type and value. When this is required, `BaseException as err:` is the preferred approach. This document still mentions the alternative approach so that readers will know what it means when they encounter it, and know to upgrade it to the py2.4+ syntax ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 07:22:21 2020 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 22 Aug 2020 11:22:21 +0000 Subject: =?utf-8?q?=5Bissue37943=5D_mimetypes=2Eguess=5Fextension=28=29_doesn?= =?utf-8?q?=E2=80=99t_get_JPG_right?= In-Reply-To: <1566687977.17.0.676940180845.issue37943@roundup.psfhosted.org> Message-ID: <1598095341.77.0.496295429301.issue37943@roundup.psfhosted.org> Felipe Rodrigues added the comment: @_savage, on the commit @xtreak referred, there's a note that "image/jpg" and some other non-standard mimetypes are only supported if `strict=False`[1] So, this: >>> mimetypes.guess_extension("image/jpg") Gives no return. But this works: >>> mimetypes.guess_extension("image/jpg", strict=False) '.jpg' --------- I guess we could improve the current documentation [2]. It currently specifies correctly the `strict` behavior: > The optional strict argument is a flag specifying whether the list of known MIME types is limited to > only the official types registered with IANA. When strict is True (the default), only the IANA types > are supported; when strict is False, some additional non-standard but commonly used MIME types are > also recognized. But I think it would be nice to have a table specifying what are those "non-standard but commonly used MIME types". Personally, I'd have a hard time guessing on a regular day of my life which of 'image/jpeg' and 'image/jpg' is standard or not. We could even add a nice note pointing out that the `common_types` property [3] is a list of those supported non-standard type . Given the fact that the `strict` flag is used by different methods with the same behavior, maybe we could add a note on the top of the doc explaining the general meaning of that flag. [1]: https://github.com/python/cpython/commit/2a99fd911ebeecedbb250a05667cd46eca4735b9#diff-fc65388a9cdf41980b2c31de5de67758R547 [2]: https://docs.python.org/3.10/library/mimetypes.html#mimetypes.guess_type [3]: https://docs.python.org/3.10/library/mimetypes.html#mimetypes.common_types ---------- nosy: +fbidu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 07:42:15 2020 From: report at bugs.python.org (Alex Hall) Date: Sat, 22 Aug 2020 11:42:15 +0000 Subject: [issue41614] Items put on Queue in thread in child process sometimes not seen by parent process Message-ID: <1598096535.13.0.114988714243.issue41614@roundup.psfhosted.org> New submission from Alex Hall : See attached file. The summary is that I start a Process, which starts a Thread, which puts some values on a Queue which was originally created by the parent process and passed down. Usually this works but occasionally the parent process doesn't see the items on the queue: queue.get() times out and queue.empty() is True, although queue.qsize() is accurate. I can reproduce this on master: Python 3.10.0a0 (heads/master:802726a, Aug 22 2020, 12:56:09) [GCC 7.5.0] on linux as well as other versions I have installed which I've selected. On 3.6 it seems like the problem is even worse and some of my comments don't apply. I've tested the script on Ubuntu 18.04.4, but the general problem seems to also happen on OSX although I can't confirm that now. ---------- files: queue_bug.py messages: 375795 nosy: alexmojaki priority: normal severity: normal status: open title: Items put on Queue in thread in child process sometimes not seen by parent process versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file49422/queue_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 08:35:24 2020 From: report at bugs.python.org (Jacek Pliszka) Date: Sat, 22 Aug 2020 12:35:24 +0000 Subject: [issue26794] curframe can be None in pdb.py In-Reply-To: <1460965664.24.0.92280915097.issue26794@psf.upfronthosting.co.za> Message-ID: <1598099724.52.0.862856302117.issue26794@roundup.psfhosted.org> Jacek Pliszka added the comment: Haven't seen it since then. Stopped using 2.7 - using 3.6 in production and 3.7 in development now. I believe it can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 08:35:17 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 22 Aug 2020 12:35:17 +0000 Subject: [issue41615] sys.argv may be None or an empty list Message-ID: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> New submission from Jason R. Coombs : In [pypa/keyring#445](https://github.com/pypa/keyring/445) and issue839151, we learned that there are Python interpreters in which `sys.argv` is an empty list, is not a list, or is not initialized at all. Through use of `sys.argv[0]`, the documentation strongly implies that `sys.argv` is always a list of at least one element. The documentation makes no mention of these other cases. It would be nice if the documentation would describe what values (or absence thereof) are valid for `sys.argv`. ---------- assignee: docs at python components: Documentation messages: 375796 nosy: docs at python, jaraco priority: normal severity: normal status: open title: sys.argv may be None or an empty list _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 08:58:20 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Aug 2020 12:58:20 +0000 Subject: [issue23832] pdb's `longlist` shows only decorator if that one contains a lambda In-Reply-To: <1427834112.73.0.627625379595.issue23832@psf.upfronthosting.co.za> Message-ID: <1598101100.75.0.707440633199.issue23832@roundup.psfhosted.org> Irit Katriel added the comment: pdb uses inspect.findsource for this, where this problem was fixed in issue 1764286. I believe this ticket can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 09:43:37 2020 From: report at bugs.python.org (ManPython) Date: Sat, 22 Aug 2020 13:43:37 +0000 Subject: [issue41616] Global variable in whole project and Relative imports problem Message-ID: <1598103817.04.0.76764693555.issue41616@roundup.psfhosted.org> New submission from ManPython : 1. Curently we have easy option to declare global variable (GV) a) like this: global var1 var1 = 'whatever' b) with some improved version like this: global var1 'whatever' or: global var1,var2, 'whatever1','whatever2' c) The Python is in way to produce small lines of code but this philosophy around GV not offering this. 2. Can we have easy option to delclare global variable for whole project including MVC? a) By this is requiments to call GV in any place like in Model, View or Controler and change thits var globaly. b) I noticed that programers many often calling module in main to operate with, where this way made many problems withs Relative imports https://stackoverflow.com/questions/30669474/beyond-top-level-package-error-in-relative-import https://stackoverflow.com/questions/14132789/relative-imports-in-python-2-7/ https://stackoverflow.com/questions/35166821/valueerror-attempted-relative-import-beyond-top-level-package https://stackoverflow.com/questions/40022220/attempted-relative-import-beyond-toplevel-package b) In my test the Relative imports made often problems (As imposible to load - most often Django, but similar with Pyside2) and I noticed that exist some relation with global var. In some of P36 version most often due to libs. Wan't checking this, expecting other way (more easy) to solve typical problems with GV. 1) in Django most often is meeting in config.py 2) in Pyside2 most often is meeting in main.py where we calling model,view,controler (or other liek utils) and we trying working in some core variables that limitig projects to easy manage GV ---------- components: Interpreter Core messages: 375799 nosy: ManPython priority: normal severity: normal status: open title: Global variable in whole project and Relative imports problem type: enhancement versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 10:36:18 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 22 Aug 2020 14:36:18 +0000 Subject: [issue41616] Global variable in whole project and Relative imports problem In-Reply-To: <1598103817.04.0.76764693555.issue41616@roundup.psfhosted.org> Message-ID: <1598106978.34.0.252553444117.issue41616@roundup.psfhosted.org> Steven D'Aprano added the comment: One issue per ticket please. Versions 3.9 and older are all in feature freeze, they will not get new features. Combining a global declaration with an assignment has been requested before, and rejected. If you want to discuss that feature again, you should raise it on the Python-Ideas mailing list first, but unless you have a stronger reason than just saving a line of code, it probably won't be accepted. Project-wide globals has not, as far as I can remember, been requested before, but again it needs to be discussed on Python-Ideas first. Your comments about relative imports don't seem to be either a feature request or a bug report, but just a vague complaint that it often causes problems. Please be more precise. Problems with global variables are nearly always problems with global variables, not bugs with Python. Global variables are very easy to misuse and often cause problems. https://weblogs.asp.net/wallen/6750 http://wiki.c2.com/?GlobalVariablesAreBad ---------- nosy: +steven.daprano 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 Aug 22 10:36:23 2020 From: report at bugs.python.org (Senthil Kumaran) Date: Sat, 22 Aug 2020 14:36:23 +0000 Subject: [issue10486] http.server doesn't set all CGI environment variables In-Reply-To: <1290325295.78.0.545647251788.issue10486@psf.upfronthosting.co.za> Message-ID: <1598106983.25.0.476855695814.issue10486@roundup.psfhosted.org> Senthil Kumaran added the comment: Hello Maarten, > Using cgitb, I found out that the webdriver expects the environment variable `HTTP_X_URWID_METHOD` to be set. The javascript sets the "X-Urwid-Method" header (using XmlHttpRequest), but these are not visible by the CGI python script. > So some scripts extra Meta-Variables neet to be set Thanks for your comment on this old issue. The topic under discussion was about some existing "more standard" CGI variables than special meta variables. Even if the first standard CGI variables issue get exposed, I doubt the meta variables will get added. I will think about considering the minimal change required to accomplish the task and close the issue. ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 12:14:54 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 22 Aug 2020 16:14:54 +0000 Subject: [issue41613] get_type_hints regression for 3.9 and 3.10 In-Reply-To: <1598088602.53.0.71167650591.issue41613@roundup.psfhosted.org> Message-ID: <1598112894.16.0.866459407313.issue41613@roundup.psfhosted.org> Guido van Rossum added the comment: Not nice to snip the traceback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 13:23:35 2020 From: report at bugs.python.org (marco_ocram) Date: Sat, 22 Aug 2020 17:23:35 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598117015.4.0.179152322842.issue41598@roundup.psfhosted.org> marco_ocram added the comment: i think in your long post you have underlined among others: 1. in binary implementation of floats one bit was reserved to rounding; 2. this one bit is not enough to manage a correct rounding in a converted decimal base; my considerations: 3. someone i think had evaluated deciding rounding didn't worth more significative digits; 4. the only solution in general can be use more digits to manage rounding in decimal base, not only one but more (i should think better and experiment on how many); 5. the problem in general cannot be solved by an implementation of rounding but from a revision of the implementation of floats (i have solved pretty well my personal need but i'm speaking in general); 6. this is not really a weak impact i think, despite it's not impossible; 7. and last, i think the current implementation could derive from historical reasons when we worked on 8 bits machines, not 64 bits, and one bit was of worth, but i may be wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 14:28:24 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 22 Aug 2020 18:28:24 +0000 Subject: [issue41598] rnd() + rndup() in math In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598120904.52.0.404444042289.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: > use more digits to manage rounding in decimal base, not only one but more (i should think better and experiment on how many) You don't have to. It's infinitely many. :-P Think, how many decimal digits would you need to accurately round numbers to a closest third (one trinary digit)? Here are some decimal digits: 2.166666666. If the next digit is 5, then it rounds to 2.0. If it is 7, it rounds to 2.1 (base 3). If it is 6, you still don't know anything. It can go arbitrarily far. Of course, the probability is lower with every digit, and at some point it becomes acceptable (you said for yourself it's acceptable even with one extra digit), but it's not mathematically correct. And that one bit was just an illustration. In real life, 64-bit machines usually use at least 80-bit precision, so 16 extra bits. But it doesn't help your case, for the above reasons: this is simply not decimal rounding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 18:51:32 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Aug 2020 22:51:32 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1598136692.02.0.517733106974.issue34798@roundup.psfhosted.org> Irit Katriel added the comment: > At the very least it should be made clear in the documentation that dicts are not compacted. According to https://docs.python.org/3/library/pprint.html compact impacts the way that sequences are displayed, and a dict is not a sequence. So I'm not sure a documentation change is required. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 18:58:36 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 22 Aug 2020 22:58:36 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598137116.79.0.645176808512.issue41609@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 21:02:47 2020 From: report at bugs.python.org (Joshua Root) Date: Sun, 23 Aug 2020 01:02:47 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported Message-ID: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> New submission from Joshua Root : Older clang versions don't have __builtin_bswap16, but it's always used when compiling with clang, which means the build fails with those older versions. The code should use __has_builtin to check. ---------- components: Build messages: 375806 nosy: jmr priority: normal severity: normal status: open title: __builtin_bswap16 is used without checking it is supported type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 21:40:43 2020 From: report at bugs.python.org (Joshua Root) Date: Sun, 23 Aug 2020 01:40:43 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported In-Reply-To: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> Message-ID: <1598146843.3.0.190383992683.issue41617@roundup.psfhosted.org> Change by Joshua Root : ---------- keywords: +patch pull_requests: +21052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 21:43:25 2020 From: report at bugs.python.org (Joshua Root) Date: Sun, 23 Aug 2020 01:43:25 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported In-Reply-To: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> Message-ID: <1598147004.99.0.238923812894.issue41617@roundup.psfhosted.org> Change by Joshua Root : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 22 22:03:55 2020 From: report at bugs.python.org (Joshua Root) Date: Sun, 23 Aug 2020 02:03:55 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported In-Reply-To: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> Message-ID: <1598148235.86.0.228763837873.issue41617@roundup.psfhosted.org> Change by Joshua Root : ---------- pull_requests: +21053 pull_request: https://github.com/python/cpython/pull/21943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 02:16:59 2020 From: report at bugs.python.org (Caleb Hattingh) Date: Sun, 23 Aug 2020 06:16:59 +0000 Subject: [issue41505] asyncio.gather of large streams with limited resources In-Reply-To: <1596849895.25.0.102671243316.issue41505@roundup.psfhosted.org> Message-ID: <1598163419.13.0.107443353976.issue41505@roundup.psfhosted.org> Caleb Hattingh added the comment: The traditional way this done is with a finite number of workers pulling work off a queue. This is straightforward to set up with builtins: from uuid import uuid4 import asyncio, random async def worker(q: asyncio.Queue): while job := await q.get(): print(f"working on job {job}") await asyncio.sleep(random.random() * 5) print(f"Completed job {job}") q.task_done() async def scheduler(q, max_concurrency=5): workers = [] for i in range(max_concurrency): w = asyncio.create_task(worker(q)) workers.append(w) try: await asyncio.gather(*workers) except asyncio.CancelledError: pass async def main(): jobs = [uuid4().hex for i in range(1_000)] q = asyncio.Queue() for job in jobs: await q.put(job) t = asyncio.create_task(scheduler(q)) await q.join() t.cancel() await t if __name__ == "__main__": asyncio.run(main()) A neater API would be something like our Executor API in concurrent.futures, but we don't yet have one of those for asyncio. I started playing with some ideas for this a while ago here: https://github.com/cjrh/coroexecutor Alas, I did not yet add a "max_workers" parameter so that isn't available in my lib yet. I discuss options for implementing that in an issue: https://github.com/cjrh/coroexecutor/issues/2 I believe that the core devs are working on a feature that might also help for this, called "task groups", but I haven't been following closely so I don't know where that's at currently. ---------- nosy: +cjrh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 04:48:18 2020 From: report at bugs.python.org (hai shi) Date: Sun, 23 Aug 2020 08:48:18 +0000 Subject: [issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot() Message-ID: <1598172498.12.0.869607269568.issue41618@roundup.psfhosted.org> New submission from hai shi : In order to resolve bpo41073, we want to extend `PyType_GetSlot()` to accept static types. But there have another question we should be considered: How many slots should be exposed in `PyType_GetSlot()`. petr's opinion from PR-21931:I would not want to expose the Py_tp_as_* slots at all; their contents are covered in other slots that should be used instead. And slots like Py_tp_version_tag are specific to CPython; I don't think they should be exposed in the general C API. ---------- components: C API messages: 375808 nosy: petr.viktorin, shihai1991, vstinner priority: normal severity: normal status: open title: [C API] How many slots of static types should be exposed in PyType_GetSlot() type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 04:50:09 2020 From: report at bugs.python.org (hai shi) Date: Sun, 23 Aug 2020 08:50:09 +0000 Subject: [issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot() In-Reply-To: <1598172498.12.0.869607269568.issue41618@roundup.psfhosted.org> Message-ID: <1598172609.03.0.991655337925.issue41618@roundup.psfhosted.org> hai shi added the comment: related bpo: bpo-41073 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 04:55:11 2020 From: report at bugs.python.org (supriya singh) Date: Sun, 23 Aug 2020 08:55:11 +0000 Subject: [issue41610] Any Raspberry Pi Zero Projects to try? In-Reply-To: <1598028262.16.0.0744145450871.issue41610@roundup.psfhosted.org> Message-ID: <1598172911.75.0.450828338303.issue41610@roundup.psfhosted.org> Change by supriya singh : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 08:34:37 2020 From: report at bugs.python.org (Mika Hawkins) Date: Sun, 23 Aug 2020 12:34:37 +0000 Subject: [issue41610] Any Raspberry Pi Zero Projects to try? In-Reply-To: <1598028262.16.0.0744145450871.issue41610@roundup.psfhosted.org> Message-ID: <1598186077.84.0.781507117489.issue41610@roundup.psfhosted.org> Mika Hawkins added the comment: Hi supriyasingh, Actually, only python experts are here in this forum. Still, I am sharing what I found on Google follow the link given below https://eleggible.com/best-raspberry-pi-zero-projects/ but you have to ask this in the General section of any other forum like https://www.python.org/community/. Hope this will be helpful. Regards, Mika Hawkins ---------- nosy: +Mika_Hawkins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 08:54:10 2020 From: report at bugs.python.org (Paul Moore) Date: Sun, 23 Aug 2020 12:54:10 +0000 Subject: [issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window Message-ID: <1598187250.65.0.957662639779.issue41619@roundup.psfhosted.org> New submission from Paul Moore : The following code pops up an extra console window when run on Windows 10, Python 3.8: from subprocess import DETACHED_PROCESS, Popen p = Popen(["py", "-c", "from time import sleep; sleep(5)"], creationflags=DETACHED_PROCESS) Adding CREATE_NO_WINDOW doesn't help, nor does adding a STARTUPINFO with SW_HIDE. The problem occurs whether the Python interpreter is started via the py.exe wrapper or the actual python.exe. However, changing the process being run from "py" to sys.executable makes the problem go away. I've seen similar issues when using sys.executable, but the script is being called from a virtualenv. I can't find any set of options for Popen that reliably avoids showing a console window when invoked like this. ---------- components: Windows messages: 375811 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Subprocesses created with DETACHED_PROCESS can pop up a console window type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 09:00:22 2020 From: report at bugs.python.org (Paul Moore) Date: Sun, 23 Aug 2020 13:00:22 +0000 Subject: [issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window In-Reply-To: <1598187250.65.0.957662639779.issue41619@roundup.psfhosted.org> Message-ID: <1598187622.86.0.466170024548.issue41619@roundup.psfhosted.org> Paul Moore added the comment: Originally discovered in https://github.com/pypa/virtualenv/issues/1928 - see that issue for more context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 09:26:15 2020 From: report at bugs.python.org (Bernat Gabor) Date: Sun, 23 Aug 2020 13:26:15 +0000 Subject: [issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window In-Reply-To: <1598187250.65.0.957662639779.issue41619@roundup.psfhosted.org> Message-ID: <1598189175.48.0.950296984815.issue41619@roundup.psfhosted.org> Change by Bernat Gabor : ---------- nosy: +Bernat Gabor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 10:04:13 2020 From: report at bugs.python.org (E. Paine) Date: Sun, 23 Aug 2020 14:04:13 +0000 Subject: [issue41608] IDLE: multiple space deletion by Backspace after non-spaces In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1598191453.67.0.272259054386.issue41608@roundup.psfhosted.org> E. Paine added the comment: I have updated the PR for the following two suggestions: > I would rather trailing blocks be deleted all at once > Anything after [the prompt] is an indent and should be treated as such Again, consider the following examples (apologies about the last ones: I have learnt the lesson - always test your examples!). All examples use the default indent width of 4: 8 spaces; cursor - This is currently deleted in blocks of 4 and the patch will not change this behaviour (an indent takes precedence over trailing) 4 spaces; 4 chars; 8 spaces; cursor - As the trailing whitespace is no longer also the indent, all 8 spaces will be deleted 1 char; 2 spaces; cursor; 1 char - This behaviour of the original patch has not changed: the spaces get deleted one at a time In the process of testing this patch, I stumbled across another bug which is, if a continuation line is changed to start with the prompt, IDLE will refuse to delete it. Simple example: type `\`; return; backspace; `>>> `; backspace. I have prepared a branch which resolves this by setting a text mark at the start of the last prompt line and checking for that when refusing to delete prompt characters (if you would like me to create an issue and PR for this). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 10:05:51 2020 From: report at bugs.python.org (Thomas Grainger) Date: Sun, 23 Aug 2020 14:05:51 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1598191551.64.0.495346621858.issue41602@roundup.psfhosted.org> Change by Thomas Grainger : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 10:14:32 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 23 Aug 2020 14:14:32 +0000 Subject: [issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window In-Reply-To: <1598187250.65.0.957662639779.issue41619@roundup.psfhosted.org> Message-ID: <1598192072.95.0.693372755708.issue41619@roundup.psfhosted.org> Eryk Sun added the comment: Creating the py.exe process with creationflags=DETACHED_PROCESS sets a special ConsoleHandle value in its ProcessParameters that makes the base API skip allocating a console session at process startup. However, the launcher itself spawns python.exe normally, without the DETACHED_PROCESS flag. So the base API in the python.exe process allocates a new console session that creates a window. Using creationflags=CREATE_NO_WINDOW resolves the problem. This flag makes the base API in the py.exe process allocate a new console session that doesn't create a window. The child python.exe process inherits this windowless console session. Note that CREATE_NO_WINDOW is ignored if combined with CREATE_NEW_CONSOLE or DETACHED_PROCESS, since the combination makes no sense. You can also use creationflags=CREATE_NEW_CONSOLE with startupinfo=STARTUPINFO(dwFlags=STARTF_USESHOWWINDOW), in which case py.exe allocates a console session with a hidden window. This option is useful if a console application should be able to show the console window later on via ShowWindow(GetConsoleWindow(), SW_SHOW). With CREATE_NO_WINDOW, in contrast, there is no window to show. It should work if creationflags=DETACHED_PROCESS is combined with startupinfo=STARTUPINFO(dwFlags=STARTF_USESHOWWINDOW) because the launcher is supposed to clone its startup information to the child python.exe process, including dwFlags. But there's a bug in run_child in PC/launcher.c. It sets si.dwFlags to STARTF_USESTDHANDLES instead of using a bitwise OR to set the flag value. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 10:18:10 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Aug 2020 14:18:10 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598192290.92.0.843202147959.issue41609@roundup.psfhosted.org> Irit Katriel added the comment: It should really use inspect.* functions but I think that should be done separately from this fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 10:42:15 2020 From: report at bugs.python.org (Paul Moore) Date: Sun, 23 Aug 2020 14:42:15 +0000 Subject: [issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window In-Reply-To: <1598187250.65.0.957662639779.issue41619@roundup.psfhosted.org> Message-ID: <1598193735.11.0.0677663848188.issue41619@roundup.psfhosted.org> Paul Moore added the comment: Confirmed, CREATE_NO_WINDOW works - in my test I used it *with* DETACHED_PROCESS. Is it not a bug that the launcher doesn't respect the value of DETACHED_PROCESS when calling the Python interpreter, though? If nothing else, it means that there are differences between running Python via the launcher and not doing so (which are also evident as differences between a virtual environment and a non-virtual interpreter, as the venv machinery uses the launcher internally). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 11:06:02 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 23 Aug 2020 15:06:02 +0000 Subject: [issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window In-Reply-To: <1598187250.65.0.957662639779.issue41619@roundup.psfhosted.org> Message-ID: <1598195162.16.0.56650523439.issue41619@roundup.psfhosted.org> Eryk Sun added the comment: I suppose that, in addition to fixing the bug with si.dwFlags, code could be added to use DETACHED_PROCESS if GetConsoleCP() returns 0 (i.e. the launcher isn't attached to a console). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 11:53:03 2020 From: report at bugs.python.org (Kevin Amado) Date: Sun, 23 Aug 2020 15:53:03 +0000 Subject: [issue41505] asyncio.gather of large streams with limited resources In-Reply-To: <1596849895.25.0.102671243316.issue41505@roundup.psfhosted.org> Message-ID: <1598197983.25.0.556912192699.issue41505@roundup.psfhosted.org> Kevin Amado added the comment: Yeah definitely it must be workers I've experimented a lot about it and finally found something with an interface similar to asyncio.as_completed - You control concurrency with `workers` parameter - You upper-bound memory usage with `worker_greediness` parameter - Results are yielded back in the same order of the input - Results are yielded! so working over an unknown-sized iterable of `awaitables` like map(func, thins_to_do) or a generator is no problem The implementation may no be the cleanest as it uses some Events and N Queues but it's proven in tests (keep reading to the end) that the overhead is negligible def resolve( awaitables: Iterable[Awaitable[T]], *, workers: int = 1024, worker_greediness: int = 0, ) -> Iterable[Awaitable[T]]: """ if workers < 1: raise ValueError('workers must be >= 1') if worker_greediness < 0: raise ValueError('worker_greediness must be >= 0') if hasattr(awaitables, '__len__'): # A small optimization can be done if we know the length workers = min(workers, len(awaitables)) loop = asyncio.get_event_loop() store: Dict[int, asyncio.Queue] = {} stream, stream_copy = tee(enumerate(awaitables)) stream_finished = asyncio.Event() workers_up = asyncio.Event() workers_tasks: Dict[int, asyncio.Task] = {} async def worker() -> None: done: asyncio.Queue = asyncio.Queue(worker_greediness) for index, awaitable in stream: store[index] = done future = loop.create_future() future.set_result(await schedule(awaitable, loop=loop)) await done.put(future) workers_up.set() workers_up.set() stream_finished.set() async def start_workers() -> None: for index in range(workers): if stream_finished.is_set(): break workers_tasks[index] = asyncio.create_task(worker()) await force_loop_cycle() await workers_up.wait() async def get_one(index: int) -> Awaitable[T]: if not workers_tasks: await start_workers() awaitable = await store.pop(index).get() result: Awaitable[T] = (await awaitable).result() return result for index, _ in stream_copy: yield cast(Awaitable[T], get_one(index)) Some notes on the usage and outputs are part of the docs of this library: https://kamadorueda.github.io/aioextensions/#aioextensions.resolve Here are some proofs about the implementation: - There is bound-concurrency: https://github.com/kamadorueda/aioextensions/blob/4a38cb343ceb0f931b655634195f311745e2db32/test/test___init__.py#L138 - Workers are always busy even if one of them is processing a long-running job: https://github.com/kamadorueda/aioextensions/blob/4a38cb343ceb0f931b655634195f311745e2db32/test/test___init__.py#L131 - Many workers do not add overhead: https://github.com/kamadorueda/aioextensions/blob/4a38cb343ceb0f931b655634195f311745e2db32/test/test___init__.py#L156 - Errors can be caught on retrieval: https://github.com/kamadorueda/aioextensions/blob/4a38cb343ceb0f931b655634195f311745e2db32/test/test___init__.py#L128 ---------- nosy: +kamado2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 12:01:45 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 23 Aug 2020 16:01:45 +0000 Subject: [issue41610] Any Raspberry Pi Zero Projects to try? In-Reply-To: <1598028262.16.0.0744145450871.issue41610@roundup.psfhosted.org> Message-ID: <1598198505.65.0.766082454495.issue41610@roundup.psfhosted.org> Change by Mark Dickinson : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 13:46:22 2020 From: report at bugs.python.org (Brian Rutledge) Date: Sun, 23 Aug 2020 17:46:22 +0000 Subject: [issue37426] getpass.getpass not working with on windows when ctrl+v is used to enter the string In-Reply-To: <1561628977.4.0.232389584594.issue37426@roundup.psfhosted.org> Message-ID: <1598204782.7.0.663986959094.issue37426@roundup.psfhosted.org> Brian Rutledge added the comment: In addition to Ctrl+V, Shift+Insert also doesn't work. This behavior is the same Command Prompt and PowerShell on Windows 10. Workarounds include: - Clicking `Edit > Paste` from the window menu - Enabling `Properties > Options > Use Ctrl+Shift+C/V as Copy/Paste` from the menu - Use right-click to paste - Using the new Windows Terminal: https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701 I stumbled upon this issue while investigating https://github.com/pypa/twine/issues/671. Thanks for writing it up! ---------- nosy: +bhrutledge2 versions: +Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 13:50:44 2020 From: report at bugs.python.org (Iman Tabrizian) Date: Sun, 23 Aug 2020 17:50:44 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped Message-ID: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> New submission from Iman Tabrizian : Result object is null when a test case is skipeed. ---------- messages: 375820 nosy: Tabrizian priority: normal pull_requests: 21054 severity: normal status: open title: Python Unittest does not return results object when the test is skipped versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 14:37:36 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Aug 2020 18:37:36 +0000 Subject: [issue32313] Wrong inspect.getsource for datetime In-Reply-To: <1513201599.09.0.213398074469.issue32313@psf.upfronthosting.co.za> Message-ID: <1598207856.15.0.164612133218.issue32313@roundup.psfhosted.org> Irit Katriel added the comment: The documentation for getfile says "This will fail with a TypeError if the object is a built-in module, class, or function." https://docs.python.org/3/library/inspect.html#inspect.getfile But it doesn't: >>> inspect.getfile(datetime.datetime) 'C:\\Users\\User\\src\\cpython\\lib\\datetime.py' ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 14:48:25 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Aug 2020 18:48:25 +0000 Subject: [issue14611] inspect.getargs fails on some anonymous tuples In-Reply-To: <1334738109.2.0.700206080535.issue14611@psf.upfronthosting.co.za> Message-ID: <1598208505.5.0.539835476222.issue14611@roundup.psfhosted.org> Irit Katriel added the comment: I think this was fixed here: https://github.com/python/cpython/commit/3b23004112aefffa72a3763916d78f12b9e056fe and in any case it's a 2.7-only issue, so can this ticket be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 15:01:16 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 23 Aug 2020 19:01:16 +0000 Subject: [issue37426] getpass.getpass not working with on windows when ctrl+v is used to enter the string In-Reply-To: <1561628977.4.0.232389584594.issue37426@roundup.psfhosted.org> Message-ID: <1598209276.43.0.678468214725.issue37426@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 15:04:06 2020 From: report at bugs.python.org (Moshe Morad) Date: Sun, 23 Aug 2020 19:04:06 +0000 Subject: [issue41621] defaultdict miss behave when using default_factory passed as kwargs Message-ID: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> New submission from Moshe Morad : How to reproduce ---------------- >>> from collections import defaultdict >>> dd = defaultdict(default_factory=list) >>> dd defaultdict(None, {'default_factory': }) >>> print(dd.default_factory) None Analysis -------- defdict_init(PyObject *self, PyObject *args, PyObject *kwds) function that initializing defaultdict object ignores the kwds and pass them to the dict init only. Expect: ------- Since we can understand why we want to move kwds to dict without modification consider at least adding comment in the docstring or enforce it as positional argument only. ---------- assignee: docs at python components: Documentation, ctypes messages: 375823 nosy: docs at python, moshemorad12340 priority: normal severity: normal status: open title: defaultdict miss behave when using default_factory passed as kwargs type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 15:23:21 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 23 Aug 2020 19:23:21 +0000 Subject: [issue41621] defaultdict miss behave when using default_factory passed as kwargs In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1598210601.09.0.172471703664.issue41621@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 15:31:09 2020 From: report at bugs.python.org (George Melikov) Date: Sun, 23 Aug 2020 19:31:09 +0000 Subject: [issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support In-Reply-To: <1581793568.31.0.586113837137.issue39640@roundup.psfhosted.org> Message-ID: <1598211069.85.0.85651687489.issue39640@roundup.psfhosted.org> George Melikov added the comment: PR rebased and ready to review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 15:37:28 2020 From: report at bugs.python.org (Brett Cannon) Date: Sun, 23 Aug 2020 19:37:28 +0000 Subject: [issue38302] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **= In-Reply-To: <1569621315.69.0.377751123288.issue38302@roundup.psfhosted.org> Message-ID: <1598211448.77.0.20798817618.issue38302@roundup.psfhosted.org> Brett Cannon added the comment: It turns out **= ONLY calls __ipow__ and neither __pow__ or __rpow__ as the data model says should be called. - Data Model: https://docs.python.org/3/reference/datamodel.html#object.__ipow__ - PyNumber_InPlacePower(): https://github.com/python/cpython/blob/802726acf6048338394a6a4750835c2cdd6a947b/Objects/abstract.c#L1159 - ternary_op (which is what is used to implement PyNumber_InPlacePower(): https://github.com/python/cpython/blob/802726acf6048338394a6a4750835c2cdd6a947b/Objects/abstract.c#L849 ---------- nosy: +brett.cannon priority: normal -> high title: __rpow__ not reached when __ipow__ returns NotImplemented -> __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **= versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 16:34:50 2020 From: report at bugs.python.org (jack1142) Date: Sun, 23 Aug 2020 20:34:50 +0000 Subject: [issue41622] Add support for emoji-data.txt and emoji-variation-sequences.txt to unicodedata Message-ID: <1598214890.63.0.84270917383.issue41622@roundup.psfhosted.org> New submission from jack1142 : `emoji-data.txt` and `emoji-variation-sequences.txt` files were formally pulled into the UCD as of Version 13.0 [1] so I think that unicodedata as a package providing access to UCD could support those as well. In particular: - `emoji-data.txt` lists character properties for emoji characters [2] - `emoji-variation-sequences.txt` lists valid text and emoji presentation sequences [3] Data from `emoji-variation-sequences.txt` can be used to ensure consistent rendering of emoji characters across devices [4] (`StandardizedVariants.txt` has a similar purpose for non-emoji characters). I'm not entirely sure of the use cases for `emoji-data.txt`, but because it's also newly added in UCD 13.0.0, I figured I at least shouldn't omit it when making this issue. [1] https://www.unicode.org/reports/tr44/#Change_History - Changes in Unicode 13.0.0, "Emoji Data" section [2] https://www.unicode.org/reports/tr51/#Emoji_Properties_and_Data_Files [3] https://www.unicode.org/reports/tr51/#Emoji_Variation_Sequences [4] https://unicode.org/faq/vs.html#1 ---------- components: Unicode messages: 375826 nosy: ezio.melotti, jack1142, vstinner priority: normal severity: normal status: open title: Add support for emoji-data.txt and emoji-variation-sequences.txt to unicodedata type: enhancement versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 17:42:21 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Aug 2020 21:42:21 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598218941.8.0.176409571766.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm ready to more forward on this one. I've improved the assertions, explanations, and variable names. I also added references to show that the foundations are firm. After tens of millions of trials, I haven't found a single misrounding. I can't prove "correctly rounded" but am content with "highly accurate". The speed is comparable to what we had in 3.7, so I think it is a net win all around. ---------- priority: low -> normal resolution: fixed -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 17:55:25 2020 From: report at bugs.python.org (Jens Troeger) Date: Sun, 23 Aug 2020 21:55:25 +0000 Subject: =?utf-8?q?=5Bissue37943=5D_mimetypes=2Eguess=5Fextension=28=29_doesn?= =?utf-8?q?=E2=80=99t_get_JPG_right?= In-Reply-To: <1566687977.17.0.676940180845.issue37943@roundup.psfhosted.org> Message-ID: <1598219725.71.0.862530561389.issue37943@roundup.psfhosted.org> Jens Troeger added the comment: @fbidu, oh I missed that, thank you! Shall I close the issue again, or what?s the common procedure in this case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 19:09:10 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Aug 2020 23:09:10 +0000 Subject: [issue41513] Scale by power of two in math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598224150.71.0.688848291773.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg375827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 19:11:17 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 23 Aug 2020 23:11:17 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598224277.57.0.599544700795.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm ready to move forward on this one. Have improved the assertions, explanations, and variable names. Hve also added references to show that the foundations are firm. After tens of millions of trials, I haven't found a single misrounding. I can't prove "correctly rounded" but am content with "high accuracy". The speed is comparable to what we had in 3.7, so I think it is a net win all around. ---------- title: Scale by power of two in math.hypot() -> High accuracy math.hypot() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 19:23:58 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 23 Aug 2020 23:23:58 +0000 Subject: [issue24622] tokenize.py: missing EXACT_TOKEN_TYPES In-Reply-To: <1436729377.89.0.451182448624.issue24622@psf.upfronthosting.co.za> Message-ID: <1598225038.67.0.454638281319.issue24622@roundup.psfhosted.org> Guido van Rossum added the comment: Closing, this is out of date. EXACT_TOKEN_TYPES has been moved to token.py in 3.8 and is now automatically generated from Grammar/Tokens. 3.7 is too old to fix. ---------- nosy: +gvanrossum resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 21:22:06 2020 From: report at bugs.python.org (Matt Joiner) Date: Mon, 24 Aug 2020 01:22:06 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1598232126.6.0.369362660121.issue41564@roundup.psfhosted.org> Change by Matt Joiner : Added file: https://bugs.python.org/file49423/hex.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 21:23:27 2020 From: report at bugs.python.org (Matt Joiner) Date: Mon, 24 Aug 2020 01:23:27 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1598232207.7.0.703068621253.issue41564@roundup.psfhosted.org> Matt Joiner added the comment: $ pyright hex.py stubPath /Users/anacrolix/src/dht-scraper/typings is not a valid directory. Assuming Python platform Darwin Searching for source files Found 1 source file /Users/anacrolix/src/dht-scraper/hex.py 3:9 - error: Cannot access member "hex" for type "ByteString" Member "hex" is unknown (reportGeneralTypeIssues) 1 error, 0 warnings Completed in 0.562sec anacrolix at anacrolix-mbp-2018:~/src/dht-scraper$ mypy hex.py hex.py:3: error: "ByteString" has no attribute "hex" Found 1 error in 1 file (checked 1 source file) anacrolix at anacrolix-mbp-2018:~/src/dht-scraper$ python3 hex.py deadbeef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 21:27:20 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 24 Aug 2020 01:27:20 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1598232440.6.0.819376900431.issue41564@roundup.psfhosted.org> Eric V. Smith added the comment: This looks like a problem in pyright, not in CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 21:31:59 2020 From: report at bugs.python.org (Matt Joiner) Date: Mon, 24 Aug 2020 01:31:59 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1598232719.46.0.129095414614.issue41564@roundup.psfhosted.org> Matt Joiner added the comment: I do not think so. mypy has the same issue. The ByteString type does not include the methods shared by all its implementations. I already linked to this in https://bugs.python.org/msg375553. I also showed that mypy doesn't work in my last comment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 22:06:57 2020 From: report at bugs.python.org (Jeffrey Kintscher) Date: Mon, 24 Aug 2020 02:06:57 +0000 Subject: [issue41564] Cannot access member "hex" for type "ByteString" In-Reply-To: <1597632634.33.0.93200483748.issue41564@roundup.psfhosted.org> Message-ID: <1598234817.51.0.0172629317205.issue41564@roundup.psfhosted.org> Jeffrey Kintscher added the comment: hex.py works for me with CPython versions 3.5, 3.7, 3.8, and 3.9, and the master branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 23 23:50:03 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 24 Aug 2020 03:50:03 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported In-Reply-To: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> Message-ID: <1598241003.94.0.611057285749.issue41617@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 00:26:23 2020 From: report at bugs.python.org (Josh Rosenberg) Date: Mon, 24 Aug 2020 04:26:23 +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: <1598243183.06.0.806078162314.issue36379@roundup.psfhosted.org> Josh Rosenberg added the comment: Zackery, should this be closed? Or is there something missing from the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 02:17:46 2020 From: report at bugs.python.org (Ruben Vorderman) Date: Mon, 24 Aug 2020 06:17:46 +0000 Subject: [issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l) In-Reply-To: <1597652346.68.0.240792775725.issue41566@roundup.psfhosted.org> Message-ID: <1598249866.39.0.51688009063.issue41566@roundup.psfhosted.org> Ruben Vorderman added the comment: > If you take this route, please don't write it directly against the CPython C-API (as you would for a CPython stdlib module). Thanks for reminding me of this. I was planning to take the laziest route possible anyway, reusing as much code from cpython as possible. I will probably start with a minimal implementation of these base classes https://github.com/python/cpython/blob/master/Lib/_compression.py using cython, using the gzip implementation in cpython as guidance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 04:28:59 2020 From: report at bugs.python.org (Mototsugu Emori) Date: Mon, 24 Aug 2020 08:28:59 +0000 Subject: [issue41596] Re: Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range In-Reply-To: <1597909671.37.0.412048973684.issue41596@roundup.psfhosted.org> Message-ID: <1598257739.14.0.645329453332.issue41596@roundup.psfhosted.org> Mototsugu Emori added the comment: Thank you for your reply. I understand that websocket cannot be used in multiple threads. I close the issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 04:29:36 2020 From: report at bugs.python.org (Mototsugu Emori) Date: Mon, 24 Aug 2020 08:29:36 +0000 Subject: [issue41597] Fatal Error on SSL Transport - sslv3 alert bad record mac In-Reply-To: <1597910265.16.0.778996337527.issue41597@roundup.psfhosted.org> Message-ID: <1598257776.22.0.0376127655233.issue41597@roundup.psfhosted.org> Mototsugu Emori added the comment: Thank you for your reply. I understand that websocket cannot be used in multiple threads. I close the issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 05:58:16 2020 From: report at bugs.python.org (simin lin) Date: Mon, 24 Aug 2020 09:58:16 +0000 Subject: [issue41623] What's the by-design behavior when os.fork() is invoked in an asyncio loop? Message-ID: <1598263096.24.0.301943200855.issue41623@roundup.psfhosted.org> New submission from simin lin : I have the same quesion in stackoverflow. Please refer to https://stackoverflow.com/questions/63558555/whats-the-by-design-behavior-when-os-fork-is-invoked-in-an-asyncio-loop to get a better format. Does asyncio work with os.fork()? Code Snippet 1: import asyncio import os import aiohttp async def main(): url = "https://google.com" pid = os.fork() if pid == 0: # child process print("in child process") await fetch(url) print("in child process done") else: print("in parent process") await asyncio.sleep(20) print("in parent process done") async def fetch(url): async with aiohttp.ClientSession() as session: async with session.get(url) as response: return await response.text() if __name__ == "__main__": asyncio.run(main()) Code above works fine. Code Snippet 2: import asyncio import os import aiohttp async def main(): url = "https://google.com" pid = os.fork() if pid == 0: # child process print("in child process") await asyncio.sleep(10) # different with code snippet 1 # await fetch(url) print("in child process done") else: print("in parent process") await asyncio.sleep(20) print("in parent process done") async def fetch(url): async with aiohttp.ClientSession() as session: async with session.get(url) as response: return await response.text() if __name__ == "__main__": asyncio.run(main()) Code above will raise following exception: Traceback (most recent call last): File "fork_sleep.py", line 28, in asyncio.run(main()) File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "fork_sleep.py", line 13, in main await asyncio.sleep(10) # different with code snippet 1 File "/usr/lib/python3.8/asyncio/tasks.py", line 637, in sleep loop = events.get_running_loop() RuntimeError: no running event loop The reason for the "no running event loop" exception is that function get_running_loop compare the os.getpid() and the pid saved in loop. When they are different, the exception above is raised. Please refer to the following code from cpython source code. def get_running_loop(): """Return the running event loop. Raise a RuntimeError if there is none. This function is thread-specific. """ # NOTE: this function is implemented in C (see _asynciomodule.c) loop = _get_running_loop() if loop is None: raise RuntimeError('no running event loop') return loop def _get_running_loop(): """Return the running event loop or None. This is a low-level function intended to be used by event loops. This function is thread-specific. """ # NOTE: this function is implemented in C (see _asynciomodule.c) running_loop, pid = _running_loop.loop_pid if running_loop is not None and pid == os.getpid(): return running_loop So it seems that asyncio event loop works fine in child process if you don't touch the function get_running_loop. My question is, what is the by-design behavior? Why the author check the pid in function _get_running_loop? And what is the solution if you encounter the "no running event loop" in child process. ---------- components: asyncio messages: 375839 nosy: asvetlov, linsm08, yselivanov priority: normal severity: normal status: open title: What's the by-design behavior when os.fork() is invoked in an asyncio loop? type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 06:14:28 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 24 Aug 2020 10:14:28 +0000 Subject: [issue41621] defaultdict miss behave when using default_factory passed as kwargs In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1598264068.67.0.492149331993.issue41621@roundup.psfhosted.org> Ronald Oussoren added the comment: This is intentional behaviour, the factory can only be passed as a positional argument. The documentation[1] mentions this, although its probably possible to write this a bit clearer. [1] https://docs.python.org/3.8/library/collections.html#collections.defaultdict ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 08:33:44 2020 From: report at bugs.python.org (MingZhe Hu) Date: Mon, 24 Aug 2020 12:33:44 +0000 Subject: [issue41624] typing.Coroutine documentation Message-ID: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> New submission from MingZhe Hu : The documentation [1] for Coroutine in typing library writes: class typing.Coroutine(Awaitable[V_co], Generic[T_co T_contra, V_co]) which should be: class typing.Coroutine(Awaitable[V_co], Generic[T_co, T_contra, V_co]) a comma is missed between the first type variable T_co and the second one T_contr. [1] https://docs.python.org/3/library/typing.html#typing.Generic ---------- assignee: docs at python components: Documentation messages: 375841 nosy: Elaphurus, docs at python priority: normal severity: normal status: open title: typing.Coroutine documentation versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 09:21:46 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 24 Aug 2020 13:21:46 +0000 Subject: [issue41621] defaultdict miss behave when using default_factory passed as kwargs In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1598275306.74.0.0191006314761.issue41621@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch nosy: +Dennis Sweeney nosy_count: 3.0 -> 4.0 pull_requests: +21055 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 09:48:30 2020 From: report at bugs.python.org (Thorsten) Date: Mon, 24 Aug 2020 13:48:30 +0000 Subject: [issue13828] Further improve casefold documentation In-Reply-To: <1326992763.46.0.576190503242.issue13828@psf.upfronthosting.co.za> Message-ID: <1598276910.56.0.53966239892.issue13828@roundup.psfhosted.org> Thorsten added the comment: German example in casefolding is plain incorrect. #Casefolding is similar to lowercasing but more aggressive because it is #intended to remove all case distinctions in a string. For example, the #German lowercase letter '?' is equivalent to "ss". Since it is already #lowercase, lower() would do nothing to '?'; casefold() converts it to #"ss". It is not true that "?" is equivalent to "ss" and has not been since an orthography reform in 1996. These are to be used in distinct use cases. "?" after a diphthong or a long/open vowel. "ss" after a short/closed vowel. The documentation correctly describes (in this case) how Python handles the .casefold() for this letter, although the behavior itself is incorrect. As mentioned before, in 2017 an official upper-case version of "?" has been introduced into German orthography: "?". The German example should be stated as current incorrect behavior in the documentation. +1 to adding previously mentioned sentence: In addition to lowercasing, this function also expands ligatures, for example, "?" becomes "fi". ---------- nosy: +MrSupertash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 09:49:20 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 24 Aug 2020 13:49:20 +0000 Subject: [issue41621] defaultdict miss behave when using default_factory passed as kwargs In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1598276960.72.0.751320790291.issue41621@roundup.psfhosted.org> Dennis Sweeney added the comment: PR 21945 changes the signature: - defaultdict(default_factory[, ...]) + defaultdict(default_factory=None, /, [...]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 09:52:36 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 24 Aug 2020 13:52:36 +0000 Subject: [issue13828] Further improve casefold documentation In-Reply-To: <1326992763.46.0.576190503242.issue13828@psf.upfronthosting.co.za> Message-ID: <1598277156.35.0.489845967953.issue13828@roundup.psfhosted.org> Benjamin Peterson added the comment: Correctness of casefolding is defined by the Unicode standard, which currently states that "?" folds to "ss". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 10:27:18 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Aug 2020 14:27:18 +0000 Subject: [issue41623] What's the by-design behavior when os.fork() is invoked in an asyncio loop? In-Reply-To: <1598263096.24.0.301943200855.issue41623@roundup.psfhosted.org> Message-ID: <1598279238.78.0.189432178809.issue41623@roundup.psfhosted.org> Guido van Rossum added the comment: As you,can tell from thencode this by design. The child,must create a new event loop explicitly,ifmitmwants to use asyncio, and all,existing Futures are off limits. Fork is dangerous. Don't use unless you understand it. ---------- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 10:27:26 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 24 Aug 2020 14:27:26 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598279246.87.0.415430896769.issue41624@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks for the report. This seems to be a reasonable suggestion. Would you like to open a PR for this? ---------- keywords: +easy, newcomer friendly nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:01:42 2020 From: report at bugs.python.org (Thorsten) Date: Mon, 24 Aug 2020 15:01:42 +0000 Subject: [issue13828] Further improve casefold documentation In-Reply-To: <1326992763.46.0.576190503242.issue13828@psf.upfronthosting.co.za> Message-ID: <1598281302.81.0.368160654486.issue13828@roundup.psfhosted.org> Thorsten added the comment: I see. I found the documents. That's an issue. That usage is incorrect. It is still valid to upper case "?" to SS since "?" is fairly new as an official German character, but the other way around is not valid. As such the current sentence in documentation also just does not make sense. >"Since it is already lowercase, lower() would do nothing to '?'" Exactly. Why would it? It is nonsensical to change an already lowercase character with a lowercase function. Suggest to update to: "For example, the Unicode standard for German lower case letter '?' prescribes full casefolding to 'ss'. Since it is already lowercase, lower() would do nothing to '?'; casefold() converts it to 'ss'. In addition to full lowercasing, this function also expands ligatures, for example, '?' becomes 'fi'." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:02:10 2020 From: report at bugs.python.org (r1kk3r) Date: Mon, 24 Aug 2020 15:02:10 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 In-Reply-To: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> Message-ID: <1598281330.9.0.615377140864.issue41534@roundup.psfhosted.org> r1kk3r added the comment: Another issue: parser = argparse.ArgumentParser(allow_abbrev=False) parser.add_argument('-verbose', type=int, required=True, dest="bla", help="bla") known_args, rest_of_args = parser.parse_known_args(["-v", "-verbose=2"]) With python 3.8.5 test.py: error: argument -verbose: expected one argument With python 3.7.8 This is really annoying. Argparse tries to do "smart" things where it shouldn't. I want it to parse -verbose, I never told him that -v is an alias for -verbose... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:14:18 2020 From: report at bugs.python.org (Maarten) Date: Mon, 24 Aug 2020 15:14:18 +0000 Subject: [issue31526] Allow setting timestamp in gzip-compressed tarfiles In-Reply-To: <1505884271.66.0.629388109764.issue31526@psf.upfronthosting.co.za> Message-ID: <1598282058.45.0.850479662595.issue31526@roundup.psfhosted.org> Maarten added the comment: I have the same issue. The timestamp is inserted here: https://github.com/python/cpython/blob/802726acf6048338394a6a4750835c2cdd6a947b/Lib/tarfile.py#L419-L420 Because I noticed the timestamp was not included in the timestamp, I could zero it by doing: ``` with open(gzipped_tarball,"r+b") as f: f.seek(4, 0) f.write(b"\x00\x00\x00\x00") ``` ---------- nosy: +maarten _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:22:17 2020 From: report at bugs.python.org (Maarten) Date: Mon, 24 Aug 2020 15:22:17 +0000 Subject: [issue31526] Allow setting timestamp in gzip-compressed tarfiles In-Reply-To: <1505884271.66.0.629388109764.issue31526@psf.upfronthosting.co.za> Message-ID: <1598282537.04.0.669673442959.issue31526@roundup.psfhosted.org> Maarten added the comment: My previous comment should have contained: Because I noticed the timestamp was not included in the CRC, ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:52:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Aug 2020 15:52:33 +0000 Subject: [issue39603] [security] http.client: HTTP Header Injection in the HTTP method In-Reply-To: <1581362975.61.0.33794022777.issue39603@roundup.psfhosted.org> Message-ID: <1598284353.81.0.0893498803902.issue39603@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21056 pull_request: https://github.com/python/cpython/pull/21946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:57:18 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Aug 2020 15:57:18 +0000 Subject: [issue41625] Add splice() to the os module Message-ID: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : The splice system call moves data between two file descriptors without copying between kernel address space and user address space. This can be a very useful addition for libraries implementing low-level file management. ---------- messages: 375851 nosy: pablogsal priority: normal severity: normal status: open title: Add splice() to the os module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 11:57:28 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Aug 2020 15:57:28 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598284648.5.0.478910993578.issue41625@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- assignee: -> pablogsal components: +Library (Lib) versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:01:14 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Aug 2020 16:01:14 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598284874.16.0.379545119542.issue41625@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +21057 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:02:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Aug 2020 16:02:11 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598284931.64.0.930996528376.issue41625@roundup.psfhosted.org> STINNER Victor added the comment: I don't recall the subtle differences between sendfile() and splice(). I recall that in early Linux versions, one was limited to sockets, and only on one side. But later, it became possible to pass two sockets, or one file on disk and one socket, etc. Python exposes sendfile() as os.sendfile() since Python 3.3: https://docs.python.org/dev/library/os.html#os.sendfile ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:04:40 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Aug 2020 16:04:40 +0000 Subject: [issue38378] os.sendfile() has improperly named parameter In-Reply-To: <1570287843.24.0.0727618245068.issue38378@roundup.psfhosted.org> Message-ID: <1598285080.94.0.137943703066.issue38378@roundup.psfhosted.org> STINNER Victor added the comment: I would prefer "2. Make "out" and "in" positional-only parameters". It would be a minor incompatible change, but it would make os.sendfile() more consistent with other functions like os.write() which only has positional-only parameters. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:06:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Aug 2020 16:06:17 +0000 Subject: [issue38378] os.sendfile() has improperly named parameter In-Reply-To: <1570287843.24.0.0727618245068.issue38378@roundup.psfhosted.org> Message-ID: <1598285177.48.0.918476976268.issue38378@roundup.psfhosted.org> STINNER Victor added the comment: Well, since os.sendfile(in=fd) raises a syntax error, I don't think that it's really a backward incompatible change in practice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:28:45 2020 From: report at bugs.python.org (hai shi) Date: Mon, 24 Aug 2020 16:28:45 +0000 Subject: [issue41626] port shebang of tools from python2 to python3 Message-ID: <1598286525.38.0.443257169426.issue41626@roundup.psfhosted.org> New submission from hai shi : After the EOL of python2, the shebang of tools should be ported from python2 to python3. some files like: https://github.com/python/cpython/blob/master/Objects/typeslots.py#L1 ---------- messages: 375855 nosy: shihai1991 priority: normal severity: normal status: open title: port shebang of tools from python2 to python3 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:30:34 2020 From: report at bugs.python.org (hai shi) Date: Mon, 24 Aug 2020 16:30:34 +0000 Subject: [issue41626] port shebang of tools from python2 to python3 In-Reply-To: <1598286525.38.0.443257169426.issue41626@roundup.psfhosted.org> Message-ID: <1598286634.9.0.406705260483.issue41626@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch pull_requests: +21058 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21948 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:33:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Aug 2020 16:33:09 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported In-Reply-To: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> Message-ID: <1598286789.23.0.399233270981.issue41617@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21059 pull_request: https://github.com/python/cpython/pull/21949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 12:35:36 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 24 Aug 2020 16:35:36 +0000 Subject: [issue41617] __builtin_bswap16 is used without checking it is supported In-Reply-To: <1598144567.0.0.176317601198.issue41617@roundup.psfhosted.org> Message-ID: <1598286936.66.0.925233104638.issue41617@roundup.psfhosted.org> STINNER Victor added the comment: > Older clang versions don't have __builtin_bswap16, According to https://github.com/nodejs/node/pull/7644 it's available in clang 3.2 but not in clang 3.0. I wrote PR 21949 to fix the issue: it only uses __has_builtin() if __clang__ is defined, it's different than PR 21942. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 13:30:18 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 24 Aug 2020 17:30:18 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598290218.7.0.100661261551.issue41625@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I don't recall the subtle differences between sendfile() and splice(). Basically, splice() is specialized for pipes: splice() only works if one of the file descriptors refer to a pipe. So you can use for e.g. socket-to-pipe or pipe-to-file without copying the data into userspace. But you can't do file-to-file copies with it. sendfile() only works if the source file descriptor refers to something that can be mmap()ed (i.e. mostly normal files) and before 2.6.33 the destination must be a socket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 13:39:41 2020 From: report at bugs.python.org (Jim Jewett) Date: Mon, 24 Aug 2020 17:39:41 +0000 Subject: [issue13828] Further improve casefold documentation In-Reply-To: <1598281302.81.0.368160654486.issue13828@roundup.psfhosted.org> Message-ID: Jim Jewett added the comment: Unicode probably won't make the correction, because of backwards compatibility. I do support the sentence suggested in Thorsten's most recent reply. Is expanding ligatures the only other normalization it does? Ideally, we should also mention that it shifts to the canonical case, which is usually (but not always) lowercase. I think Cherokee is one that folds to the upper case. On Mon, Aug 24, 2020 at 11:02 AM Thorsten wrote: > > Thorsten added the comment: > > I see. I found the documents. That's an issue. That usage is incorrect. It > is still valid to upper case "?" to SS since "?" is fairly new as an > official German character, but the other way around is not valid. > > As such the current sentence in documentation also just does not make > sense. > > >"Since it is already lowercase, lower() would do nothing to '?'" > > Exactly. Why would it? It is nonsensical to change an already lowercase > character with a lowercase function. > > Suggest to update to: > > "For example, the Unicode standard for German lower case letter '?' > prescribes full casefolding to 'ss'. Since it is already lowercase, lower() > would do nothing to '?'; casefold() converts it to 'ss'. > In addition to full lowercasing, this function also expands ligatures, for > example, '?' becomes 'fi'." > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 14:44:53 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 24 Aug 2020 18:44:53 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598294693.87.0.69038409668.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49424/hypot_flow.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 15:32:06 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 24 Aug 2020 19:32:06 +0000 Subject: [issue38533] v3.7.5 py script run ok with python.exe but not pythonw.exe (python silent console not working) In-Reply-To: <1571545903.38.0.511013655415.issue38533@roundup.psfhosted.org> Message-ID: <1598297526.88.0.101247299508.issue38533@roundup.psfhosted.org> Steve Dower added the comment: Assuming the fix for this was released, given lack of other information. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 15:33:05 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 24 Aug 2020 19:33:05 +0000 Subject: [issue41376] site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected In-Reply-To: <1595517731.78.0.301651868818.issue41376@roundup.psfhosted.org> Message-ID: <1598297585.33.0.17530726595.issue41376@roundup.psfhosted.org> Change by Steve Dower : ---------- versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 15:45:31 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 24 Aug 2020 19:45:31 +0000 Subject: [issue41627] Relocate user site packages on Windows 32-bit Message-ID: <1598298331.25.0.959731633335.issue41627@roundup.psfhosted.org> New submission from Steve Dower : Currently, the user site packages on Windows is %APPDATA%\Python\PythonXY. This can cause conflicts between the 32-bit and 64-bit versions of the runtime. We should switch the pattern to Python{sys.winver}, which is XY or XY-32, the same as elsewhere. This is a breaking change to tools that try to manage these directly, but it shouldn't need a deprecation cycle (there isn't really anywhere to raise a warning...). So I think we can just update Lib/sysconfig.py and Lib/site.py for 3.10, as well as the docs. ---------- components: Windows messages: 375860 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Relocate user site packages on Windows 32-bit versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 16:41:41 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 24 Aug 2020 20:41:41 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598301701.63.0.313622462211.issue39010@roundup.psfhosted.org> Steve Dower added the comment: Any input from the asyncio experts? I don't have an issue with handling the exception in this case, and hopefully when someone is up to the task of dealing with the range of edge cases throughout this loop implementation, hopefully they can get the ordering of waits right. ---------- nosy: +steve.dower versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 18:36:59 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 24 Aug 2020 22:36:59 +0000 Subject: [issue41616] Global variable in whole project and Relative imports problem In-Reply-To: <1598103817.04.0.76764693555.issue41616@roundup.psfhosted.org> Message-ID: <1598308619.62.0.560934415591.issue41616@roundup.psfhosted.org> Change by Guido van Rossum : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 19:31:52 2020 From: report at bugs.python.org (Tom Most) Date: Mon, 24 Aug 2020 23:31:52 +0000 Subject: [issue41628] All unittest.mock autospec-generated methods are coroutine functions Message-ID: <1598311912.52.0.893321210218.issue41628@roundup.psfhosted.org> New submission from Tom Most : Given a class: class Foo: def bar(self): pass And an autospec'd mock of it: foo_mock = mock.create_autospec(spec=Foo) The result of `asyncio.iscoroutinefunction()` differs: asyncio.iscoroutinefunction(Foo.bar) # -> False asyncio.iscoroutinefunction(foo_mock.bar) # -> True This behavior is the same on Python 3.7 and 3.8. I've attached a demonstration script, repro4.py. Here is the output on Python 3.7.9: $ python3.7 repro4.py baz is a coroutine function? False Foo.bar is a coroutine function? False foo_instance.bar is a coroutine function? False baz_mock is a coroutine function? False foo_mock.bar is a coroutine function? True foo_mock_instance.bar is a coroutine function? True foo_mock_mock.bar is a coroutine function? False foo_mock_mock_instance.bar is a coroutine function? False foo_mock_instance.bar() -> foo_mock_mock_instance.bar() -> And on Python 3.8.2: python3.8 repro4.py baz is a coroutine function? False Foo.bar is a coroutine function? False foo_instance.bar is a coroutine function? False baz_mock is a coroutine function? False foo_mock.bar is a coroutine function? True foo_mock_instance.bar is a coroutine function? True foo_mock_mock.bar is a coroutine function? True foo_mock_mock_instance.bar is a coroutine function? False foo_mock_instance.bar() -> foo_mock_mock_instance.bar() -> ---------- components: Library (Lib) files: repro4.py messages: 375862 nosy: twm priority: normal severity: normal status: open title: All unittest.mock autospec-generated methods are coroutine functions type: behavior versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file49425/repro4.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 19:32:59 2020 From: report at bugs.python.org (mike bayer) Date: Mon, 24 Aug 2020 23:32:59 +0000 Subject: [issue41629] __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? Message-ID: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org> New submission from mike bayer : This is likely related or a dupe of https://bugs.python.org/issue29270, but the error message is different. I'm posting this to confirm it's the same issue, or not, and to at least provide a google result for people who also see this error as 29270 seems to imply this might not be fixable. Like 29270, it involves the fact that the interpreter seems to be looking at my super() call inside of a method without actually calling it, and then getting upset about __classcell__: from typing import NamedTuple class X(NamedTuple): a: str b: str # comment this out to remove the issue def foo(self): return super(X, self) and that's it! on my interpreter: Python 3.8.3 (default, May 23 2020, 16:34:37) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] on linux I get: $ python test3.py Traceback (most recent call last): File "test3.py", line 4, in class X(NamedTuple): RuntimeError: __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? The most surprising thing is that this seems extremely basic and google is not finding this error message for me. ---------- components: Interpreter Core messages: 375863 nosy: zzzeek priority: normal severity: normal status: open title: __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 19:36:50 2020 From: report at bugs.python.org (Tom Most) Date: Mon, 24 Aug 2020 23:36:50 +0000 Subject: [issue41628] All unittest.mock autospec-generated methods are coroutine functions In-Reply-To: <1598311912.52.0.893321210218.issue41628@roundup.psfhosted.org> Message-ID: <1598312210.81.0.120628749566.issue41628@roundup.psfhosted.org> Tom Most added the comment: Note that this can interact poorly with AsyncMock, introduced in Python 3.8, because it causes a mock generated from a mock produces an object with async methods rather than regular ones. In Python 3.7 chaining mocks like this would produce regular methods. (This is how I discovered this issue.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 19:56:45 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 24 Aug 2020 23:56:45 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598313405.51.0.134809566497.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: All the review comments have been addressed. I think it is a good as it can get. Any objections to committing the PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 19:58:15 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 24 Aug 2020 23:58:15 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598313495.72.0.784346691413.issue41513@roundup.psfhosted.org> Tim Peters added the comment: Do it! It's elegant and practical :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 20:40:31 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Aug 2020 00:40:31 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598316031.82.0.258107146542.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 8e19c8be87017f6bef8e4c936b1e6ddacb558ad2 by Raymond Hettinger in branch 'master': bpo-41513: More accurate hypot() (GH-21916) https://github.com/python/cpython/commit/8e19c8be87017f6bef8e4c936b1e6ddacb558ad2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 20:41:44 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 25 Aug 2020 00:41:44 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598316104.31.0.975045545436.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: Done! Thank you. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 22:46:11 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 25 Aug 2020 02:46:11 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598323571.03.0.866319182895.issue41598@roundup.psfhosted.org> Steven D'Aprano added the comment: Okay Marco, I'm changing the title to reflect the new API (support for rounding modes rather than new round functions) and pushed the version to 3.10, since 3.9 is in feature freeze (no new features). This will probably need to be discussed on Python-Ideas, and maybe a PEP written, but provided it is not too controversial it may not be a big complicated PEP and I'm happy to help. There is certainly a history of people requesting something like this: https://kingant.net/2019/01/rounding-numbers-in-python-2-and-python-3/ https://mail.python.org/archives/list/python-dev at python.org/thread/34QNDXZBMP6RR4P6NZFFIJK6YODEWSVK/ It will help very much if Mark, Raymond and Tim either support this idea or at least don't object. (Adding Tim to the nosy list.) See also relevant discussion here: https://bugs.python.org/issue32956 In my innocence, I don't think that this will be a very difficult feature to implement. Out of the five IEEE-754 rounding modes: - Round to nearest, ties away to even already exists, so no extra work needs to be done. - Round to nearest, ties away from zero was already implemented in Python 2, so we can just(?) resurrect that. - Round toward 0 (truncation or chop) is equivalent to rounding down for positive numbers and rounding up for negatives, so if we can implement those, we get round towards 0. - And I think that rounding up and rounding down are symmetrical, so if you can do one, you can do the other. As Vedran correctly points out, the tricky part is adjusting for the difference between decimal digits and bits. Dotnet provides rounding modes for Math.Round: https://docs.microsoft.com/en-us/dotnet/api/system.midpointrounding?view=netcore-3.1 So does Julia: http://www.jlhub.com/julia/manual/en/function/round http://www.jlhub.com/julia/manual/en/function/get_rounding so I think that there is precedence for this in other languages. ---------- nosy: +tim.peters title: rnd() + rndup() in math -> Adding support for rounding modes to builtin round versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 24 23:18:27 2020 From: report at bugs.python.org (paul j3) Date: Tue, 25 Aug 2020 03:18:27 +0000 Subject: [issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8 In-Reply-To: <1597255813.65.0.986302240119.issue41534@roundup.psfhosted.org> Message-ID: <1598325507.45.0.422851673425.issue41534@roundup.psfhosted.org> paul j3 added the comment: In your first example: In [29]: parser = argparse39.ArgumentParser(allow_abbrev=True) In [30]: parser.add_argument('-o'); In [32]: parser.parse_known_args(['-o','test']) Out[32]: (Namespace(o='test'), []) In [33]: parser.parse_known_args(['-object','test']) Out[33]: (Namespace(o='bject'), ['test']) Here the '-object' is interpreted as '-o' flag, with value the rest of the string. That's normal behavior for a short option. In [34]: parser.parse_known_args(['-o','test1','-object','test2']) Out[34]: (Namespace(o='bject'), ['test2']) Same thing only '-object' has overwritten the 'test1' value. In your second example: In [39]: parser = argparse39.ArgumentParser(allow_abbrev=False) In [40]: parser.add_argument('-verbose'); In [42]: parser.parse_known_args(['-v', '-verbose=2']) usage: ipython3 [-h] [-verbose VERBOSE] ipython3: error: argument -verbose: expected one argument Expected uses: In [46]: parser.parse_known_args(['-verbose','two']) Out[46]: (Namespace(verbose='two'), []) In [47]: parser.parse_known_args(['-verbose=2']) Out[47]: (Namespace(verbose='2'), []) The '-ver' is not accepted as abbreviation: In [48]: parser.parse_known_args(['-ver=2']) Out[48]: (Namespace(verbose=None), ['-ver=2']) 'allow_abbrev' doesn't have effect because of '-verbose' If instead I define '--verbose', I can turn the abbrev on/off: In [49]: parser = argparse39.ArgumentParser(allow_abbrev=False) In [50]: parser.add_argument('--verbose'); In [51]: parser.parse_known_args(['-ver=2']) Out[51]: (Namespace(verbose=None), ['-ver=2']) In [52]: parser.parse_known_args(['--ver=2']) Out[52]: (Namespace(verbose=None), ['--ver=2']) In [53]: parser.allow_abbrev=True In [54]: parser.parse_known_args(['--ver=2']) Out[54]: (Namespace(verbose='2'), []) There are a lot of variations to examine here. The original, the 3.7, and 3.8 versions. abbrev False or True. Proper long option (--), improper etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 00:15:19 2020 From: report at bugs.python.org (Maarten) Date: Tue, 25 Aug 2020 04:15:19 +0000 Subject: [issue41630] Visual Studio does not build the curses and curses.panel module Message-ID: <1598328919.18.0.0711977156478.issue41630@roundup.psfhosted.org> New submission from Maarten : When building python using Visual Studio, the curses and curses.module, are not getting built. ---------- components: Build, Library (Lib) messages: 375871 nosy: maarten priority: normal severity: normal status: open title: Visual Studio does not build the curses and curses.panel module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 00:23:24 2020 From: report at bugs.python.org (Maarten) Date: Tue, 25 Aug 2020 04:23:24 +0000 Subject: [issue41630] Visual Studio does not build the curses and curses.panel module In-Reply-To: <1598328919.18.0.0711977156478.issue41630@roundup.psfhosted.org> Message-ID: <1598329404.53.0.0565514139321.issue41630@roundup.psfhosted.org> Change by Maarten : ---------- keywords: +patch pull_requests: +21060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 00:59:09 2020 From: report at bugs.python.org (Sergey Fedoseev) Date: Tue, 25 Aug 2020 04:59:09 +0000 Subject: [issue35276] Document thread safety In-Reply-To: <1542628208.58.0.788709270274.issue35276@psf.upfronthosting.co.za> Message-ID: <1598331549.78.0.225212745834.issue35276@roundup.psfhosted.org> Change by Sergey Fedoseev : ---------- nosy: +sir-sigurd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 02:03:29 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 Aug 2020 06:03:29 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598335409.84.0.846320724231.issue41625@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 02:25:18 2020 From: report at bugs.python.org (MingZhe Hu) Date: Tue, 25 Aug 2020 06:25:18 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598336718.82.0.353752795939.issue41624@roundup.psfhosted.org> Change by MingZhe Hu : ---------- keywords: +patch pull_requests: +21061 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 03:17:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 25 Aug 2020 07:17:35 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598339855.51.0.254995330195.issue41625@roundup.psfhosted.org> Serhiy Storchaka added the comment: The API of splice() looks complicated. How would you use it in Python? Are off_in and off_out adjusted as in copy_file_range() and sendfile()? It is not clear from the man page. If they are, how would you return updated values? Are you going to add vmsplice() and tee() too? Since it is Linux-specific API, would not be better to add a purposed module linux? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:17:33 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 25 Aug 2020 09:17:33 +0000 Subject: [issue41628] All unittest.mock autospec-generated methods are coroutine functions In-Reply-To: <1598311912.52.0.893321210218.issue41628@roundup.psfhosted.org> Message-ID: <1598347053.6.0.309527839763.issue41628@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lisroach, xtreak versions: +Python 3.10, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:21:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Aug 2020 09:21:45 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598347305.26.0.954552954474.issue41625@roundup.psfhosted.org> STINNER Victor added the comment: > Are you going to add vmsplice() and tee() too? Since it is Linux-specific API, would not be better to add a purposed module linux? It's not uncommon that a syscall added to the Linux kernel is later added to other platforms. Example: getrandom() exists in Linux and Solaris. Example: memfd_create() was designed in Linux, and added later to FreeBSD: https://github.com/freebsd/freebsd/commit/575e351fdd996f72921b87e71c2c26466e887ed2 (see bpo-41013). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:21:55 2020 From: report at bugs.python.org (=?utf-8?q?Federico_Tabb=C3=B2?=) Date: Tue, 25 Aug 2020 09:21:55 +0000 Subject: [issue37369] Issue with pip in venv on Powershell in Windows In-Reply-To: <1561161256.11.0.32935812019.issue37369@roundup.psfhosted.org> Message-ID: <1598347315.78.0.463973162214.issue37369@roundup.psfhosted.org> Federico Tabb? added the comment: Hello and sorry for reopening this issue but I have it as well. The problem is that Powershell has case-sensitive commands and pip is trying to call path completely in minor case PS C:\Users\federico.Tabbo\git\nexus2aci\env\Scripts> .\Activate.ps1 (env) PS C:\Users\federico.Tabbo\git\nexus2aci\env\Scripts> Fatal error in launcher: Unable to create process using '"c:\users\federico.tabbo\git\nexus2aci\env\scripts\python.exe" "C:\Users\federico.Tabbo\git\nexus2aci\env\Scripts\pip.exe" ': The system cannot find the file specified. if I run the lowercase path I get an error (env) PS C:\Users\federico.Tabbo\git\nexus2aci\env\Scripts> c:\users\federico.tabbo\git\nexus2aci\env\scripts\python.exe c:\users\federico.tabbo\git\nexus2aci\env\scripts\python.exe : The term 'c:\users\federico.tabbo\git\nexus2aci\env\scripts\python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + c:\users\federico.tabbo\git\nexus2aci\env\scripts\python.exe + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (c:\users\federi...ipts\python.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException Running the correct case path works (env) PS C:\Users\federico.Tabbo\git\nexus2aci\env\Scripts> c:\Users\federico.Tabbo\git\nexus2aci\env\Scripts\python.exe Python 3.8.4rc1 (tags/v3.8.4rc1:6c38841, Jun 30 2020, 15:17:30) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> ---------- nosy: +federico2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:25:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Aug 2020 09:25:17 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598347517.96.0.895897781402.issue41625@roundup.psfhosted.org> STINNER Victor added the comment: OpenBSD uses a different API: https://man.openbsd.org/sosplice.9 int sosplice(struct socket *so, int fd, off_t max, struct timeval *tv); int somove(struct socket *so, int wait); "The function sosplice() is used to splice together a source and a drain socket." "The function somove() transfers data from the source's receive buffer to the drain's send buffer." "Socket splicing can be invoked from userland via the setsockopt(2) system-call at the SOL_SOCKET level with the socket option SO_SPLICE." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:47:04 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Aug 2020 09:47:04 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598348824.7.0.93216117646.issue41625@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > The API of splice() looks complicated. How would you use it in Python? It has the same API as copy_file_range and other similar system calls that we already expose, so we just need to do the same thing we do there. > Are off_in and off_out adjusted as in copy_file_range() and sendfile()? It is not clear from the man page. If they are, how would you return updated values? It behaves the same as in copy_file_range() with the exception that one has to be None (the one associated with the pipe file descriptor). We don't return the updated values (neither we do in copy_file_range()). > Are you going to add vmsplice() and tee() too? Since it is Linux-specific API, would not be better to add a purposed module linux? We can certainly discuss adding vmsplice() and tee() (probably tee is more interesting), but in my humble oppinion that would be a different discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:49:50 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Aug 2020 09:49:50 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598348990.02.0.395037412293.issue41625@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > OpenBSD uses a different API: The semantics are considerably different (splice() is about pipes while sosplice() talks about general sockets). Also, the point of splice() is to skip copying from kernel buffers, but sosplice() does not mention that it does not copy between userspace and kernel space ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:51:34 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Aug 2020 09:51:34 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598349094.85.0.375166918081.issue41625@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Since it is Linux-specific API, would not be better to add a purposed module linux? This is an interesting point, but I think that at this particular point it would be more confusing for users than not (normally people go to the os module for system calls) and as Victor mention, we would need to update the os module if some other operative system adds the system call later ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:52:06 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 Aug 2020 09:52:06 +0000 Subject: [issue40912] _PyOS_SigintEvent is never closed on Windows In-Reply-To: <1591641593.68.0.465410581538.issue40912@roundup.psfhosted.org> Message-ID: <1598349126.21.0.844414205156.issue40912@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 05:53:36 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 25 Aug 2020 09:53:36 +0000 Subject: [issue41629] __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? In-Reply-To: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org> Message-ID: <1598349216.37.0.427483812127.issue41629@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The example used to raise deprecation warning in python 3.7 python3.7 -Wall ../backups/bpo41629.py ../backups/bpo41629.py:4: DeprecationWarning: __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? class X(NamedTuple): It was converted into RuntimeError in https://github.com/python/cpython/commit/f5e7b1999f46e592d42dfab51563ea5411946fb7 . Related https://bugs.python.org/issue23722 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:05:58 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 25 Aug 2020 10:05:58 +0000 Subject: [issue41629] __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? In-Reply-To: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org> Message-ID: <1598349958.54.0.141821529328.issue41629@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Related SO questions : * https://stackoverflow.com/questions/61543768/super-in-a-typing-namedtuple-subclass-fails-in-python-3-8 * https://stackoverflow.com/questions/41343263/provide-classcell-example-for-python-3-6-metaclass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:08:11 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 25 Aug 2020 10:08:11 +0000 Subject: [issue41630] Visual Studio does not build the curses and curses.panel module In-Reply-To: <1598328919.18.0.0711977156478.issue41630@roundup.psfhosted.org> Message-ID: <1598350091.12.0.80080833376.issue41630@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows -Library (Lib) nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:16:01 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Aug 2020 10:16:01 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import Message-ID: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> New submission from STINNER Victor : Building Mercurial with Python 3.9.0rc1 fails with the error: SystemError: returned NULL without setting an error The problem comes from the PyAST_Check() function. This function calls get_global_ast_state() which gets the state of the _ast module. If the module is not imported yet, it is imported. The problem is that Mercurial monkey-patches the __import__() builtin function to implement lazy imports. get_global_ast_state() calls PyImport_Import() which returns a Mercurial _LazyModule(__name__='_ast', ...) object. Calling get_ast_state() (PyModule_GetState()) on it is unsafe since it's not the _ast extension module, but another module (which has no state, PyModule_GetState() returns NULL). https://bugzilla.redhat.com/show_bug.cgi?id=1871992#c1 -- The _ast extension module was modified multiple times recently: * September 2019: The extension was converted to PEP 384 (stable ABI): bpo-38113, commit ac46eb4ad6662cf6d771b20d8963658b2186c48c * July 2020: The extension was converted to PEP 489 (multiphase init): bpo-41194, commit b1cc6ba73a51d5cc3aeb113b5e7378fb50a0e20a * (and bugfixes: see bpo-41194 and bpo-41204) I did the PEP 489 change to fix a regression caused by the first change (PEP 384), two bugs in fact: * bpo-41194 Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once * bpo-41261: 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval ---------- components: Library (Lib) messages: 375881 nosy: vstinner priority: release blocker severity: normal status: open title: _ast module: get_global_ast_state() doesn't work with Mercurial lazy import versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:17:49 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 25 Aug 2020 10:17:49 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598350669.5.0.354210621105.issue41631@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:18:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Aug 2020 10:18:46 +0000 Subject: [issue38113] Remove statics from ast.c In-Reply-To: <1568210711.23.0.951109613555.issue38113@roundup.psfhosted.org> Message-ID: <1598350726.19.0.401544123998.issue38113@roundup.psfhosted.org> STINNER Victor added the comment: > This change introduced a subtle regression: bpo-41194. I modified the _ast module to use again a global state: (...) Sadly, my fix doesn't work in all cases, there is yet another bug: bpo-41631 "_ast module: get_global_ast_state() doesn't work with Mercurial lazy import". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:17:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Aug 2020 10:17:37 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598350657.61.0.345204976877.issue41631@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:19:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Tue, 25 Aug 2020 10:19:56 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598350796.53.0.537854154314.issue41631@roundup.psfhosted.org> STINNER Victor added the comment: One option is to revert all AST changes of bpo-38113 (and following changes), to move back to the state before bpo-38113, until all issues are addressed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:28:28 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Aug 2020 10:28:28 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598351308.06.0.761150003216.issue41631@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:29:02 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 25 Aug 2020 10:29:02 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598351342.91.0.975882004972.issue41631@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Given how close are we to a release for 3.9 we should try to maximize stability. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:30:06 2020 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 25 Aug 2020 10:30:06 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598351406.87.0.299933035056.issue41598@roundup.psfhosted.org> Mark Dickinson added the comment: > I don't think that this will be a very difficult feature to implement. Agreed that it shouldn't be hard to implement, if we do the obvious thing (rounding the exact value that the float represents, rather than trying to do some sort of Do What I Mean rounding). But I'm far from convinced that it's a good idea. I think it'll increase user confusion and generate lots of spurious "Python's round is broken" bug reports. To be clear: supporting rounding modes for rounding from float to integer is fine (i.e., supporting the ndigits=0 case, or the case where ndigits is not supplied at all). The confusion is going to arise with rounding to a particular number of decimal places with a given rounding mode. Note: there are two parts to this - the first part is figuring out what functionality we want. The second part is figuring out how best to spell it (separate functions versus keyword arguments to round, etc.). I'm mostly ignoring the second part for now and concentrating on the first part. There's a lot to discuss with the second part too (e.g., how does the __round__ protocol change, in a way that doesn't break 3rd party types already using it; how do we specify rounding modes, etc.), but it doesn't seem so useful to have that discussion until the first part is figured out. Two examples to illustrate, one with a round-to-nearest rounding mode, one with a directed rounding mode: - What would you expect round(2.675, ndigits=2, mode=ROUND_HALF_UP) to give? I strongly suspect that Marco would expect and want a result of 2.68. But if we follow the existing rules for round, it's going to give 2.67. - What would you expect round(2.712, ndigits=3, mode=ROUND_UP) to give? The binary float given by the literal 2.712 is just a touch larger than 2.712, so it should round up, giving 2.713. But again, I doubt that's what users will expect or want. Even worse, the rounding is not idempotent: the float 2.713 is again a little larger than Decimal("2.713"), so it rounds up again: so if we round the value 2.712 twice to 3 digits using ROUND_UP, we'll get 2.714. Tricks like the power of 10 scaling in the original post aren't really a solution: they just serve to make it even less predictable when the users' expected result will appear and when it won't, and likely give a false sense of security. If we were to implement this, there's a choice to be made: do we (1) base the rounding on the actual float value and do correct rounding, as round currently does, or do we (2) try to do something magic that guesses what value the user actually meant, rather than rounding the exact value that the round function receives? I _really_ _really_ don't want to go down the DWIM path of option (2), but I suspect that (1) will be mostly useless for users, outside the ndigits=0 use-case. There _are_ valid use-cases for two-argument round on floats (e.g., casual binning), but for the most part round already fills those use-cases. I'd rather add whatever bells and whistles we need (if any) to make it easier for users who care about this to use Decimal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:58:19 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Aug 2020 10:58:19 +0000 Subject: [issue40573] inspect.iscorutinefunction() returns False for unittest.mock.AsyncMock instances In-Reply-To: <1588994052.01.0.365173220946.issue40573@roundup.psfhosted.org> Message-ID: <1598353099.87.0.439968938399.issue40573@roundup.psfhosted.org> Irit Katriel added the comment: The two implementations of iscoroutinefunction are implemented differently: in inspect: def iscoroutinefunction(obj): """Return true if the object is a coroutine function. Coroutine functions are defined with "async def" syntax. """ return _has_code_flag(obj, CO_COROUTINE) and in asyncio: def iscoroutinefunction(func): """Return True if func is a decorated coroutine function.""" return (inspect.iscoroutinefunction(func) or getattr(func, '_is_coroutine', None) is _is_coroutine) originally the asyncio version had only the _is_coroutine check: https://github.com/python/cpython/commit/f951d28ac890063e3ecef56aa8cf851b1152d9dd the inspect check was added later. See also issue28703, where the asyncio version was fixed to handle mock objects. Looks like the inspect version needs to be fixed as well. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 06:59:23 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Aug 2020 10:59:23 +0000 Subject: [issue40573] inspect.iscorutinefunction() returns False for unittest.mock.AsyncMock instances In-Reply-To: <1588994052.01.0.365173220946.issue40573@roundup.psfhosted.org> Message-ID: <1598353163.84.0.388008970938.issue40573@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 07:28:33 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 25 Aug 2020 11:28:33 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598354913.23.0.964497295159.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: > I'd rather add whatever bells and whistles we need (if any) to make it easier for users who care about this to use Decimal. This made me think. (I have tons of these ideas, but usually am afraid of voicing them unless encouraged by comments such as this one.;) How about this whistle: we allow round to accept str as the first argument? In a very unrelated context (https://www.python.org/dev/peps/pep-0484/#forward-references) Guido has said something like "when literals aren't what they seem, strings are a good enough substitute". Maybe here too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 08:23:41 2020 From: report at bugs.python.org (Jonathan Lahav) Date: Tue, 25 Aug 2020 12:23:41 +0000 Subject: [issue41632] Tkinter - Unexpected behavior after creating around 10000 widgets Message-ID: <1598358221.58.0.0866491892705.issue41632@roundup.psfhosted.org> New submission from Jonathan Lahav : Observation: After creating around 10000 widgets (verified with ttk.Label), no more widgets get created, and sometimes graphical artifacts appear outside the application window. No error message or exception is raised. Expected: Either the limit can be removed (having dynamically created 10000 widgets in data heavy applications is sometimes desired), or at least document and return runtime errors to prevent the weird behavior. Reproduction: This is the problematic part: for _ in range(10000): ttk.Label(root, text='problematic') A full minimal example code is attached, though a better effect can be seen when running the above two lines in the context of a more advanced Tkinter application. ---------- components: Tkinter files: ten_k.py messages: 375888 nosy: gpolo, j.lahav, serhiy.storchaka priority: normal severity: normal status: open title: Tkinter - Unexpected behavior after creating around 10000 widgets type: crash versions: Python 3.8 Added file: https://bugs.python.org/file49426/ten_k.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 09:29:34 2020 From: report at bugs.python.org (E. Paine) Date: Tue, 25 Aug 2020 13:29:34 +0000 Subject: [issue41632] Tkinter - Unexpected behavior after creating around 10000 widgets In-Reply-To: <1598358221.58.0.0866491892705.issue41632@roundup.psfhosted.org> Message-ID: <1598362174.91.0.996578370756.issue41632@roundup.psfhosted.org> E. Paine added the comment: I am struggling to reproduce. On Linux the window shows exactly as expected (it does take a while to close, though, which is understandable) and on Windows the window never shows (it gets stuck before the mainloop). This is, however, not a tkinter problem as I get exactly the same result on each platform running the following equivalent Tcl in Wish: for {set i 0} {$i < 10000} {incr i} { ttk::label ".l$i" -text problematic } grid [ttk::label .lb -text {now you see me}] A similar issue was reported in #37673. If you *need* lots of widgets (e.g. a large table) I would suggest lazy loading them instead of trying to render them all at load. Thank you for reporting this issue but it should be closed as third-party. A note for future: please could you include information about your environment (Python version, Tk patchlevel, OS, etc.) so it is easier for the problem to be narrowed down (again, thank you for reporting this issue). ---------- nosy: +epaine Added file: https://bugs.python.org/file49427/ten_k.tcl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 09:44:36 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 Aug 2020 13:44:36 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1598363076.39.0.831073147509.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +21062 pull_request: https://github.com/python/cpython/pull/21953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 10:01:06 2020 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 25 Aug 2020 14:01:06 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1598364066.14.0.786717602686.issue40077@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +21063 pull_request: https://github.com/python/cpython/pull/21954 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 11:21:41 2020 From: report at bugs.python.org (Yaroslav Halchenko) Date: Tue, 25 Aug 2020 15:21:41 +0000 Subject: [issue41594] Intermittent failures of loop.subprocess_exec() to capture output In-Reply-To: <1597883051.54.0.163691000969.issue41594@roundup.psfhosted.org> Message-ID: <1598368901.44.0.525203193238.issue41594@roundup.psfhosted.org> Yaroslav Halchenko added the comment: Might (although unlikely) be related to https://bugs.python.org/issue40634 which is about BlockingIOError being raised (and ignored) if SelectorEventLoop is reused (not the case here) also in the case of short lived processes. ---------- nosy: +Yaroslav.Halchenko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 11:28:26 2020 From: report at bugs.python.org (Bob Kline) Date: Tue, 25 Aug 2020 15:28:26 +0000 Subject: [issue41633] pydoc skips methods of nested classes Message-ID: <1598369306.87.0.655415485903.issue41633@roundup.psfhosted.org> New submission from Bob Kline : Although the documentation for the pydoc says that it produces documentation of the classes recursively, this isn't actually true. ---------- components: Library (Lib) files: repro.py messages: 375891 nosy: bkline priority: normal severity: normal status: open title: pydoc skips methods of nested classes type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49428/repro.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 11:30:09 2020 From: report at bugs.python.org (Bob Kline) Date: Tue, 25 Aug 2020 15:30:09 +0000 Subject: [issue41633] pydoc skips methods of nested classes In-Reply-To: <1598369306.87.0.655415485903.issue41633@roundup.psfhosted.org> Message-ID: <1598369409.14.0.838081345807.issue41633@roundup.psfhosted.org> Bob Kline added the comment: Here is the generated documentation. Note that no mention is made of the inner class's method. ---------- Added file: https://bugs.python.org/file49429/Screen Shot 2020-08-25 at 11.26.39 AM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 12:19:12 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 Aug 2020 16:19:12 +0000 Subject: [issue37369] Issue with pip in venv on Powershell in Windows In-Reply-To: <1561161256.11.0.32935812019.issue37369@roundup.psfhosted.org> Message-ID: <1598372352.63.0.822388683981.issue37369@roundup.psfhosted.org> Steve Dower added the comment: > The problem is that Powershell has case-sensitive commands and pip is trying to call path completely in minor case This is not normal configuration. I'm not sure what you've done here, but please open a new issue with details about how you enabled case-sensitivity on Windows. Also please include repro steps that do not involve pip, as we will need an issue in CPython to fix anything. Otherwise you'll have to report it to the pip project at https://github.com/pypa/pip ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 12:22:34 2020 From: report at bugs.python.org (Irit Katriel) Date: Tue, 25 Aug 2020 16:22:34 +0000 Subject: [issue40573] inspect.iscorutinefunction() returns False for unittest.mock.AsyncMock instances In-Reply-To: <1588994052.01.0.365173220946.issue40573@roundup.psfhosted.org> Message-ID: <1598372554.46.0.545438075364.issue40573@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 12:23:35 2020 From: report at bugs.python.org (hai shi) Date: Tue, 25 Aug 2020 16:23:35 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598372615.17.0.458326504576.issue41631@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 12:24:49 2020 From: report at bugs.python.org (hai shi) Date: Tue, 25 Aug 2020 16:24:49 +0000 Subject: [issue41625] Add splice() to the os module In-Reply-To: <1598284638.54.0.211220433787.issue41625@roundup.psfhosted.org> Message-ID: <1598372689.2.0.422350549527.issue41625@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 13:05:55 2020 From: report at bugs.python.org (Steve Dower) Date: Tue, 25 Aug 2020 17:05:55 +0000 Subject: [issue41630] Enable curses support on Windows In-Reply-To: <1598328919.18.0.0711977156478.issue41630@roundup.psfhosted.org> Message-ID: <1598375155.54.0.575705006319.issue41630@roundup.psfhosted.org> Steve Dower added the comment: The curses module is currently not supported on Windows, and this patch is far more than just updating the VS build. I've updated the title. Refer to issue31951 for more context. This will need more work than what's been done in the pull request, as _curses is still not being built as part of normal build, and so is not being tested in CI. ---------- title: Visual Studio does not build the curses and curses.panel module -> Enable curses support on Windows type: -> enhancement versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 14:44:26 2020 From: report at bugs.python.org (pipythonmc) Date: Tue, 25 Aug 2020 18:44:26 +0000 Subject: [issue41634] Typo in curses documentation Message-ID: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> New submission from pipythonmc : https://docs.python.org/3/library/curses.html#curses.window.addch "overwriting any character previously painter" I believe it should be "overwriting any character previously painted" Also this is my first issue so if I made any mistakes please tell me. I am using Google Chrome 84.0.4147.135 (Official Build) (64-bit) but this shouldn't affect anything. ---------- assignee: docs at python components: Documentation messages: 375895 nosy: docs at python, pipythonmc priority: normal severity: normal status: open title: Typo in curses documentation type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 15:04:23 2020 From: report at bugs.python.org (Sebastien Williams-Wynn) Date: Tue, 25 Aug 2020 19:04:23 +0000 Subject: [issue41585] policy.max_line_length is incorrectly assumed to never be None In-Reply-To: <1597783641.3.0.970481026671.issue41585@roundup.psfhosted.org> Message-ID: <1598382263.37.0.597322604403.issue41585@roundup.psfhosted.org> Change by Sebastien Williams-Wynn : ---------- keywords: +patch nosy: +s.williams-wynn nosy_count: 6.0 -> 7.0 pull_requests: +21064 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 15:24:33 2020 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 25 Aug 2020 19:24:33 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1598383473.73.0.583192921387.issue41602@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch pull_requests: +21065 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 15:58:48 2020 From: report at bugs.python.org (jack1142) Date: Tue, 25 Aug 2020 19:58:48 +0000 Subject: [issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds In-Reply-To: <1491349378.03.0.0671954460373.issue29988@psf.upfronthosting.co.za> Message-ID: <1598385528.43.0.575199670148.issue29988@roundup.psfhosted.org> Change by jack1142 : ---------- nosy: +jack1142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 16:03:54 2020 From: report at bugs.python.org (Tim Peters) Date: Tue, 25 Aug 2020 20:03:54 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598385834.48.0.176809534586.issue41513@roundup.psfhosted.org> Tim Peters added the comment: One more implication: since the quality of the initial square root doesn't really much matter, instead of result = sqrt(to_float(parts)) a, b = split(result) parts = add_on(-a*a, parts) parts = add_on(-2.0*a*b, parts) parts = add_on(-b*b, parts) x = to_float(parts) result += x / (2.0 * result) at the end, it should work just as well (in fact, probably a little better, due to getting more beneficial cancellation) to do: a = parts[0] - 1.0 result = sqrt(a) x, y = split(result) result += (a - x*x - 2.0*x*y - y*y + parts[1]) / (2.0 * result) at the end. Although this crucially relies on the doing the last-line chain of subtracts and adds "left to right". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 16:29:13 2020 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 25 Aug 2020 20:29:13 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1598387353.45.0.992442976753.issue41602@roundup.psfhosted.org> Thomas Grainger added the comment: I've confirmed that the pymain_run_module fails on master in the same way with Mac, Windows and Ubuntu ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 16:51:08 2020 From: report at bugs.python.org (Jonathan Lahav) Date: Tue, 25 Aug 2020 20:51:08 +0000 Subject: [issue41632] Tkinter - Unexpected behavior after creating around 10000 widgets In-Reply-To: <1598358221.58.0.0866491892705.issue41632@roundup.psfhosted.org> Message-ID: <1598388668.37.0.873553528846.issue41632@roundup.psfhosted.org> Jonathan Lahav added the comment: Thank you for checking it so quickly, and answering nicely. I indeed forgot to mention that it happened to me on Windows. Sorry for that. The issue seems similar to the one you linked. I will try and take this to the TCL community since it impacts our product. Thank you for translating the code to TCL. If the python community has no interest in trying to push TCL to fix it, this issue can be closed. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 18:45:53 2020 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 25 Aug 2020 22:45:53 +0000 Subject: [issue41635] flaky test.test_asyncio.test_events.ProactorEventLoopTests.test_call_later Message-ID: <1598395552.97.0.0133984716471.issue41635@roundup.psfhosted.org> New submission from Thomas Grainger : ====================================================================== FAIL: test_call_later (test.test_asyncio.test_events.ProactorEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_asyncio\test_events.py", line 301, in test_call_later self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0) AssertionError: False is not true : 0.07800000000020191 ---------------------------------------------------------------------- https://github.com/python/cpython/pull/21956/checks?check_run_id=1028726196#step:5:4892 ---------- components: Tests messages: 375900 nosy: graingert priority: normal severity: normal status: open title: flaky test.test_asyncio.test_events.ProactorEventLoopTests.test_call_later versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 20:13:06 2020 From: report at bugs.python.org (lizardlizard) Date: Wed, 26 Aug 2020 00:13:06 +0000 Subject: [issue37980] regression when passing numpy bools to sorted(..., reverse=r) In-Reply-To: <1567096742.32.0.970581980709.issue37980@roundup.psfhosted.org> Message-ID: <1598400786.85.0.4699672537.issue37980@roundup.psfhosted.org> lizardlizard added the comment: I found this bug searching after noticing weird behaviour in an error message saying sorted expects the reverse flag to be an integer, after it rejected None. This is very surprising. Why isn't it just casting the reverse parameter using bool() to discover it's truthyness? In [1]: bool(None) Out[1]: False In [2]: sorted(['a','c','b'], reverse=None) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 sorted(['a','c','b'], reverse=None) TypeError: an integer is required (got type NoneType) ---------- nosy: +lizardlizard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 20:21:26 2020 From: report at bugs.python.org (Kenta Tsubouchi) Date: Wed, 26 Aug 2020 00:21:26 +0000 Subject: [issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc' In-Reply-To: <1443130331.16.0.912755488197.issue25229@psf.upfronthosting.co.za> Message-ID: <1598401286.89.0.0021719796625.issue25229@roundup.psfhosted.org> Change by Kenta Tsubouchi : ---------- pull_requests: +21067 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21957 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 20:48:02 2020 From: report at bugs.python.org (Graham Oliver) Date: Wed, 26 Aug 2020 00:48:02 +0000 Subject: [issue41636] distutils.util.strtobool documented behaviour Message-ID: <1598402882.51.0.310018876035.issue41636@roundup.psfhosted.org> New submission from Graham Oliver : Here is the text https://docs.python.org/3.6/distutils/apiref.html#distutils.util.strtobool Convert a string representation of truth to true (1) or false (0). True values are y, yes, t, true, on and 1; false values are n, no, f, false, off and 0. Raises ValueError if val is anything else. I wondered what would happen with 'FALSE' i.e. upper case. It appears to behave the same way as 'false'. In fact case does not seem to be an issue, so 'FaLsE' will return 0 as well. So a note that this function is independent of case may be helpful ---------- assignee: docs at python components: Documentation messages: 375902 nosy: Graham.Oliver, docs at python priority: normal severity: normal status: open title: distutils.util.strtobool documented behaviour versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 25 21:17:28 2020 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 26 Aug 2020 01:17:28 +0000 Subject: [issue30434] multiprocessing AuthenticationError "digest sent was rejected" In-Reply-To: <1495484655.04.0.0387717474918.issue30434@psf.upfronthosting.co.za> Message-ID: <1598404648.51.0.0720893685743.issue30434@roundup.psfhosted.org> Change by Xiang Zhang : ---------- resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 00:07:36 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 26 Aug 2020 04:07:36 +0000 Subject: [issue41636] distutils.util.strtobool documented behaviour In-Reply-To: <1598402882.51.0.310018876035.issue41636@roundup.psfhosted.org> Message-ID: <1598414856.9.0.686093966373.issue41636@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +dstufft, eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 01:02:04 2020 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 26 Aug 2020 05:02:04 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598418124.63.0.59062337347.issue41634@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +21068 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21958 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 01:02:27 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Aug 2020 05:02:27 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598418147.93.0.108651591623.issue41598@roundup.psfhosted.org> Raymond Hettinger added the comment: Like Mark, I'm not convinced this is a good idea. Outside of finance calculations which typically already use decimal, the need for it is somewhat rare. Also, the API doesn't fit neatly with existing the __round__ dunder methods, so the new feature couldn't be made to work with existing classes. If you want to pursue this, I recommend taking it to python-ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 01:23:56 2020 From: report at bugs.python.org (Camion) Date: Wed, 26 Aug 2020 05:23:56 +0000 Subject: [issue41637] Calling a function with an infinite number of parameters is not detected and crash the interpreter instead of causing an exception Message-ID: <1598419436.9.0.814986663177.issue41637@roundup.psfhosted.org> New submission from Camion : The following code will obviously cause a memory leak, but this will not be detected and crash the interpreter: def inf(): while True: yield 0 def use(*parm): for i in parm: print(i) and then use(*inf()) or print(*int()) The reason of this test is that I wanted to check if ever python would be able to make lazy evaluation in parameter passing (It would be nice if it was but it is not the case). However, at least, I think this error should have been detected as well as an infinite recursion is, because it even has been able to crash and reboot a not so old (18) version of linux Mint. ---------- components: Interpreter Core messages: 375904 nosy: Camion priority: normal severity: normal status: open title: Calling a function with an infinite number of parameters is not detected and crash the interpreter instead of causing an exception type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:01:13 2020 From: report at bugs.python.org (Roger Meier) Date: Wed, 26 Aug 2020 06:01:13 +0000 Subject: [issue41548] Tk Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1598421673.54.0.684572171621.issue41548@roundup.psfhosted.org> Roger Meier added the comment: The latest macOS Big Sur Public Beta (5, Build 20A5354i) fixes the issue with TK Window rendering. ---------- resolution: -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:16:55 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 06:16:55 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved Message-ID: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> New submission from Wolfgang Fahl : def testBindingError(self): ''' test list of Records with incomplete record leading to "You did not supply a value for binding 2" ''' listOfRecords=[{'name':'Pikachu', 'type':'Electric'},{'name':'Raichu' }] resultList=self.checkListOfRecords(listOfRecords,'Pokemon','name') Which eventually will call: insertCmd=entityInfo.insertCmd self.c.executemany(insertCmd,listOfRecords) self.c.commit() leading to the error message: sqlite3.ProgrammingError: You did not supply a value for binding 2. When many thousand records are inserted this message is not very helpful. you might want to improve it to: sqlite3.ProgrammingError: You did not supply a value for binding 2 ("type") in record #2 with a debug option that shows the actual date like: sqlite3.ProgrammingError: You did not supply a value for binding 2 ("type") in record #2 debuginfo: name="Raichu", type=missing sqlite3.ProgrammingError: You did not supply a value for binding 2. ---------- components: Library (Lib) messages: 375906 nosy: WolfgangFahl priority: normal severity: normal status: open title: Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:30:00 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 06:30:00 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598423400.76.0.760239892224.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: My workaround starts with: try: self.c.executemany(insertCmd,listOfRecords) self.c.commit() except sqlite3.ProgrammingError as pe: msg=pe.args[0] if "You did not supply a value for binding" in msg: columnIndex=int(re.findall(r'\d+',msg)[0]) columnName=list(entityInfo.typeMap.keys())[columnIndex-1] raise Exception("%s\nfailed: no value supplied for column '%s'" % (insertCmd,columnName)) else: raise pe which gives me: Exception: INSERT INTO Pokemon (name,type) values (:name,:type) failed: no value supplied for column 'type' but not the data yet. So i am now forced to implement another insert that does not use executemany (which i like a lot) just to get proper debug information - this is a pitty. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:37:02 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 06:37:02 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598423822.61.0.639999159692.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: see https://github.com/WolfgangFahl/DgraphAndWeaviateTest/issues/7 and https://github.com/WolfgangFahl/DgraphAndWeaviateTest/commit/cc7dbc4c3ade4dd6b2e74f41410e19bc21450490 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:50:59 2020 From: report at bugs.python.org (Andy Maier) Date: Wed, 26 Aug 2020 06:50:59 +0000 Subject: [issue41639] Unpickling derived class of list does not call __init__() Message-ID: <1598424659.93.0.553984904692.issue41639@roundup.psfhosted.org> New submission from Andy Maier : Unpickling an object of a user class that derives from list seems to miss calling the user class's __init__() method: Consider this script, which defines a derived class of the built-in list for the purpose of creating a case insensitive list. The real example has all methods of list implemented, but this subset example also shows the issue: ----------------- import pickle def _lc_list(lst): result = list() for value in lst: result.append(value.lower()) return result class NocaseList(list): #def __new__(cls, iterable=()): # self = super(NocaseList, cls).__new__(cls, iterable) # print("Debug: __new__() for self={}".format(id(self))) # return self def __init__(self, iterable=()): print("Debug: __init__() for self={}".format(id(self))) super(NocaseList, self).__init__(iterable) self.lc_list = _lc_list(self) def append(self, value): super(NocaseList, self).append(value) self.lc_list.append(value.lower()) def extend(self, iterable): super(NocaseList, self).extend(iterable) for value in iterable: self.lc_list.append(value.lower()) ncl = NocaseList(['A', 'b']) pkl = pickle.dumps(ncl) nclx = pickle.loads(pkl) ----------------- $ python ./pickle_extend.py Debug: __init__() for self=4498704880 Traceback (most recent call last): File "./pickle_extend.py", line 32, in nclx = pickle.loads(pkl) File "./pickle_extend.py", line 28, in extend self.lc_list.append(value.lower()) AttributeError: 'NocaseList' object has no attribute 'lc_list' Uncommenting the __new__() method in the script shows that __new__() is called but not __init__(): $ python ./pickle_extend.py Debug: __new__() for self=4359683024 Debug: __init__() for self=4359683024 Debug: __new__() for self=4360134304 Traceback (most recent call last): File "./pickle_extend.py", line 32, in nclx = pickle.loads(pkl) File "./pickle_extend.py", line 28, in extend self.lc_list.append(value.lower()) AttributeError: 'NocaseList' object has no attribute 'lc_list' ---------- messages: 375909 nosy: andymaier priority: normal severity: normal status: open title: Unpickling derived class of list does not call __init__() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:51:45 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 06:51:45 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598424705.4.0.819395792048.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: The full workaround is in https://github.com/WolfgangFahl/DgraphAndWeaviateTest/commit/f1a58d75f459bf78db327acddaf01d5cf64eb7d4 def testBindingError(self): ''' test list of Records with incomplete record leading to "You did not supply a value for binding 2" see https://bugs.python.org/issue41638 ''' listOfRecords=[{'name':'Pikachu', 'type':'Electric'},{'name':'Raichu' }] for executeMany in [True,False]: try: self.checkListOfRecords(listOfRecords,'Pokemon','name',executeMany=executeMany) self.fail("There should be an exception") except Exception as ex: if self.debug: print(str(ex)) self.assertTrue('no value supplied for column' in str(ex)) Giving the error messages: INSERT INTO Pokemon (name,type) values (:name,:type) failed: no value supplied for column 'type' in mode "executeMany" INSERT INTO Pokemon (name,type) values (:name,:type) failed: no value supplied for column 'type' record #2={'name': 'Raichu'} if executeMany is not used and errorDebug is on The wrapper code is: def store(self,listOfRecords,entityInfo,executeMany=False): ''' store the given list of records based on the given entityInfo Args: listOfRecords(list): the list of Dicts to be stored entityInfo(EntityInfo): the meta data to be used for storing ''' insertCmd=entityInfo.insertCmd try: if executeMany: self.c.executemany(insertCmd,listOfRecords) else: index=0 for record in listOfRecords: index+=1 self.c.execute(insertCmd,record) self.c.commit() except sqlite3.ProgrammingError as pe: msg=pe.args[0] if "You did not supply a value for binding" in msg: columnIndex=int(re.findall(r'\d+',msg)[0]) columnName=list(entityInfo.typeMap.keys())[columnIndex-1] debugInfo="" if not executeMany: if self.errorDebug: debugInfo="\nrecord #%d=%s" % (index,repr(record)) raise Exception("%s\nfailed: no value supplied for column '%s'%s" % (insertCmd,columnName,debugInfo)) else: raise pe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:53:09 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 06:53:09 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598424789.15.0.431511842472.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: see also https://stackoverflow.com/questions/61788055/sqlite3-error-you-did-not-supply-a-value-for-binding-1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 02:54:30 2020 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Wed, 26 Aug 2020 06:54:30 +0000 Subject: [issue32313] Wrong inspect.getsource for datetime In-Reply-To: <1513201599.09.0.213398074469.issue32313@psf.upfronthosting.co.za> Message-ID: <1598424870.62.0.641546681517.issue32313@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: Looks like for `getfile` docs should be updated. On python2.7.17_1, import inspect, datetime print(inspect.getfile(datetime.datetime)) outputs, /usr/local/Cellar/python at 2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/datetime.so It seems a long time overdue? ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:02:29 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 07:02:29 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598425349.48.0.541809572869.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: see also https://stackoverflow.com/questions/46080876/python-sqlite3-you-did-not-supply-a-value-for-binding-6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:04:02 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 07:04:02 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598425442.23.0.692894224363.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: see also https://stackoverflow.com/questions/61556472/insert-into-a-table-and-get-the-error-sqlite3-programmingerror-you-did-not-sup ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:05:31 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 07:05:31 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598425531.45.0.587090639472.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: see also https://stackoverflow.com/questions/60793224/sqlite3-programmingerror-you-did-not-supply-a-value-for-binding-1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:07:34 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 07:07:34 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598425654.92.0.871237706958.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: see also https://stackoverflow.com/questions/17169642/python-sqlite-insert-named-parameters-or-null for the more general problem ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:31:32 2020 From: report at bugs.python.org (Bastian Ebeling) Date: Wed, 26 Aug 2020 07:31:32 +0000 Subject: [issue41640] module zipfile issue on closing Message-ID: <1598427092.16.0.16834501548.issue41640@roundup.psfhosted.org> New submission from Bastian Ebeling : When trying to open an archive and read internal binary streams, for me it occurs, that the file-stream gets closed. As a code-Snippet: import zipfile srcfile=zipfile.ZipFile('file.zip') a=zipfile.Path(srcfile,"data1.bin").read_bytes() b=zipfile.Path(srcfile,"data2.bin").read_bytes() the second call results in the ValueError: seek of closed file A quick and dirty solution (as an idea) is to change close() for the _SharedFile to run self.close() instead of self._close(findeobj) in the end (somehow around line 772). Hopefully that helps ---------- messages: 375917 nosy: bastian.ebeling priority: normal severity: normal status: open title: module zipfile issue on closing type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:36:45 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 26 Aug 2020 07:36:45 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1598427405.96.0.640519844492.issue41557@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +21069 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:37:50 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 26 Aug 2020 07:37:50 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1598427470.66.0.192425365151.issue41557@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +21070 pull_request: https://github.com/python/cpython/pull/21960 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 03:53:51 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 26 Aug 2020 07:53:51 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598428431.97.0.287727925789.issue41631@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:03:12 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 26 Aug 2020 08:03:12 +0000 Subject: [issue41640] module zipfile issue on closing In-Reply-To: <1598427092.16.0.16834501548.issue41640@roundup.psfhosted.org> Message-ID: <1598428992.87.0.803033564278.issue41640@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to be a duplicate of issue40564 . Can you please add the python version you are using? ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:12:56 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 26 Aug 2020 08:12:56 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1598429576.93.0.302965182839.issue40564@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Bisection show this to be caused due to e5bd73632e77dc5ab0cab77e48e94ca5e354be8a . See also issue41640 for a similar report. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:13:49 2020 From: report at bugs.python.org (Eryk Sun) Date: Wed, 26 Aug 2020 08:13:49 +0000 Subject: [issue37369] Issue with pip in venv on Powershell in Windows In-Reply-To: <1561161256.11.0.32935812019.issue37369@roundup.psfhosted.org> Message-ID: <1598429629.25.0.0819478686096.issue37369@roundup.psfhosted.org> Eryk Sun added the comment: Case-sensitive file access is potentially possible with FILE_FLAG_POSIX_SEMANTICS (CreateFileW) and FIND_FIRST_EX_CASE_SENSITIVE (FindFirstFileExW). These flags make the API omit the object-manager flag OBJ_CASE_INSENSITIVE in the NtCreateFile or NtOpenFile system call. That said, since Windows XP these API flags are usually ignored because the kernel object manager has a default-enabled global flag that makes it always use OBJ_CASE_INSENSITIVE for object types that are registered as case-insensitive, such as device objects. The global flag is configured as the value "obcaseinsensitive" in "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel". A filesystem may elect to ignore the OBJ_CASE_INSENSITIVE flag, though it's not particularly elegant. In Windows 10, NTFS ignores the OBJ_CASE_INSENSITIVE flag if the parent directory is flagged as case-sensitive via NtSetInformationFile: FileCaseSensitiveInformation [1], which can be set by WSL or fsutil.exe. This setting should be avoided for directories that are used by Windows programs. An example issue is the way shells use the PATHEXT environment variable to find a file when the extension is omitted. Typically each extension in PATHEXT gets appended to the base name and checked via FindFirstFileW or GetFileAttributesW. But, for example, checking for "spam.BAT" will fail in a case-sensitive directory if the extension is actually ".bat", ".Bat", etc. --- [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_case_sensitive_information ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:24:13 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 26 Aug 2020 08:24:13 +0000 Subject: [issue41639] Unpickling derived class of list does not call __init__() In-Reply-To: <1598424659.93.0.553984904692.issue41639@roundup.psfhosted.org> Message-ID: <1598430253.06.0.0898581669084.issue41639@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:43:21 2020 From: report at bugs.python.org (marco_ocram) Date: Wed, 26 Aug 2020 08:43:21 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598431401.95.0.078194188256.issue41598@roundup.psfhosted.org> marco_ocram added the comment: "- What would you expect round(2.675, ndigits=2, mode=ROUND_HALF_UP) to give? I strongly suspect that Marco would expect and want a result of 2.68. But if we follow the existing rules for round, it's going to give 2.67." Yes, that's right. And my second humble implementation do this but only if the number have a decimal part, i mean the binary approximation is managed only for numbers with decimal positions, not for binary distortion in huge numbers with a positive exponent for example. For my application is ok but not in general, in my fast opinion a possible solution could be translate all numbers in exponential decimal format and evaluate the last digit that have to be condidered as an approximation decimal digit before applying calculations, or some kind of calculations. This is the case for example of 0.49999...9 - What would you expect round(2.712, ndigits=3, mode=ROUND_UP) to give? The binary float given by the literal 2.712 is just a touch larger than 2.712, so it should round up, giving 2.713. But again, I doubt that's what users will expect or want. Even worse, the rounding is not idempotent: the float 2.713 is again a little larger than Decimal("2.713"), so it rounds up again: so if we round the value 2.712 twice to 3 digits using ROUND_UP, we'll get 2.714. This is the case of 0.50000...1 for example and agreee with all stated. With the solution proposed above in my opinion could be managed this case too, translating and working on decimal representation and using last digit as rounding digit and only for this. The user will have no more the possibility to use it as a significant digit to don't have the need to guess nothing. But pheraps this means work with strings as implemented in decimals? Sorry i don't know this, but i can guess. In the end, the problem is not simple but not impossible in my opinion, it's right that decimals are already implemented and someone could work using them if needed, i don't want to impose nothing and convince noone but it's really funny in my opinion the only built-in rounding in a cutting-edge language as Python give me the banking rounding that as an not so young :-( engineer i've learned about now and give me results the same Microsoft in documentation index as misleading. I's right as i've already stated in sums reduce the rounding error but as i've reported the more common rounding peoples have in mind is the half up rounding. These are only my considerations, the choice is your, more experienced in the field then me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:47:56 2020 From: report at bugs.python.org (Bastian Ebeling) Date: Wed, 26 Aug 2020 08:47:56 +0000 Subject: [issue41640] module zipfile issue on closing In-Reply-To: <1598427092.16.0.16834501548.issue41640@roundup.psfhosted.org> Message-ID: <1598431676.13.0.690883273193.issue41640@roundup.psfhosted.org> Bastian Ebeling added the comment: My used python Version is Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32 Indead - this issue seems to be the same as 40564, but maybe my suggested solution is helpful? ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 04:59:29 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Wed, 26 Aug 2020 08:59:29 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598432369.19.0.310837560921.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: Note that there is also another error: sqlite3.InterfaceError: Error binding parameter :series - probably unsupported type. with similar issue but which actively shows the binding name (but not the record# and debugInfo ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 05:11:26 2020 From: report at bugs.python.org (Xavier Morel) Date: Wed, 26 Aug 2020 09:11:26 +0000 Subject: [issue41641] Add a "message" action to warnings, to trigger for every *unique* message Message-ID: <1598433086.63.0.062465851878.issue41641@roundup.psfhosted.org> New submission from Xavier Morel : Warning actions allow deduplicating warning triggers based on category ("once"), category + file ("module") and category + exact location ("default"). One thing which is missing is support for a single location generating warnings *on behalf* of other pieces of code. `warnings.warn` provides some support via the "stacklevel" parameter, but it is difficult to compute if the warning is generated from somewhat nested generic code (or even impossible if the warning is generated from completely generic code checking over e.g. data files or the like, or if the invoker could be invoked from multiple places with different depth difference from the code they're working for). But in that case, the warning messages will often be unique per functional unit, so it could be a useful base for deduplication, even though the warning could dynamically be invoked multiple times (per functional unit) because e.g. code is reloaded or whatever. ---------- components: Library (Lib) messages: 375924 nosy: xmorel priority: normal severity: normal status: open title: Add a "message" action to warnings, to trigger for every *unique* message type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 05:26:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Aug 2020 09:26:17 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598433977.45.0.565603237971.issue41631@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +21071 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 05:29:54 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 26 Aug 2020 09:29:54 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error Message-ID: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : It seems many of the RHEL and Fedora builds fail due to disk space https://buildbot.python.org/all/#/builders/185/builds/2 ./configure: line 2382: cannot create temp file for here-document: No space left on device ./configure: line 2394: cannot create temp file for here-document: No space left on device ./configure: line 2429: cannot create temp file for here-document: No space left on device ./configure: line 2591: cannot create temp file for here-document: No space left on device ./configure: line 2595: cannot create temp file for here-document: No space left on device ./configure: line 2599: cannot create temp file for here-document: No space left on device ./configure: line 2603: cannot create temp file for here-document: No space left on device ./configure: line 2607: cannot create temp file for here-document: No space left on device ./configure: line 2611: cannot create temp file for here-document: No space left on device ---------- components: Tests messages: 375925 nosy: cstratak, pablogsal, vstinner, xtreak priority: normal severity: normal status: open title: RHEL and fedora buildbots fail due to disk space error type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 05:33:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Aug 2020 09:33:37 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598434417.02.0.26024390863.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: > It seems many of the RHEL and Fedora builds fail due to disk space These workers have different owners and so need to reach different people. We should list all impacted workers. > https://buildbot.python.org/all/#/builders/185/builds/2 AMD64 RHEL8 3.x is the worker: cstratak-RHEL8-x86_64. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 06:55:12 2020 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 26 Aug 2020 10:55:12 +0000 Subject: [issue41643] make shutil.make_archive always accepts pathlib objects Message-ID: <1598439312.44.0.297456491219.issue41643@roundup.psfhosted.org> New submission from Thomas Grainger : >>> shutil.make_archive(pathlib.Path("./foo"), root_dir=pathlib.Path("./foo"), format="zip") '/home/graingert/projects/ham/foo.zip' >>> shutil.make_archive(pathlib.Path("./foo"), root_dir=None, format="zip") Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/shutil.py", line 1045, in make_archive filename = func(base_name, base_dir, **kwargs) File "/usr/lib/python3.8/shutil.py", line 912, in _make_zipfile zip_filename = base_name + ".zip" TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str' see also https://bugs.python.org/issue23241 ---------- components: Library (Lib) messages: 375927 nosy: graingert priority: normal severity: normal status: open title: make shutil.make_archive always accepts pathlib objects type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 06:55:22 2020 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 26 Aug 2020 10:55:22 +0000 Subject: [issue41643] make shutil.make_archive always accept pathlib objects In-Reply-To: <1598439312.44.0.297456491219.issue41643@roundup.psfhosted.org> Message-ID: <1598439322.68.0.354194016753.issue41643@roundup.psfhosted.org> Change by Thomas Grainger : ---------- title: make shutil.make_archive always accepts pathlib objects -> make shutil.make_archive always accept pathlib objects _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 06:57:33 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 26 Aug 2020 10:57:33 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598439453.18.0.934592257691.issue41642@roundup.psfhosted.org> Charalampos Stratakis added the comment: There is an issue which I discovered after I returned from holidays, basically the buildbot-worker keeps getting disconnected from master, so builds start and end abruptly, retaining some artifacts. The next second it tried again with the same results, eventually filling the hard disk with the artifacts. Might be due to an updated package, but I've yet to discover what the issue is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 07:02:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Aug 2020 11:02:40 +0000 Subject: [issue41639] Unpickling derived class of list does not call __init__() In-Reply-To: <1598424659.93.0.553984904692.issue41639@roundup.psfhosted.org> Message-ID: <1598439760.96.0.455795267871.issue41639@roundup.psfhosted.org> Serhiy Storchaka added the comment: >From https://docs.python.org/3/library/pickle.html#pickling-class-instances: When a class instance is unpickled, its __init__() method is usually not invoked. If you want to change this behavior you have to implement the __reduce__ or __reduce_ex__ methods or register the object type in the global or per-pickler dispatch table. For example: class NocaseList(list): def __reduce__(self): return self.__class__, (), None, iter(self) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 07:09:29 2020 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 26 Aug 2020 11:09:29 +0000 Subject: [issue41643] make shutil.make_archive always accept pathlib objects In-Reply-To: <1598439312.44.0.297456491219.issue41643@roundup.psfhosted.org> Message-ID: <1598440169.36.0.115046436872.issue41643@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch pull_requests: +21072 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 07:22:15 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Aug 2020 11:22:15 +0000 Subject: [issue41632] Tkinter - Unexpected behavior after creating around 10000 widgets In-Reply-To: <1598358221.58.0.0866491892705.issue41632@roundup.psfhosted.org> Message-ID: <1598440935.34.0.980226143934.issue41632@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 09:04:00 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 26 Aug 2020 13:04:00 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598447040.96.0.54812314862.issue41642@roundup.psfhosted.org> Charalampos Stratakis added the comment: There were almost 10GB of remnant cc* files in /tmp from the compilers used, which I presume were also the temporary artifacts which remained there after the disconnects. Cleaned those up and rebooted the RHEL8 x86_64 buildbot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 09:51:54 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Aug 2020 13:51:54 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598449914.05.0.763590262941.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: python-builder-rawhide had its /tmp partition full of temporary "ccXXXX.XXX" files. Before: /tmp was full at 100% (3.9 GB). After sudo rm -f /tmp/cc*, only 52 KB are used (1%). I'm not sure why gcc/clang left so many temporary files :-/ There are many large (22 MB) assembly files (.s). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 10:11:22 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Aug 2020 14:11:22 +0000 Subject: [issue32313] Wrong inspect.getsource for datetime In-Reply-To: <1513201599.09.0.213398074469.issue32313@psf.upfronthosting.co.za> Message-ID: <1598451082.04.0.360459547117.issue32313@roundup.psfhosted.org> Dong-hee Na added the comment: _datetime.datetime's tp_name is datetime.datetime so inspect module guess that _datetime.datetime's module name is datetime, not _datetime. I don't think we have to fix this issue from inspect module side. If the _datetime.datetime's tp_name is updated to _datetime.datetime it could be fixed but I don't know this is the right approach and there might be some reason for choosing tp_name as datetime.datetime instead of _datetime.datetime. @p-ganssle is the best expert for datetime module :) I think that he could give the answer to this. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 10:37:41 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 26 Aug 2020 14:37:41 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598452661.19.0.26601782541.issue41598@roundup.psfhosted.org> Eric V. Smith added the comment: I don't think we should add this. It will often surprise the user. We get enough .1+.2 != .3 reports as it is, and this would be just as problematic. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 10:58:37 2020 From: report at bugs.python.org (STINNER Victor) Date: Wed, 26 Aug 2020 14:58:37 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598453917.86.0.625775954212.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: Statistics on partition which are the most full. Fedora Rawhide x86-64 is ok: /dev/mapper/vg_root_python--builder--rawhide.osci.io-root 14G 5,4G 7,6G 42% / /dev/mapper/vg_root_python--builder--rawhide.osci.io-home 36G 24G 11G 70% /home Fedora Stable x86-64 is ok: /dev/mapper/vg_root_python--builder2--rawhide.osci.io-root 14G 7,7G 5,2G 60% / /dev/mapper/vg_root_python--builder2--rawhide.osci.io-home 36G 23G 12G 67% /home RHEL8 x86-64 is ok: /dev/mapper/vg_root_python--builder--rhel8.osci.io-root 14G 3,5G 9,5G 27% / /dev/mapper/vg_root_python--builder--rhel8.osci.io-home 36G 9,7G 24G 29% /home RHEL7 x86-64 is ok: /dev/mapper/vg_root_python--builder--rhel7.osci.io-root 7,6G 3,6G 3,7G 49% / /dev/mapper/vg_root_python--builder--rhel7.osci.io-home 22G 15G 5,9G 71% /home RHEL8 FIPS x86-64 is ok: /dev/mapper/vg_root_python--builder--rhel8--fips.osci.io-root 15G 2.8G 12G 20% / /dev/mapper/vg_root_python--builder--rhel8--fips.osci.io-home 34G 3.7G 29G 12% /home Fedora Rawhide AArch64 is ok: /dev/mapper/fedora-root 44G 26G 19G 58% / tmpfs 16G 436K 16G 1% /tmp Fedora Stable AArch64 is ok: /dev/mapper/fedora-root 44G 33G 11G 76% / tmpfs 16G 1,6G 15G 11% /tmp RHEL7 AArch64 is ok: /dev/mapper/rhel-root 44G 15G 30G 33% / RHEL8 AArch64 had like 22 GB in /tmp, I removed them. It's now better: * before: /dev/mapper/rhel-root 44G 41G 3.3G 93% / * after: /dev/mapper/rhel-root 44G 16G 28G 36% / Fedora Stable ppc64le /tmp contained 1 GB of temporay files. I removed them. Before: /dev/mapper/fedora-root 45G 29G 17G 63% / tmpfs 4.0G 1.1G 3.0G 27% /tmp Fedora Rawhide ppc64le is ok: /dev/mapper/fedora-root 45G 27G 19G 59% / tmpfs 4.0G 384K 4.0G 1% /tmp RHEL7 ppc64le is ok: /dev/mapper/rhel-root 45G 19G 27G 42% / RHEL8 ppc64le had 22 GB of old files in /tmp: removed, rebooted. Before: /dev/mapper/rhel-root 45G 41G 4.2G 91% / ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 11:44:50 2020 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 26 Aug 2020 15:44:50 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598456690.26.0.0878602146102.issue41598@roundup.psfhosted.org> Mark Dickinson added the comment: @Vedran: > I have tons of these ideas, but usually am afraid of voicing them ... Always good to have ideas brought up, so long as there's no expectation that every idea gets implemented. :-) But I think rounding a string is probably another one for the python-ideas mailing list. (Personally, I think I'd rather have easier ways to create Decimal objects than have strings become a kind of proxy for Decimal objects - e.g., `round(2.675d, 2)` rather than `round("2.657", 2)`.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 12:37:38 2020 From: report at bugs.python.org (Joseph Perez) Date: Wed, 26 Aug 2020 16:37:38 +0000 Subject: [issue41644] builtin type kwargs Message-ID: <1598459858.48.0.222216937484.issue41644@roundup.psfhosted.org> New submission from Joseph Perez : Class definition can have kwargs which are used by `__init_subclass__` (and `__prepare__`). However, passing these kwargs using `type` builtin function instead of class definition syntax is not documented; kwargs are not mentioned in the function signature. https://docs.python.org/3/library/functions.html#type However, passing kwargs to `type` works: ```python class Foo: def __init_subclass__(cls, **kwargs): print(kwargs) Bar = type("Bar", (Foo,), {}, bar=None) # mypy and Pycharm complain #> {'bar': None} ``` By the way, the possibility to pass kwargs in `type` call is not documented in https://docs.python.org/3/reference/datamodel.html#customizing-class-creation too. ---------- assignee: docs at python components: Documentation messages: 375936 nosy: docs at python, joperez priority: normal severity: normal status: open title: builtin type kwargs versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 12:42:52 2020 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 26 Aug 2020 16:42:52 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1598460172.15.0.279546279545.issue32751@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset c517fc712105c8e5930cb42baaebdbe37fc3e15f by Elvis Pranskevichus in branch 'master': bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (#21895) https://github.com/python/cpython/commit/c517fc712105c8e5930cb42baaebdbe37fc3e15f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 12:42:51 2020 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 26 Aug 2020 16:42:51 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1598460171.88.0.932901638656.issue37658@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset a2118a14627256197bddcf4fcecad4c264c1e39d by Elvis Pranskevichus in branch 'master': bpo-37658: Fix asyncio.wait_for() to respect waited task status (#21894) https://github.com/python/cpython/commit/a2118a14627256197bddcf4fcecad4c264c1e39d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 12:42:56 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Aug 2020 16:42:56 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1598460176.84.0.73987932075.issue32751@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21073 pull_request: https://github.com/python/cpython/pull/21963 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 12:43:13 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Aug 2020 16:43:13 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1598460193.62.0.587995051817.issue37658@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +21074 pull_request: https://github.com/python/cpython/pull/21964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 12:43:21 2020 From: report at bugs.python.org (miss-islington) Date: Wed, 26 Aug 2020 16:43:21 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1598460201.65.0.0351599984015.issue37658@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21075 pull_request: https://github.com/python/cpython/pull/21965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 13:01:10 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 26 Aug 2020 17:01:10 +0000 Subject: [issue41644] builtin type kwargs In-Reply-To: <1598459858.48.0.222216937484.issue41644@roundup.psfhosted.org> Message-ID: <1598461270.88.0.853258700814.issue41644@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is rather an issue of MyPy and PyCharm. The Python interpreter itself does not perform static type testing and does not provide annotations for builtins. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 13:06:36 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 26 Aug 2020 17:06:36 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598461596.85.0.100962796772.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: > Personally, I think I'd rather have easier ways to create Decimal objects Wouldn't everybody? :-P But that's been proposed at least 4 times already and never got anywhere. My proposal is at least original, has a precedent at the above link (strings as surogate literals, preserving value across semantic boundaries), _and_ comes with a natural scope limitation guarantee: noone can argue for '2.1' + '3.5' to be '5.6' (because it is already '2.13.5';), it works only in the first argument of round. Also, the string at that time is not so pointless: many people use round for printing, at that point you are going to convert to str anyway. And round(str(result), digits) gives a nice way to use python's builtin repr capability of "picking the shortest representation" for DWIMming: it's the best of both worlds, your implementation DWIMs, but you're not responsible for corner cases. ;-= But no, I'm not going to Python-ideas, for the same reason I'm not going back to high school: too many bullies, too hard to get your voice heard, mostly because everyone assumes you wouldn't be there if you had anything smart to say. :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 13:15:08 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 26 Aug 2020 17:15:08 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1598462108.03.0.157953783092.issue32751@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1036ccb55de4abc70837cb46a72ddbb370b8fc94 by Miss Islington (bot) in branch '3.9': bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (GH-21895) (GH-21963) https://github.com/python/cpython/commit/1036ccb55de4abc70837cb46a72ddbb370b8fc94 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 13:15:38 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 26 Aug 2020 17:15:38 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1598462138.75.0.380604353793.issue37658@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9de6be4e2ae605a1deb6fa72d5c5f66b07817e4c by Miss Islington (bot) in branch '3.9': bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) (GH-21964) https://github.com/python/cpython/commit/9de6be4e2ae605a1deb6fa72d5c5f66b07817e4c ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 13:22:37 2020 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 26 Aug 2020 17:22:37 +0000 Subject: [issue40077] Convert static types to PyType_FromSpec() In-Reply-To: <1585238684.65.0.246012172449.issue40077@roundup.psfhosted.org> Message-ID: <1598462557.86.0.157487395899.issue40077@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 31967fd8d0220af84e2698172d1378bffc8cd851 by Dong-hee Na in branch 'master': bpo-40077: Convert _operator to use PyType_FromSpec (GH-21954) https://github.com/python/cpython/commit/31967fd8d0220af84e2698172d1378bffc8cd851 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:01:06 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 26 Aug 2020 18:01:06 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598464866.99.0.615147309291.issue41598@roundup.psfhosted.org> Eric V. Smith added the comment: If you're using round(str(some_float), digits) and the result is a float, then that's a problem, since you're going to round it again for display at some point. If you want a string result, you're better off using format(float, format_spec), or f-strings, or str.format() (all of which have the same underlying implementation) to do your float-to-string-for-display-purposes work. I just don't see how getting a binary float via decimal rounding would be useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:15:24 2020 From: report at bugs.python.org (Krishan Agarwal) Date: Wed, 26 Aug 2020 18:15:24 +0000 Subject: [issue41645] Typo First Page of Documentation Message-ID: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> New submission from Krishan Agarwal : Grammatical error (parallelism) in Python 3.8.5 documentation, "The Python Tutorial". First page first paragraph. The "it" refers to the Python programming language. It HAS...data structures and it IS...a simple but effective approach... Currently reads: Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Should read: Python is an easy to learn, powerful programming language. It has efficient high-level data structures and is a simple but effective approach to object-oriented programming. ---------- assignee: docs at python components: Documentation messages: 375945 nosy: docs at python, kagarwal603 priority: normal severity: normal status: open title: Typo First Page of Documentation type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:21:29 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 26 Aug 2020 18:21:29 +0000 Subject: [issue41548] Tk Window rendering on macOS Big Sur In-Reply-To: <1597387027.35.0.148329747195.issue41548@roundup.psfhosted.org> Message-ID: <1598466089.76.0.404623618256.issue41548@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> resolved status: open -> closed versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:23:42 2020 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 26 Aug 2020 18:23:42 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1598466222.85.0.85153308958.issue41645@roundup.psfhosted.org> Eric V. Smith added the comment: I read it as "It HAS ... data structures and it HAS ... a simple but effective approach ...". So if I were changing it I might add the second "has". Or maybe adding "uses" would be better. But I'm not sure it's a great sentence either way. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:26:37 2020 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 26 Aug 2020 18:26:37 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1598466397.32.0.289942407663.issue37658@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset 6e1954cd8286e083e7f8d09516d91b6b15769a4e by Miss Islington (bot) in branch '3.8': bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) (#21965) https://github.com/python/cpython/commit/6e1954cd8286e083e7f8d09516d91b6b15769a4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:29:02 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 26 Aug 2020 18:29:02 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598466542.14.0.792134131764.issue41631@roundup.psfhosted.org> Petr Viktorin added the comment: Regarding ac46eb4ad6662cf6d771b20d8963658b2186c48c: Module states come and go with the modules that contain them; if a "get_global_ast_state" or "astmodulestate_global" needs to be accessed from outside the module, it shouldn't be module state :/ ---- So, the main issue here is that the AST types are not used only by the _ast module, but by the interpreter itself: the compile() builtin and Py_CompileStringObject. I see two ways of fixing this properly: 1. All the classes _ast provides should be built-in, like, say, `function`. (Currently, that means they should be static types; later they could be per-interpreter.) The _ast module should merely expose them from Python, like the `types` module exposes the function type. This would mean that calling Py_CompileStringObject with PyCF_ONLY_AST will be independent of the _ast module. 2. The mod2obj/obj2mod functions, called by e.g. compile(..., PyCF_ONLY_AST), should: * import the _ast module * call a Python-accessible function, e.g. _ast._mod2obj This would mean replacing the _ast module (in sys.modules or through an import hook, which you can do from Python code) will affect what AST types will be used throughout the interpreter. ---------- nosy: +dino.viehland, eric.snow, petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:31:42 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 26 Aug 2020 18:31:42 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1598466702.16.0.725977443759.issue41645@roundup.psfhosted.org> Steven D'Aprano added the comment: I don't think that Python, a computer language, IS an approach to OOP. A programming language HAS an approach to OOP. We would say "Python's approach to OOP is ..." so the approach is something that belongs to Python, it isn't Python itself. (My dog's approach to cats is to bark loudly and chase them. It would be wrong to say that my dog is to bark loudly and chase cats.) So the sentence is grammatically correct, inserting an "is" would make it incorrect. But perhaps it could be re-written to be more clear? It seems a little clumsy to me. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:38:17 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Aug 2020 18:38:17 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598467097.73.0.410503415573.issue41631@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >The mod2obj/obj2mod functions, called by e.g. compile(..., PyCF_ONLY_AST), should: * import the _ast module * call a Python-accessible function, e.g. _ast._mod2obj Would that impact performance considerably? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:41:44 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Aug 2020 18:41:44 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598467304.96.0.0888001236541.issue41631@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, option 1 is virtually equivalent to the state of the _ast module prior to the recent changes except that the symbols are in a shared object instead of the binary or libpython. The advantage here is not moving them out of the shared object, is making them having static storage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:43:03 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Aug 2020 18:43:03 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598467383.37.0.126705556861.issue41631@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, adding them into a module that needs access through Python had a bootstrap problem: Basically: initializing import system -> initialize codec -> compile -> ast init -> init ast module -> ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:46:51 2020 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 26 Aug 2020 18:46:51 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598467611.75.0.0286292034234.issue41598@roundup.psfhosted.org> Vedran ?a?i? added the comment: Well, of course, but that's possible even now, and people still reach for `round`. I guess the problem is that it's too easily accessible. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:50:14 2020 From: report at bugs.python.org (Elvis Pranskevichus) Date: Wed, 26 Aug 2020 18:50:14 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1598467814.26.0.445648074031.issue32751@roundup.psfhosted.org> Change by Elvis Pranskevichus : ---------- pull_requests: +21076 pull_request: https://github.com/python/cpython/pull/21967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:51:12 2020 From: report at bugs.python.org (Joseph Perez) Date: Wed, 26 Aug 2020 18:51:12 +0000 Subject: [issue41644] builtin type kwargs In-Reply-To: <1598459858.48.0.222216937484.issue41644@roundup.psfhosted.org> Message-ID: <1598467872.92.0.443592782599.issue41644@roundup.psfhosted.org> Joseph Perez added the comment: That's why it's not an interpreter issue but a lack in the official documentation where the signature is documented. I quote https://docs.python.org/3/library/functions.html#type: > class type(object) > class type(name, bases, dict) The second line should be "class type(name, bases, dict, **kwargs)". (I've mentioned Pycharm and Mypy, but i think it's a kind of side-effect of the incomplete official documentation on which is based their typeshed) In fact, I've raised this issue because I've found myself needing to instantiate a class using `type` and kwargs, and I've not found in the documentation an example of it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:57:35 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 26 Aug 2020 18:57:35 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598468255.09.0.103685267869.issue41631@roundup.psfhosted.org> Petr Viktorin added the comment: > Also, option 1 is virtually equivalent to the state of the _ast module prior to the recent changes except that the symbols are in a shared object instead of the binary or libpython. The advantage here is not moving them out of the shared object, is making them having static storage. What I'm not yet clear on: when is that shared object is initialized and destroyed? > Would that impact performance considerably? > Also, adding them into a module that needs access through Python had a bootstrap problem Only for PyCF_ONLY_AST, which is, AFAIK, not used by the interpreter itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 14:58:56 2020 From: report at bugs.python.org (Elvis Pranskevichus) Date: Wed, 26 Aug 2020 18:58:56 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1598468336.19.0.0106217463223.issue32751@roundup.psfhosted.org> Change by Elvis Pranskevichus : ---------- pull_requests: +21077 pull_request: https://github.com/python/cpython/pull/21968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 15:06:35 2020 From: report at bugs.python.org (Elvis Pranskevichus) Date: Wed, 26 Aug 2020 19:06:35 +0000 Subject: [issue37658] In some cases asyncio.wait_for can lead to socket leak. In-Reply-To: <1563884177.4.0.19779936427.issue37658@roundup.psfhosted.org> Message-ID: <1598468795.85.0.8802489064.issue37658@roundup.psfhosted.org> Change by Elvis Pranskevichus : ---------- pull_requests: +21078 pull_request: https://github.com/python/cpython/pull/21969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 15:06:46 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Aug 2020 19:06:46 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598468806.49.0.834340361544.issue41631@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > What I'm not yet clear on: when is that shared object is initialized and destroyed? I am assuming that you mean at the Python level and not at the linker level. Then: * Initialized: when dlopen on import. * Destroyed: never. The interpreter does not dlclose the shared objects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 15:08:16 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 26 Aug 2020 19:08:16 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598468896.18.0.608980095664.issue41631@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Initialized: when dlopen on import. With this I mean import-> dlopen -> dlsym for init function -> call init function ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 15:47:29 2020 From: report at bugs.python.org (Guilherme Salgado) Date: Wed, 26 Aug 2020 19:47:29 +0000 Subject: [issue39116] StreamReader.readexactly() raises GeneratorExit on ProactorEventLoop In-Reply-To: <1576944276.46.0.229840779815.issue39116@roundup.psfhosted.org> Message-ID: <1598471249.77.0.161897233039.issue39116@roundup.psfhosted.org> Change by Guilherme Salgado : ---------- nosy: +salgado _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 16:06:01 2020 From: report at bugs.python.org (Chad Smith) Date: Wed, 26 Aug 2020 20:06:01 +0000 Subject: [issue41151] Support for new Windows pseudoterminals in the subprocess module In-Reply-To: <1593363843.17.0.163145949347.issue41151@roundup.psfhosted.org> Message-ID: <1598472361.79.0.552531926187.issue41151@roundup.psfhosted.org> Change by Chad Smith : ---------- nosy: +cs01 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 16:22:19 2020 From: report at bugs.python.org (Kyle Mulka) Date: Wed, 26 Aug 2020 20:22:19 +0000 Subject: [issue38884] __import__ is not thread-safe on Python 3 In-Reply-To: <1574363514.58.0.324753075286.issue38884@roundup.psfhosted.org> Message-ID: <1598473339.0.0.958376844876.issue38884@roundup.psfhosted.org> Change by Kyle Mulka : ---------- nosy: +repalviglator versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 16:27:52 2020 From: report at bugs.python.org (Kyle Mulka) Date: Wed, 26 Aug 2020 20:27:52 +0000 Subject: [issue38884] __import__ is not thread-safe on Python 3 In-Reply-To: <1574363514.58.0.324753075286.issue38884@roundup.psfhosted.org> Message-ID: <1598473672.51.0.954110857794.issue38884@roundup.psfhosted.org> Kyle Mulka added the comment: Was able to reproduce with Python 3.9.0rc1 using issue38884.zip. macOS 10.15.5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 16:53:00 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 26 Aug 2020 20:53:00 +0000 Subject: [issue41598] Adding support for rounding modes to builtin round In-Reply-To: <1597916377.13.0.981755252162.issue41598@roundup.psfhosted.org> Message-ID: <1598475180.67.0.423514161494.issue41598@roundup.psfhosted.org> Raymond Hettinger added the comment: Given that most of commenters don't think this is a good idea, I'm going to mark it as closed. Feel free to continue the discussion on python-ideas. If it gains traction, open this back up and give it more core-developer attention. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 16:59:39 2020 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 26 Aug 2020 20:59:39 +0000 Subject: [issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs) In-Reply-To: <1517601675.34.0.467229070634.issue32751@psf.upfronthosting.co.za> Message-ID: <1598475579.34.0.863466500944.issue32751@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset 57b698886b47bb81c782c2ba80a8a72fe66c7aad by Elvis Pranskevichus in branch '3.8': [3.8] bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (GH-21895) (#21967) https://github.com/python/cpython/commit/57b698886b47bb81c782c2ba80a8a72fe66c7aad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 17:22:55 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 Aug 2020 21:22:55 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1598476975.25.0.764415534441.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: I've attempted to replicate the issue in the [zipp](https://github.com/jaraco/zipp) test suite with this test: ```diff diff --git a/test_zipp.py b/test_zipp.py index a6fbf39..dc7c8aa 100644 --- a/test_zipp.py +++ b/test_zipp.py @@ -259,3 +259,10 @@ class TestPath(unittest.TestCase): def test_implied_dirs_performance(self): data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)] zipp.CompleteDirs._implied_dirs(data) + + def test_read_does_not_close(self): + for alpharep in self.zipfile_alpharep(): + for rep in range(2): + p_ = zipp.Path(alpharep, 'a.txt') + with p_.open() as inner: + print(list(inner)) ``` But the test passes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 17:44:02 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 Aug 2020 21:44:02 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1598478242.69.0.199964257582.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: I am able to replicate the failure using the ondisk fixture: ```diff diff --git a/test_zipp.py b/test_zipp.py index a6fbf39..539d0a9 100644 --- a/test_zipp.py +++ b/test_zipp.py @@ -259,3 +259,11 @@ class TestPath(unittest.TestCase): def test_implied_dirs_performance(self): data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)] zipp.CompleteDirs._implied_dirs(data) + + def test_read_does_not_close(self): + for alpharep in self.zipfile_ondisk(): + with zipfile.ZipFile(alpharep) as file: + for rep in range(2): + p_ = zipp.Path(file, 'a.txt') + with p_.open() as inner: + print(list(inner)) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 17:55:17 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 Aug 2020 21:55:17 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1598478917.8.0.487416736443.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: I suspect the issue lies in how the CompleteDirs.make [replaces one instance with another](https://github.com/jaraco/zipp/blob/8ad959e61cd4be40baab93528775c2bf03c8f4e1/zipp.py#L112-L114) in order to provide a complete list of implied directories and to memoize the names lookup. Because constructing a zipfile.Path object around a zipfile.ZipFile copies the underlying state, closing one will have the affect of closing the other. I believe this issue is the same root issue as issue41350. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 18:06:56 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 Aug 2020 22:06:56 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1598479616.68.0.394914200655.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: I see a few options here: - Implement CompleteDirs/FastLookup as adapters instead of subclasses, allowing the original ZipFile object to represent the state in a single place. This approach would likely be slower due to the indirection on all operations through the wrapper. - Instead of constructing a new object and copying the state, CompleteDirs.make could mutate the existing ZipFile class, replacing `source.__class__` with the new class. This approach is messy and the caller would still need to be aware that this change could be applied to the zipfile object. - Consider this use-case unsupported and document that any ZipFile object passed into Path is no longer viable and should not be referenced for another purpose. - Eliminate the class-based performance optimizations and replace them with some functional/imperative form. This approach may provide less separation of concerns. - Disable the close-on-delete behavior for the subclasses when state is copied from another. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 18:26:58 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 26 Aug 2020 22:26:58 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1598480818.66.0.656358069378.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: Implementing that last option: ``` diff --git a/zipp.py b/zipp.py index 697d4a9..f244cba 100644 --- a/zipp.py +++ b/zipp.py @@ -111,6 +111,7 @@ class CompleteDirs(zipfile.ZipFile): res = cls.__new__(cls) vars(res).update(vars(source)) + res.close = lambda: None return res ``` Does appear to address the issue. I'm not super happy about the implementation, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 18:42:46 2020 From: report at bugs.python.org (Mark Roseman) Date: Wed, 26 Aug 2020 22:42:46 +0000 Subject: [issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available In-Reply-To: <1559649566.96.0.759993950384.issue37149@roundup.psfhosted.org> Message-ID: <1598481766.24.0.546335032772.issue37149@roundup.psfhosted.org> Mark Roseman added the comment: Hello, also (very) late to this party. If this would be useful, and unless anyone has any objections, I'd be open to hosting a copy of John's material on tkdocs.com. I'd add a header to each page explaining it's an unmaintained archive with all the usual caveats. That would at least provide a stable place to link to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 19:06:56 2020 From: report at bugs.python.org (Manuel Barkhau) Date: Wed, 26 Aug 2020 23:06:56 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598483216.62.0.87581814445.issue33660@roundup.psfhosted.org> Change by Manuel Barkhau : ---------- nosy: +mbarkhau nosy_count: 6.0 -> 7.0 pull_requests: +21079 pull_request: https://github.com/python/cpython/pull/21971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 19:17:04 2020 From: report at bugs.python.org (Manuel Barkhau) Date: Wed, 26 Aug 2020 23:17:04 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598483824.67.0.395351049529.issue33660@roundup.psfhosted.org> Manuel Barkhau added the comment: This issue cropped up recently in the black project: https://github.com/psf/black/issues/1631 It appears to me that PR 7666 was closed without being merged. I created https://github.com/python/cpython/pull/21971 before I had found this issue. ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 19:49:41 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 26 Aug 2020 23:49:41 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598485781.46.0.268626647201.issue33660@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- nosy: +lukasz.langa nosy_count: 7.0 -> 8.0 pull_requests: +21081 pull_request: https://github.com/python/cpython/pull/21972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 19:58:02 2020 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 26 Aug 2020 23:58:02 +0000 Subject: [issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import In-Reply-To: <1598350561.88.0.831200620813.issue41631@roundup.psfhosted.org> Message-ID: <1598486282.32.0.305500691609.issue41631@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +21082 pull_request: https://github.com/python/cpython/pull/21973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:25:12 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 00:25:12 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598487912.96.0.16904369232.issue33660@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +21083 pull_request: https://github.com/python/cpython/pull/21974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:25:22 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 00:25:22 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598487922.85.0.702866847456.issue33660@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21084 pull_request: https://github.com/python/cpython/pull/21975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:24:46 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 00:24:46 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598487886.73.0.628007189468.issue33660@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 94ad6c674f7687ef22853cb8d42b440d6b42ddc8 by ?ukasz Langa (Dong-hee Na) in branch 'master': bpo-33660: Fix PosixPath to resolve a relative path on root https://github.com/python/cpython/commit/94ad6c674f7687ef22853cb8d42b440d6b42ddc8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:43:10 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 00:43:10 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598488990.49.0.952383314429.issue41624@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8c58d2a216ca2b5965361df9b8d8944bc7d4854d by MingZhe Hu in branch 'master': bpo-41624: fix documentation of typing.Coroutine (GH-21952) https://github.com/python/cpython/commit/8c58d2a216ca2b5965361df9b8d8944bc7d4854d ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:47:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 00:47:19 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598489239.11.0.521707844381.issue33660@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7475aa2c590e33a47f5e79e4079bca0645e93f2f by Miss Islington (bot) in branch '3.8': bpo-33660: Fix PosixPath to resolve a relative path on root (GH-21975) https://github.com/python/cpython/commit/7475aa2c590e33a47f5e79e4079bca0645e93f2f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:51:16 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 00:51:16 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598489476.24.0.113263871549.issue41609@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 022bc7572f061e1d1132a4db9d085b29707701e7 by Irit Katriel in branch 'master': bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) https://github.com/python/cpython/commit/022bc7572f061e1d1132a4db9d085b29707701e7 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:51:48 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 00:51:48 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598489508.08.0.454824646972.issue33660@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 211e4c6e9c1ab60bb2577dda6587fbec79f679b2 by Miss Islington (bot) in branch '3.9': bpo-33660: Fix PosixPath to resolve a relative path on root (#21974) https://github.com/python/cpython/commit/211e4c6e9c1ab60bb2577dda6587fbec79f679b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:52:53 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 00:52:53 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598489573.0.0.79779394483.issue33660@roundup.psfhosted.org> ?ukasz Langa added the comment: Sorry it took so long, this will get released in Python 3.8.6 and newer. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:56:11 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 00:56:11 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598489771.05.0.808461385576.issue41609@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21086 pull_request: https://github.com/python/cpython/pull/21977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 20:56:02 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 00:56:02 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598489762.03.0.24709577464.issue41609@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21085 pull_request: https://github.com/python/cpython/pull/21976 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 21:17:37 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 01:17:37 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598491057.69.0.380844942497.issue41609@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 641279e6e51b5d2e10d3fbffe6330e47c94c4bb2 by Miss Islington (bot) in branch '3.8': bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) (#21976) https://github.com/python/cpython/commit/641279e6e51b5d2e10d3fbffe6330e47c94c4bb2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 21:17:44 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 01:17:44 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598491064.17.0.941468345534.issue41609@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7361451b97a30de0e758094ac83a1fb1f01ed5bb by Miss Islington (bot) in branch '3.9': bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) (#21977) https://github.com/python/cpython/commit/7361451b97a30de0e758094ac83a1fb1f01ed5bb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 21:18:12 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 01:18:12 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598491092.15.0.137165029941.issue41609@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 21:18:33 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 27 Aug 2020 01:18:33 +0000 Subject: [issue41609] pdb's whatis command reports method as function In-Reply-To: <1598023861.67.0.741384423605.issue41609@roundup.psfhosted.org> Message-ID: <1598491113.82.0.114789908729.issue41609@roundup.psfhosted.org> ?ukasz Langa added the comment: Thank you for your contribution, Irit! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 21:58:26 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Aug 2020 01:58:26 +0000 Subject: [issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory In-Reply-To: <1527418713.03.0.682650639539.issue33660@psf.upfronthosting.co.za> Message-ID: <1598493506.65.0.19631277079.issue33660@roundup.psfhosted.org> Dong-hee Na added the comment: Thanks ?ukasz for finanlizing this work :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 22:01:55 2020 From: report at bugs.python.org (Paddy McCarthy) Date: Thu, 27 Aug 2020 02:01:55 +0000 Subject: [issue17005] Add a topological sort algorithm In-Reply-To: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za> Message-ID: <1598493715.04.0.06462575371.issue17005@roundup.psfhosted.org> Paddy McCarthy added the comment: I've been playing with Python 3.9.0rc1 and was looking at a particular graph to see when it released tasks for processing. I ran the following code: from functools import reduce from pprint import pprint as pp from collections import defaultdict from graphlib import TopologicalSorter from heapq import heapify, heappush, heappop, heappushpop print(""" ### ### TASK DEPENDENCY ### A -> B -> C ? ? ? D -> E -> F """) graph3 = {"A": {"B", "D"}, "B": {"C", "E"}, "C": {"F"}, "D": {"E"}, "E": {"F"}, } tasktime = {task: 2 for task in 'ABCDEF'} def simulate(graph, tasktime): print("\n## NEW SIMULATION") t = 0 heap = [] heapify(heap) print("\n# Task runtimes:") for node, tm in tasktime.items(): print(f" {node}: {tm}") print("\n# OUTPUT. (:> for task start times, <: for stop times).\n") ts = TopologicalSorter(graph) ts.prepare() while ts.is_active(): for node in ts.get_ready(): finish = t + tasktime[node] heappush(heap, (finish, node)) print(f"{' ' * t}{node}:> @{t}") t, node = heappop(heap) print(f"{' ' * t}{node}<: @{t}") ts.done(node) simulate(graph3, tasktime) tasktime['C'] = 1 simulate(graph3, tasktime) I got the following output: ### ### TASK DEPENDENCY ### A -> B -> C ? ? ? D -> E -> F ## NEW SIMULATION # Task runtimes: A: 2 B: 2 C: 2 D: 2 E: 2 F: 2 # OUTPUT. (:> for task start times, <: for stop times). F:> @0 F<: @2 C:> @2 E:> @2 C<: @4 E<: @4 B:> @4 D:> @4 B<: @6 D<: @6 A:> @6 A<: @8 ## NEW SIMULATION # Task runtimes: A: 2 B: 2 C: 1 D: 2 E: 2 F: 2 # OUTPUT. (:> for task start times, <: for stop times). F:> @0 F<: @2 C:> @2 E:> @2 C<: @3 E<: @4 B:> @4 D:> @4 B<: @6 D<: @6 A:> @6 A<: @8 >>> Note that in the second simulation, C finish, but B isn't then immediately started. I have my own code that also works like this but it isn't optimal. Thanks guys. ---------- nosy: +Paddy McCarthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 22:09:46 2020 From: report at bugs.python.org (Paddy McCarthy) Date: Thu, 27 Aug 2020 02:09:46 +0000 Subject: [issue17005] Add a topological sort algorithm In-Reply-To: <1358717952.33.0.209682941713.issue17005@psf.upfronthosting.co.za> Message-ID: <1598494186.24.0.0579361387136.issue17005@roundup.psfhosted.org> Paddy McCarthy added the comment: Please ignore my earlier Message-id <1598493715.04.0.06462575371.issue17005 at roundup.psfhosted.org>. I missed a dependency in cutting down a larger example. Sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 22:59:24 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Aug 2020 02:59:24 +0000 Subject: [issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available In-Reply-To: <1559649566.96.0.759993950384.issue37149@roundup.psfhosted.org> Message-ID: <1598497164.03.0.941384695658.issue37149@roundup.psfhosted.org> Terry J. Reedy added the comment: Pending improving the our docs, I would like to replace the Archive link, which is slow to respond. Issue: there is no copyright notice. Once might expect it to belong to NMT, but they seem to have disowned it by removing the web pages. The dead links should be removed from any copy. The .pdf line in the does work at this moment. If not a work-for-hire, the copyright belonged to Shipman, and now his estate. I would not add it to the PSF site without formal permission, but I don't see why linking to one unauthorized copy versus another would make much difference. ---------- versions: +Python 3.10 -Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 26 23:01:41 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 27 Aug 2020 03:01:41 +0000 Subject: [issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available In-Reply-To: <1559649566.96.0.759993950384.issue37149@roundup.psfhosted.org> Message-ID: <1598497301.8.0.461282766986.issue37149@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: patch review -> needs patch versions: -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 01:45:58 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 27 Aug 2020 05:45:58 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598507158.35.0.426879056433.issue41524@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 97eaf2b5e5c826b9abe59896a363853bef55c5d9 by wmeehan in branch 'master': bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) https://github.com/python/cpython/commit/97eaf2b5e5c826b9abe59896a363853bef55c5d9 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 01:46:30 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 05:46:30 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598507190.43.0.404085013885.issue41524@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21087 pull_request: https://github.com/python/cpython/pull/21978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 01:46:38 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 05:46:38 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598507198.3.0.422412575089.issue41524@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21088 pull_request: https://github.com/python/cpython/pull/21979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 05:53:46 2020 From: report at bugs.python.org (Jonatan Skogsfors) Date: Thu, 27 Aug 2020 09:53:46 +0000 Subject: [issue41646] Outdated shutil.copy documentation Message-ID: <1598522026.83.0.0983078348702.issue41646@roundup.psfhosted.org> New submission from Jonatan Skogsfors : In the 3.8.5 documentation for shutil.copy it says that "src and dst should be strings". However, the implementation doesn't seem to have any problem with path objects. ---------- assignee: docs at python components: Documentation messages: 375983 nosy: Jonatan Skogsfors, docs at python priority: normal severity: normal status: open title: Outdated shutil.copy documentation versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 06:28:20 2020 From: report at bugs.python.org (Matias G) Date: Thu, 27 Aug 2020 10:28:20 +0000 Subject: [issue41647] MutableMapping ".setdefault()" to return default value via __getitem__ Message-ID: <1598524100.24.0.553076023684.issue41647@roundup.psfhosted.org> New submission from Matias G : Hi, This is more a question/proposal than a real issue. I apologize in advance if this has already been debated or if it is not relevant. I noticed `setdefault` method of mutable mapping objects is returning the default value as passed in the call, when applicable, without passing through `__getitem__`. I think it would be more "symmetric" if it would return the default value set by `__setitem__` via `__getitem__`. This would handle the case of a custom MutableMapping defining a custom behaviour of `__setitem__` and `__getitem__`. Of course, in my case finally I overloaded `setdefault` to do this, but it might be worth in general, at least for the MutableMapping class. Thanks, Matias. ---------- messages: 375984 nosy: guijarro priority: normal severity: normal status: open title: MutableMapping ".setdefault()" to return default value via __getitem__ type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:23:44 2020 From: report at bugs.python.org (Kyle Meyer) Date: Thu, 27 Aug 2020 11:23:44 +0000 Subject: [issue41594] Intermittent failures of loop.subprocess_exec() to capture output In-Reply-To: <1597883051.54.0.163691000969.issue41594@roundup.psfhosted.org> Message-ID: <1598527424.43.0.494817679442.issue41594@roundup.psfhosted.org> Kyle Meyer added the comment: I should have thought to provide the output of when debug=True is passed to asyncio.run(). Here it is, with the python on my Debian system: $ python3 -V Python 3.7.3 $ python3 reproducer.py Iteration: 1 of 100 Failed on iteration 1 logfile: /tmp/asyncio-debug-rqfsxyth.log $ cat /tmp/asyncio-debug-rqfsxyth.log DEBUG: Starting iteration 1 DEBUG: Using selector: EpollSelector DEBUG: execute program 'printf' stdout= DEBUG: process 'printf' created: pid 20488 DEBUG: process 20488 exited with returncode 0 INFO: <_UnixSubprocessTransport pid=20488 running> exited with return code 0 DEBUG: Read pipe 8 connected: (<_UnixReadPipeTransport fd=8 polling>, >) DEBUG: process_exited() called INFO: execute program 'printf': <_UnixSubprocessTransport pid=20488 returncode=0 stdout=<_UnixReadPipeTransport fd=8 polling>> DEBUG: pipe_data_received(): fd=1, data=b'ok' DEBUG: Close <_UnixSelectorEventLoop running=False closed=False debug=True> DEBUG: Failed on iteration 1 And with a python built from a recent commit (8e19c8be8701): $ python -V Python 3.10.0a0 $ python reproducer.py Iteration: 1 of 100 Failed on iteration 1 logfile: /tmp/asyncio-debug-9eyhuas4.log $ cat /tmp/asyncio-debug-9eyhuas4.log DEBUG: Starting iteration 1 DEBUG: Using selector: EpollSelector DEBUG: execute program 'printf' stdout= DEBUG: process 'printf' created: pid 20524 DEBUG: process 20524 exited with returncode 0 INFO: <_UnixSubprocessTransport pid=20524 running> exited with return code 0 DEBUG: Read pipe 8 connected: (<_UnixReadPipeTransport fd=8 polling>, >) DEBUG: process_exited() called INFO: execute program 'printf': <_UnixSubprocessTransport pid=20524 returncode=0 stdout=<_UnixReadPipeTransport fd=8 polling>> DEBUG: pipe_data_received(): fd=1, data=b'ok' DEBUG: Close <_UnixSelectorEventLoop running=False closed=False debug=True> DEBUG: Failed on iteration 1 --- It looks like I can work around the issue (i.e. I don't observe any lost output) by adding this line to the attached script: diff --git a/reproducer.py b/reproducer.py index 5e04c36..a462898 100644 --- a/reproducer.py +++ b/reproducer.py @@ -25,6 +25,7 @@ async def get_stdout(): transport, protocol = await loop.subprocess_exec( lambda: Protocol(exit_future), "printf", "ok", stdin=None, stderr=None) + await asyncio.ensure_future(transport._wait()) await exit_future transport.close() return bytes(protocol.output) ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:28:20 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 11:28:20 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598527700.07.0.637166096987.issue41634@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 398575c210f79627830c5c470184f54ace950ac6 by Zackery Spytz in branch 'master': bpo-41634: Fix a typo in the curses documentation (GH-21958) https://github.com/python/cpython/commit/398575c210f79627830c5c470184f54ace950ac6 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:28:48 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 11:28:48 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598527728.09.0.985970257481.issue41634@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21089 pull_request: https://github.com/python/cpython/pull/21980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:28:56 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 11:28:56 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598527736.08.0.417463724691.issue41634@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21090 pull_request: https://github.com/python/cpython/pull/21981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:37:48 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 11:37:48 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598528268.35.0.198811536614.issue41624@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: +21091 pull_request: https://github.com/python/cpython/pull/21982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:43:41 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 11:43:41 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598528621.43.0.890129237632.issue41624@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: +21092 pull_request: https://github.com/python/cpython/pull/21983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:54:16 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 11:54:16 +0000 Subject: [issue41646] shutil.copy documentation should clarify support for path-like objects In-Reply-To: <1598522026.83.0.0983078348702.issue41646@roundup.psfhosted.org> Message-ID: <1598529256.39.0.582353278256.issue41646@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: copy uses copyfile and copymode. Both were updated to support path-like objects in https://github.com/python/cpython/pull/15141 . It makes sense to update copy's documentation too. ---------- nosy: +steve.dower, xtreak title: Outdated shutil.copy documentation -> shutil.copy documentation should clarify support for path-like objects type: -> behavior versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 07:54:42 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 11:54:42 +0000 Subject: [issue41647] MutableMapping ".setdefault()" to return default value via __getitem__ In-Reply-To: <1598524100.24.0.553076023684.issue41647@roundup.psfhosted.org> Message-ID: <1598529282.9.0.886386103265.issue41647@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 08:46:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 12:46:41 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device Message-ID: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> New submission from STINNER Victor : Issue similar to bpo-41642 "RHEL and fedora buildbots fail due to disk space error", multiple edelsohn-* buildbot worker are failing with: No space left on device. ---------- components: Tests messages: 375988 nosy: vstinner priority: normal severity: normal status: open title: edelsohn-* buildbot worker failing with: No space left on device versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 09:02:04 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 13:02:04 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598533324.39.0.566720518511.issue41648@roundup.psfhosted.org> STINNER Victor added the comment: Example of affected workers. edelsohn-fedora-rawhide-z: s390x Fedora Rawhide Refleaks 3.8 https://buildbot.python.org/all/#/builders/56/builds/8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 09:02:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 13:02:47 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598533367.88.0.18905551141.issue41648@roundup.psfhosted.org> STINNER Victor added the comment: David: Would you mind to have a look? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 09:37:05 2020 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 27 Aug 2020 13:37:05 +0000 Subject: [issue38787] PEP 573: Module State Access from C Extension Methods In-Reply-To: <1573655440.57.0.563143759574.issue38787@roundup.psfhosted.org> Message-ID: <1598535425.63.0.293099132949.issue38787@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset d9a966ae08258da2ce2a432c943d8194760f09c4 by Petr Viktorin in branch 'master': bpo-38787: Clarify docs for PyType_GetModule and warn against common mistake (GH-20215) https://github.com/python/cpython/commit/d9a966ae08258da2ce2a432c943d8194760f09c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 09:37:13 2020 From: report at bugs.python.org (miss-islington) Date: Thu, 27 Aug 2020 13:37:13 +0000 Subject: [issue38787] PEP 573: Module State Access from C Extension Methods In-Reply-To: <1573655440.57.0.563143759574.issue38787@roundup.psfhosted.org> Message-ID: <1598535433.78.0.856724238688.issue38787@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21093 pull_request: https://github.com/python/cpython/pull/21984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 09:40:07 2020 From: report at bugs.python.org (Daniel Martin) Date: Thu, 27 Aug 2020 13:40:07 +0000 Subject: [issue39375] Document os.environ[x] = y and os.putenv() as thread unsafe In-Reply-To: <1579307768.04.0.648412303004.issue39375@roundup.psfhosted.org> Message-ID: <1598535607.22.0.0725998103082.issue39375@roundup.psfhosted.org> Daniel Martin added the comment: See also https://bugs.python.org/issue40961 - that bug is not about thread safety, but another quirk around env. variable setting that needs to be documented in the documentation for os.putenv and os.getenv, and so anyone addressing this bug should probably address that one at the same time. ---------- nosy: +Daniel Martin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 10:25:19 2020 From: report at bugs.python.org (Jani Mikkonen) Date: Thu, 27 Aug 2020 14:25:19 +0000 Subject: [issue41649] Can't pass Path like objects to subprocess api's on Windows. Message-ID: <1598538318.99.0.184680655713.issue41649@roundup.psfhosted.org> New submission from Jani Mikkonen : Following code: ``` from pathlib import Path import os import subprocess dir_name = os.environ.get("WORKSPACE", None) or "." output_directory = Path(dir_name) / "results" res = subprocess.run(["mytest", "--output", output_directory]) ``` Works on macos and linux but on windows, this causes "TypeError: argument of type 'WindowsPath' is not iterable" at https://github.com/python/cpython/blob/master/Lib/subprocess.py#L568 (line is different, depending on the actual python release but i guess that gives the idea where it is).. Quick test to check if i can do `" " in Path("/tmp")` on posix platforms shows the same exception but with PosixPath type but apparently this sort of check does not happen on those platforms as the example code works fine there. It would be nice to be able to pass path objects to subprocess api calls also in windows without explicitly casting the object into string before passing it as argument. ---------- components: Windows messages: 375993 nosy: paul.moore, rasjani, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Can't pass Path like objects to subprocess api's on Windows. type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 10:37:46 2020 From: report at bugs.python.org (Ma Lin) Date: Thu, 27 Aug 2020 14:37:46 +0000 Subject: [issue35228] Index search in CHM help crashes viewer In-Reply-To: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za> Message-ID: <1598539066.7.0.296354737866.issue35228@roundup.psfhosted.org> Ma Lin added the comment: > More realistically, including the docs as unbundled HTML files > and relying on the default browser is probably an all-around better idea. CHM's index function is very convenient, I almost always use this feature when I use CHM. How about use tkinter to write a doc indexing tool, it reads the indexes in this page: https://docs.python.org/3/genindex-all.html Its behavior is the same as CHM's index, except that the link is opened in browser. This indexing tool can be packaged with Python installer, just like IDLE, then MacOS/Linux users can also use the index. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 10:40:41 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 14:40:41 +0000 Subject: [issue41649] Can't pass Path like objects to subprocess api's on Windows. In-Reply-To: <1598538318.99.0.184680655713.issue41649@roundup.psfhosted.org> Message-ID: <1598539241.23.0.339703181034.issue41649@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue31961 ---------- nosy: +serhiy.storchaka, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 10:58:13 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 27 Aug 2020 14:58:13 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598540293.0.0.384082398248.issue41648@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +David.Edelsohn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 11:36:05 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 15:36:05 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598542565.5.0.158126020334.issue41648@roundup.psfhosted.org> STINNER Victor added the comment: "xtreak set nosy: + David.Edelsohn" Strange. I'm quite sure that I added him to the nosy list when I wrote my previous comment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 11:38:18 2020 From: report at bugs.python.org (=?utf-8?b?VsOhY2xhdiBEdm/FmcOhaw==?=) Date: Thu, 27 Aug 2020 15:38:18 +0000 Subject: [issue35228] Index search in CHM help crashes viewer In-Reply-To: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za> Message-ID: <1598542698.92.0.875543318297.issue35228@roundup.psfhosted.org> V?clav Dvo??k added the comment: I have just apparently discovered a workaround! (Thanks to @chrullrich whose comment gave me the hint.) Maybe it's been obvious to everybody this whole time but I have only now found out that when I delete the file %APPDATA%\Microsoft\HTML Help\hh.dat (in my case c:\Users\dvorak\AppData\Roaming\Microsoft\HTML Help\hh.dat), the problem seems to go away. I'm so happy I just had to share. :) I also have another, possibly naive idea. While Microsoft has ignored this issue for years, they have recently "helped the community release their distribution of Python to the Microsoft Store" (https://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update/), and by "they", apparently I mean the very same Steve Dower who comments here, as I just realized. :-D (So... thanks, Steve.) So I'm thinking, as we actually have a Microsoft insider here, wouldn't it be possible to make Microsoft fix the viewer so that it, I don't know, possibly DOESN'T CRASH? I assume that Microsoft has plenty of those crash reports in some database? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 11:49:08 2020 From: report at bugs.python.org (Charalampos Stratakis) Date: Thu, 27 Aug 2020 15:49:08 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598543348.39.0.278639289599.issue41648@roundup.psfhosted.org> Charalampos Stratakis added the comment: Note: I found that all my Fedora and RHEL8 buildbots have issues with connecting to the master buildbot server. Not sure if a related package got updated and prompts the disconnects (as the RHEL7 ones are fine), or if it's relevant to the master buildbot server migration. ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 11:56:31 2020 From: report at bugs.python.org (David Edelsohn) Date: Thu, 27 Aug 2020 15:56:31 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598543791.51.0.123218846321.issue41648@roundup.psfhosted.org> David Edelsohn added the comment: It really would be better to discuss this in the builtbot mailing list and not Python issue tracker. I have been seeing problems with many buildbots for the past few weeks, not just the s390x bots. I receive messages that all of the bots disconnected, but the bots themselves are fine. I also find many temporary files left in the bots, filling the /tmp filesystem. I believe that something else has degraded. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 11:58:21 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 15:58:21 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598543901.25.0.13591118009.issue41648@roundup.psfhosted.org> STINNER Victor added the comment: > It really would be better to discuss this in the builtbot mailing list and not Python issue tracker. Pablo, me and a few otheres are using the Python bug tracker to track buildbot issues. But I'm fine with also discussing these issues on python-buildbot list. I suggested to Charalampos to write there: https://mail.python.org/archives/list/python-buildbots at python.org/thread/R4CPNQFTOHBKU5VHCOPM2OBXWY5JC5SC/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:03:42 2020 From: report at bugs.python.org (David Edelsohn) Date: Thu, 27 Aug 2020 16:03:42 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598544222.1.0.195114638185.issue41648@roundup.psfhosted.org> David Edelsohn added the comment: If they want to discuss here, fine, but the failing bot is a symptom not the problem. The Buidlbot infrastructure is unstable, causing disconnects and leaving un-removed files. If one looks at the workers, one can see many of the architectures in Exception states. I would appreciate a discussion of the underlying issue and not "edelsohn-* buildbot workers failing". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:08:22 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 16:08:22 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598544502.22.0.447406309502.issue41648@roundup.psfhosted.org> STINNER Victor added the comment: > I would appreciate a discussion of the underlying issue and not "edelsohn-* buildbot workers failing". FYI Charalampos, Pablo and me are investigating the root issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:11:57 2020 From: report at bugs.python.org (Princy katlana) Date: Thu, 27 Aug 2020 16:11:57 +0000 Subject: [issue41650] .pyc file not running in cross python versions Message-ID: <1598544717.94.0.558076008933.issue41650@roundup.psfhosted.org> New submission from Princy katlana : When I tried to compile the python source code from python version 3.5 and run the .pyc file on python version 3.6 then it shows the following exception: RuntimeError: Bad magic number in .pyc file ---------- components: Build messages: 376003 nosy: princykatlana priority: normal severity: normal status: open title: .pyc file not running in cross python versions type: crash versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:17:57 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 27 Aug 2020 16:17:57 +0000 Subject: [issue41650] .pyc file not running in cross python versions In-Reply-To: <1598544717.94.0.558076008933.issue41650@roundup.psfhosted.org> Message-ID: <1598545077.29.0.325986719305.issue41650@roundup.psfhosted.org> Ammar Askar added the comment: .pyc files aren't meant to be portable, they contain raw bytecode and data specific to the version of Python they were compiled on. For example, search for "Changed in version 3.6" here and you'll see all the little changes to the bytecode format: https://docs.python.org/3/library/dis.html You'll have to compile your python source code on 3.6 if you intend to run it on a 3.6 interpreter. ---------- nosy: +ammar2 resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:26:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 16:26:35 +0000 Subject: [issue41648] edelsohn-* buildbot worker failing with: No space left on device In-Reply-To: <1598532401.11.0.67076258216.issue41648@roundup.psfhosted.org> Message-ID: <1598545595.84.0.215065274442.issue41648@roundup.psfhosted.org> STINNER Victor added the comment: Hum, there are many affected workers. I will reuse bpo-41642 instead. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> RHEL and fedora buildbots fail due to disk space error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:29:45 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 16:29:45 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598545785.12.0.758418162707.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: 27 buildbot workers are detached. They are are detached every minute! Affected workers: aixtools-aix-power6 billenstein-macos bolen-ubuntu bolen-windows10 bolen-windows7 cstratak-RHEL7-aarch64 cstratak-RHEL7-ppc64le cstratak-RHEL7-x86_64 cstratak-RHEL8-fips-x86_64 cstratak-RHEL8-ppc64le cstratak-fedora-stable-ppc64le edelsohn-aix-ppc64 edelsohn-debian-z edelsohn-fedora-ppc64 edelsohn-fedora-rawhide-z edelsohn-fedora-z edelsohn-rhel-z edelsohn-rhel8-z edelsohn-sles-z gps-clang-ubsan gps-debian-profile-opt gps-raspbian isidentical-centos-power8 kloth-win64 koobs-freebsd-564d ware-alpine ware-win81-release Output of: grep Worker.detach twistd.log|sed -e 's!.*(!!g;s!)!!g'|sort -u|uniq Example of server logs: 2020-08-27 15:33:49+0000 [Broker,33580,10.132.169.156] Worker.detached(billenstein-macos) 2020-08-27 15:34:43+0000 [Broker,33608,10.132.169.156] Worker.detached(billenstein-macos) 2020-08-27 15:35:40+0000 [Broker,33635,10.132.169.157] Worker.detached(billenstein-macos) (...) ---------- title: RHEL and fedora buildbots fail due to disk space error -> Buildbot: workers detached every minute and "no space left on device" issue _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:30:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 16:30:08 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598545808.27.0.39673518837.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: I closed bpo-41648 "edelsohn-* buildbot worker failing with: No space left on device" as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:31:40 2020 From: report at bugs.python.org (David Edelsohn) Date: Thu, 27 Aug 2020 16:31:40 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598545900.55.0.0543336732751.issue41642@roundup.psfhosted.org> David Edelsohn added the comment: I have found a large number of un-removed files in /tmp. Things seem to function better with Buildbots running older 0.x "buildslave" as opposed to newer "builtbot-worker" instances. ---------- nosy: +David.Edelsohn title: Buildbot: workers detached every minute and "no space left on device" issue -> RHEL and fedora buildbots fail due to disk space error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:36:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 16:36:33 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598546193.38.0.331749239748.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: > I have found a large number of un-removed files in /tmp. Right. I found many /tmp/ccXXXX.XXX and /tmp/tmpXXXXX files. Around 20 GB of these files! Maybe using passing "-pipe" to gcc/clang would avoid the /tmp/ccXXXX.XXX files when a build is interrupted. For example, I saw assembly files (.s) of around 20 MB. I don't know what are the /tmp/tmpXXXXX files. I'm disappointed that in 2020, buildbot has no safe way to ensure that all created files are removed at the end of a build. chroot, containers, etc. are effecient way to ensure that everything is removed at the end of a build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 12:38:02 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 16:38:02 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598546282.0.0.685288799312.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: On the worker (client) side, I see many "lost remote step" every 1 to 3 minutes. Example with the PPC64LE Fedora Stable (cstratak-fedora-stable-ppc64le) worker: 2020-08-27 01:30:09-0400 [Broker,client] lost remote step 2020-08-27 01:31:57-0400 [Broker,client] lost remote step 2020-08-27 01:34:34-0400 [Broker,client] lost remote step 2020-08-27 01:36:29-0400 [Broker,client] lost remote step 2020-08-27 01:38:37-0400 [Broker,client] lost remote step (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 13:18:13 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 27 Aug 2020 17:18:13 +0000 Subject: [issue41642] RHEL and fedora buildbots fail due to disk space error In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598548693.09.0.151129671991.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: The buildbot server migrated to a new machine and is now behind a load balancer. tcp/80 (buildbot web page, HTTP) and tcp/9020 (used by buildbot workers) are both behind the load balancer. Maybe the load balancer closes TCP connections which are idle for 60 seconds? Buildbot workers have a TCP keepalive option of 1 hour (3600 seconds) by default: https://docs.buildbot.net/latest/manual/configuration/workers.html#master-worker-tcp-keepalive Pablo told me that his worker uses a keepalive of 2 minutes (120 seconds). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 14:58:48 2020 From: report at bugs.python.org (Alexander Boeckmann) Date: Thu, 27 Aug 2020 18:58:48 +0000 Subject: [issue40553] Python 3.8.2 Mac freezing/not responding when saving new programs In-Reply-To: <1588884932.92.0.367303002443.issue40553@roundup.psfhosted.org> Message-ID: <1598554728.98.0.0770301220064.issue40553@roundup.psfhosted.org> Alexander Boeckmann added the comment: So over the past week the issue resolved its self. I unfortunately did not get a video or a screenshot but thought you might want to know this So maybe Apple did something or you guys fixed it. Anyways, have a good day! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 15:40:40 2020 From: report at bugs.python.org (Mark Roseman) Date: Thu, 27 Aug 2020 19:40:40 +0000 Subject: [issue37149] link to John Shipman's Tkinter 8.5 documentation fails: website no longer available In-Reply-To: <1559649566.96.0.759993950384.issue37149@roundup.psfhosted.org> Message-ID: <1598557240.45.0.580139165452.issue37149@roundup.psfhosted.org> Mark Roseman added the comment: I've posted a copy at https://tkdocs.com/shipman/ I've lightly modified it to add a site header and explanation of where the material comes from and caveats about age to each page, and have removed or crossed out dead links, requests for feedback, etc. I agree with Terry's assessment of the copyright issues. While I don't expect anyone with a valid claim to contact me about the mirrored copy, I'd be happy to address any concerns if they do arise. If this all seems okay, I would very greatly appreciate if someone could update the links in the Python documentation for all the relevant branches and shepherd that through the approval process. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 17:16:51 2020 From: report at bugs.python.org (Paul Ganssle) Date: Thu, 27 Aug 2020 21:16:51 +0000 Subject: [issue32313] Wrong inspect.getsource for datetime In-Reply-To: <1513201599.09.0.213398074469.issue32313@psf.upfronthosting.co.za> Message-ID: <1598563011.92.0.793615950655.issue32313@roundup.psfhosted.org> Paul Ganssle added the comment: I think that we should re-examine this issue after GH-20472 is merged. I'm not really sure how that will affect this and indeed *how* it should affect this. I am not sure whether people are relying on the current behavior, or what use cases would be improved if we had a different behavior. With regards to this: > The documentation for getfile says "This will fail with a TypeError if the object is a built-in module, class, or function." > https://docs.python.org/3/library/inspect.html#inspect.getfile This is a bit unclear to me, and I'm not entirely sure if `datetime` qualifies. I think of built-in classes as things like `int` and `float`, and built-in functions as things like `abs` and `sum`, and `datetime` is an extension module ? albeit one with a C implementation, and one that is in the standard library. We should probably clarify the wording of `inspect.getsource` and determine what the intended semantics are for PEP-399-style modules, with both a C and pure Python implementation and the C implementation is what's being used. Error? Point to the Python implementation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 20:41:44 2020 From: report at bugs.python.org (mohamed koubaa) Date: Fri, 28 Aug 2020 00:41:44 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1598575304.62.0.769426793986.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +21094 pull_request: https://github.com/python/cpython/pull/21985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 22:17:47 2020 From: report at bugs.python.org (mohamed koubaa) Date: Fri, 28 Aug 2020 02:17:47 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1598581067.94.0.286618941201.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +21095 pull_request: https://github.com/python/cpython/pull/21986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 22:32:08 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 28 Aug 2020 02:32:08 +0000 Subject: [issue41647] MutableMapping ".setdefault()" to return default value via __getitem__ In-Reply-To: <1598524100.24.0.553076023684.issue41647@roundup.psfhosted.org> Message-ID: <1598581928.91.0.446246774793.issue41647@roundup.psfhosted.org> Raymond Hettinger added the comment: The current code makes sense to me and also mirrors the actual implementation of setdefault() for regular dictionaries. While I can see what you're trying do, it is a feature that __getitem__() is not called. And for regular dicts, that is the only way to make it an atomic operation. In any case, the proposal would be a behavior change that breaks code ? users are likely and justifiably relying on the actual default value being returned rather than a possibly new value computed by the __getitem__() method. There is also an efficiency concern. Changing the behavior implies that missing keys would trigger one initial search, then a store for the default, and then another subsequent lookup. Speaking only for myself, I know that I would never want that by default. If required, I would prefer to override setdefault() and explicitly spell-out the new behavior. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 23:27:58 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Aug 2020 03:27:58 +0000 Subject: [issue41647] MutableMapping ".setdefault()" to return default value via __getitem__ In-Reply-To: <1598524100.24.0.553076023684.issue41647@roundup.psfhosted.org> Message-ID: <1598585278.79.0.986646492574.issue41647@roundup.psfhosted.org> Guido van Rossum added the comment: I'm with Raymond. Closing. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 23:44:36 2020 From: report at bugs.python.org (Alex) Date: Fri, 28 Aug 2020 03:44:36 +0000 Subject: [issue41651] Pip: Wrong Showing of Progressbar when Downloading Modules Message-ID: <1598586276.58.0.803654971013.issue41651@roundup.psfhosted.org> New submission from Alex <2423067593 at qq.com>: 1. Abstract Command line in Windows the progress bar doesn't work like usual after about half of the downloading process. Another remarkble bug is the length of the progressbar seems to be lengthened. 2. Reason(my opinion) I noticed that this bug only happens when the rightmost character reaches the end of the cmd screen. I infer the reason of this bug from the phenomenon: when the progres bar is going to be lengthened, pip will delete the last line. Pip consider the line as an enter that the program output. However, the cmd consider the line as an enter whether it is output by the program or added by cmd itself because of the rightmost character reaches the end of the cmd screen. When pip make cmd delete the last line, pip want cmd to delete the whole progressbar, but cmd only deletes a part of the progressbar which are in the line 2. 3. Instance An instance of the bug, showing what happenred when upgrading pip via py -m pip install --upgrade pip. You can see the progress bar wasn't deleted completly. C:\Users\******>py -m pip install --upgrade pip Collecting pip Downloading pip-20.2.2-py2.py3-none-any.whl (1.5 MB) |?????????????? | 634 kB 21 kB/s eta 0:00:41 |?????????????? | 645 kB 21 kB/s eta 0:00:41 |?????????????? | 655 kB 21 kB/s eta 0:00:40 |?????????????? | 665 kB 21 kB/s eta 0:00:40 |??????????????? | 675 kB 23 kB/s eta 0:00:3 |??????????????? | 686 kB 23 kB/s eta 0:00:3 |??????????????? | 696 kB 23 kB/s eta 0:00:3 |??????????????? | 706 kB 33 kB/s eta 0:00:2 |??????????????? | 716 kB 33 kB/s eta 0:00:2 |???????????????? | 727 kB 28 kB/s eta 0:00: |???????????????? | 737 kB 28 kB/s eta 0:00: |???????????????? | 747 kB 28 kB/s eta 0:00: |???????????????? | 757 kB 23 kB/s eta 0:00: |????????????????? | 768 kB 23 kB/s eta 0:00 |????????????????? | 778 kB 23 kB/s eta 0:00 |????????????????? | 788 kB 20 kB/s eta 0:00 |????????????????? | 798 kB 20 kB/s eta 0:00 |????????????????? | 808 kB 20 kB/s eta 0:00 |?????????????????? | 819 kB 20 kB/s eta 0:0 |?????????????????? | 829 kB 20 kB/s eta 0:0 |?????????????????? | 839 kB 25 kB/s eta 0:0 |?????????????????? | 849 kB 25 kB/s eta 0:0 |?????????????????? | 860 kB 19 kB/s eta 0:0 |??????????????????? | 870 kB 19 kB/s eta 0: |??????????????????? | 880 kB 17 kB/s eta 0: |??????????????????? | 890 kB 17 kB/s eta 0: |??????????????????? | 901 kB 17 kB/s eta 0: |???????????????????? | 911 kB 17 kB/s eta 0 |???????????????????? | 921 kB 17 kB/s eta 0 |???????????????????? | 931 kB 12 kB/s eta 0 |???????????????????? | 942 kB 12 kB/s eta 0 |???????????????????? | 952 kB 12 kB/s eta 0 |????????????????????? | 962 kB 13 kB/s eta |????????????????????? | 972 kB 13 kB/s eta |????????????????????? | 983 kB 8.9 kB/s eta |????????????????????? | 993 kB 6.7 kB/s eta |?????????????????????? | 1.0 MB 6.7 kB/s et |?????????????????????? | 1.0 MB 6.7 kB/s et |?????????????????????? | 1.0 MB 6.7 kB/s et |?????????????????????? | 1.0 MB 6.7 kB/s et |?????????????????????? | 1.0 MB 8.4 kB/s et |??????????????????????? | 1.1 MB 8.4 kB/s e |??????????????????????? | 1.1 MB 8.4 kB/s e |??????????????????????? | 1.1 MB 8.8 kB/s e |??????????????????????? | 1.1 MB 8.8 kB/s e |??????????????????????? | 1.1 MB 24 kB/s et |???????????????????????? | 1.1 MB 24 kB/s e |???????????????????????? | 1.1 MB 16 kB/s e |???????????????????????? | 1.1 MB 16 kB/s e |???????????????????????? | 1.1 MB 14 kB/s e |????????????????????????? | 1.1 MB 14 kB/s |????????????????????????? | 1.2 MB 14 kB/s |????????????????????????? | 1.2 MB 14 kB/s |????????????????????????? | 1.2 MB 12 kB/s |????????????????????????? | 1.2 MB 12 kB/s |?????????????????????????? | 1.2 MB 12 kB/s |?????????????????????????? | 1.2 MB 12 kB/s |?????????????????????????? | 1.2 MB 12 kB/s |?????????????????????????? | 1.2 MB 19 kB/s |??????????????????????????? | 1.2 MB 19 kB/ |??????????????????????????? | 1.2 MB 20 kB/ |??????????????????????????? | 1.3 MB 15 kB/ |??????????????????????????? | 1.3 MB 15 kB/ |??????????????????????????? | 1.3 MB 15 kB/ |???????????????????????????? | 1.3 MB 15 kB |???????????????????????????? | 1.3 MB 20 kB |???????????????????????????? | 1.3 MB 20 kB |???????????????????????????? | 1.3 MB 14 kB |???????????????????????????? | 1.3 MB 14 kB |????????????????????????????? | 1.3 MB 14 k |????????????????????????????? | 1.4 MB 14 k |????????????????????????????? | 1.4 MB 14 k |????????????????????????????? | 1.4 MB 14 k |?????????????????????????????? | 1.4 MB 14 |?????????????????????????????? | 1.4 MB 14 |?????????????????????????????? | 1.4 MB 12 |?????????????????????????????? | 1.4 MB 9.4 |?????????????????????????????? | 1.4 MB 9.4 |??????????????????????????????? | 1.4 MB 9. |??????????????????????????????? | 1.4 MB 9. |??????????????????????????????? | 1.5 MB 9. |??????????????????????????????? | 1.5 MB 11 |????????????????????????????????| 1.5 MB 1 |????????????????????????????????| 1.5 MB 1 |????????????????????????????????| 1.5 MB 1 |????????????????????????????????| 1.5 MB 1 4 kB/s Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 20.1.1 Uninstalling pip-20.1.1: Successfully uninstalled pip-20.1.1 WARNING: The scripts pip.exe, pip3.8.exe and pip3.exe are installed in 'C:\Use rs\Administrator\AppData\Local\Programs\Python\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warn ing, use --no-warn-script-location. Successfully installed pip-20.2.2 C:\Users\******> ---------- components: Library (Lib) messages: 376017 nosy: Alex-Python-Programmer priority: normal severity: normal status: open title: Pip: Wrong Showing of Progressbar when Downloading Modules type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 27 23:53:22 2020 From: report at bugs.python.org (Alex) Date: Fri, 28 Aug 2020 03:53:22 +0000 Subject: [issue41652] An Advice on Turning Ellipsis into Keyword Message-ID: <1598586802.42.0.262932705124.issue41652@roundup.psfhosted.org> New submission from Alex <2423067593 at qq.com>: In early versions of python, programmers can simply swap True and False by >>> True, False = False, True Then True and False and None become keywords so programmers can't change their value. ... is also a keyword, but Ellipsis is not. So the code below is right: >>> Ellipsis = 1 >>> print(Ellipsis) 1 If Ellipsis become a keyword, this will be better. ---------- components: Interpreter Core messages: 376018 nosy: Alex-Python-Programmer priority: normal severity: normal status: open title: An Advice on Turning Ellipsis into Keyword type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 00:40:03 2020 From: report at bugs.python.org (twoone3) Date: Fri, 28 Aug 2020 04:40:03 +0000 Subject: [issue41653] About the use of cpython console mode problem Message-ID: <1598589603.24.0.524762493055.issue41653@roundup.psfhosted.org> New submission from twoone3 <3197653242 at qq.com>: When I use the Py_Initialize function in cpython, the console is forced to become gbk encoding, hoping to be compatible with UTF-8 ---------- components: C API files: Screenshot_2020_0828_104656.png messages: 376019 nosy: twoone3 priority: normal severity: normal status: open title: About the use of cpython console mode problem type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49430/Screenshot_2020_0828_104656.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 02:10:13 2020 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 28 Aug 2020 06:10:13 +0000 Subject: [issue41652] An Advice on Turning Ellipsis into Keyword In-Reply-To: <1598586802.42.0.262932705124.issue41652@roundup.psfhosted.org> Message-ID: <1598595013.53.0.448457863605.issue41652@roundup.psfhosted.org> Josh Rosenberg added the comment: You can do the same thing to replace int, float, dict, len, and all the other built-in classes and functions. Why is Ellipsis so special that it needs protection, especially when, as you note, ... is an available unoverrideable way to refer to it? Making new keywords is a high bar (because it can break existing code). What justifies this one beyond "don't want folks to mess with a barely used name"? ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 03:04:10 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Aug 2020 07:04:10 +0000 Subject: [issue41652] An Advice on Turning Ellipsis into Keyword In-Reply-To: <1598586802.42.0.262932705124.issue41652@roundup.psfhosted.org> Message-ID: <1598598250.11.0.142225660405.issue41652@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is Ellipsis class in the ast module. Although it is deprecated now. But I there may be Ellipsis names also in third-party libraries. Making Ellipsis a keyword would break them. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 04:32:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Aug 2020 08:32:35 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598603555.84.0.357238231618.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: > The buildbot server migrated to a new machine and is now behind a load balancer. tcp/80 (buildbot web page, HTTP) and tcp/9020 (used by buildbot workers) are both behind the load balancer. > (...) > Buildbot workers have a TCP keepalive option of 1 hour (3600 seconds) by default (...) Ernest confirmed that there are edge load balancers for the PSF infra in DigitalOcean. He updated the load balancers to offer a full 24 hour timeout on buildbot TCP connections. (Yesterday around 17:30 UTC.) It seems like it doesn't fix the issue. Example in server logs: (...) 2020-08-28 08:21:55+0000 [Broker,50831,10.132.169.157] Worker.detached(koobs-freebsd-564d) 2020-08-28 08:23:25+0000 [Broker,50856,10.132.169.157] Worker.detached(koobs-freebsd-564d) 2020-08-28 08:24:55+0000 [Broker,50881,10.132.169.157] Worker.detached(koobs-freebsd-564d) 2020-08-28 08:26:26+0000 [Broker,50906,10.132.169.157] Worker.detached(koobs-freebsd-564d) 2020-08-28 08:27:56+0000 [Broker,50931,10.132.169.156] Worker.detached(koobs-freebsd-564d) (...) ---------- title: RHEL and fedora buildbots fail due to disk space error -> Buildbot: workers detached every minute and "no space left on device" issue _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 04:45:09 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Aug 2020 08:45:09 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598604309.61.0.815936573778.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: I added keepalive_interval=60 parameter to Worker() in the server configuration: https://github.com/python/buildmaster-config/commit/2d28a4cfe77a3e206028613524a1e938801a1655 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 04:59:48 2020 From: report at bugs.python.org (Jani Mikkonen) Date: Fri, 28 Aug 2020 08:59:48 +0000 Subject: [issue41649] Can't pass Path like objects to subprocess api's on Windows. In-Reply-To: <1598538318.99.0.184680655713.issue41649@roundup.psfhosted.org> Message-ID: <1598605188.28.0.882606240173.issue41649@roundup.psfhosted.org> Jani Mikkonen added the comment: @xtreak I went thru the comments of the report you linked. It definitely looks like the discussion was related but it didnt really fix the issue here. https://bugs.python.org/issue31961#msg311775 without trying out, that comment actually touches the underlying issue, on windows, list2cmdline throws that typeerror because iterated argument list (output_directory in my example) is WindowsPath and thus not iterable and and testing the arg with "in" operator fails .. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 05:11:28 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Aug 2020 09:11:28 +0000 Subject: [issue22577] local variable changes lost after pdb jump command In-Reply-To: <1412763709.52.0.382735862315.issue22577@psf.upfronthosting.co.za> Message-ID: <1598605888.26.0.232004803902.issue22577@roundup.psfhosted.org> Irit Katriel added the comment: This is now resolved, on Python 3.10 I get: >python -m pdb tmp1.py Running Release|Win32 interpreter... > c:\users\user\src\cpython\tmp1.py(1)() -> def foo(x): (Pdb) jump 4 > c:\users\user\src\cpython\tmp1.py(4)() -> lineno = 4 (Pdb) q C:\Users\User\src\cpython>python -m pdb tmp1.py Running Release|Win32 interpreter... > c:\users\user\src\cpython\tmp1.py(1)() -> def foo(x): (Pdb) x=123 (Pdb) jump 4 > c:\users\user\src\cpython\tmp1.py(4)() -> lineno = 4 (Pdb) x 123 (Pdb) I believe this ticket can be closed. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 05:41:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Aug 2020 09:41:23 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598607683.8.0.978116829438.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: There are multiple errors in the buildbot server logs. I'm not sure if it's related or not. 2020-08-28 09:16:25+0000 [-] while invoking > Traceback (most recent call last): File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks result = g.send(result) File "/srv/buildbot/venv/lib/python3.8/site-packages/buildbot/reporters/http.py", line 80, in getMoreInfoAndSend yield self.send(build) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 1613, in unwindGenerator return _cancellableInlineCallbacks(gen) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 1529, in _cancellableInlineCallbacks _inlineCallbacks(None, g, status) --- --- File "/srv/buildbot/venv/lib/python3.8/site-packages/buildbot/reporters/http.py", line 80, in getMoreInfoAndSend yield self.send(build) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks result = g.send(result) File "/srv/buildbot/venv/lib/python3.8/site-packages/buildbot/reporters/github.py", line 133, in send m = re.search(r"refs/pull/([0-9]*)/merge", branch) File "/usr/lib/python3.8/re.py", line 201, in search return _compile(pattern, flags).search(string) builtins.TypeError: expected string or bytes-like object Error when stopping the server. It seems like this one is just that a client tries to reconnect whereas the server is down: 2020-08-28 09:30:43+0000 [HTTP11ClientProtocol (TLSMemoryBIOProtocol),client] BuildMaster is stopped 2020-08-28 09:30:43+0000 [HTTP11ClientProtocol (TLSMemoryBIOProtocol),client] invalid login from unknown user 'ware-win81-release' 2020-08-28 09:30:43+0000 [HTTP11ClientProtocol (TLSMemoryBIOProtocol),client] Peer will receive following PB traceback: 2020-08-28 09:30:43+0000 [HTTP11ClientProtocol (TLSMemoryBIOProtocol),client] Unhandled Error Traceback (most recent call last): File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 460, in callback self._startRunCallbacks(result) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks self._runCallbacks() File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks current.result = callback(current.result, *args, **kw) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 1475, in gotResult _inlineCallbacks(r, g, status) --- --- File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks result = g.send(result) File "/srv/buildbot/venv/lib/python3.8/site-packages/buildbot/pbmanager.py", line 217, in requestAvatarId eventually(self.master.initLock.release) builtins.AttributeError: 'NoneType' object has no attribute 'initLock' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 05:50:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Aug 2020 09:50:46 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598608246.13.0.498249111177.issue41642@roundup.psfhosted.org> STINNER Victor added the comment: On the server side, it seems like the "edelsohn-rhel8-z" worker is detached because its TCP connection is closed, only 87 seconds after the worker was attached. I added some debug traces: 2020-08-28 09:44:02+0000 [Broker,2,10.132.169.156] worker 'edelsohn-rhel8-z' attaching from IPv4Address(type='TCP', host='10.132.169.156', port=56234) 2020-08-28 09:44:02+0000 [Broker,2,10.132.169.156] Got workerinfo from 'edelsohn-rhel8-z' (...) 2020-08-28 09:45:29+0000 [Broker,2,10.132.169.156] @ detached: worker= 2020-08-28 09:45:29+0000 [Broker,2,10.132.169.156] @ detached: TB: File "", line 1, in File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/scripts/twistd.py", line 31, in run app.run(runApp, ServerOptions) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/application/app.py", line 674, in run runApp(config) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/scripts/twistd.py", line 25, in runApp runner.run() File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/application/app.py", line 385, in run self.postApplication() File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/scripts/_twistd_unix.py", line 268, in postApplication self.startReactor(None, self.oldstdout, self.oldstderr) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/application/app.py", line 398, in startReactor runReactorWithLogging( File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/application/app.py", line 312, in runReactorWithLogging reactor.run() File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/base.py", line 1283, in run self.mainLoop() File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/base.py", line 1295, in mainLoop self.doIteration(t) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/epollreactor.py", line 235, in doPoll log.callWithLogger(selectable, _drdw, selectable, fd, event) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/python/log.py", line 103, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/python/log.py", line 86, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/python/context.py", line 122, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/python/context.py", line 85, in callWithContext return func(*args,**kw) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 627, in _doReadOrWrite self._disconnectSelectable(selectable, why, inRead) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 252, in _disconnectSelectable selectable.readConnectionLost(f) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/tcp.py", line 307, in readConnectionLost self.connectionLost(reason) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/internet/tcp.py", line 327, in connectionLost protocol.connectionLost(reason) File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/spread/pb.py", line 717, in connectionLost notifier() File "/srv/buildbot/venv/lib/python3.8/site-packages/twisted/spread/pb.py", line 1572, in maybeLogout fn() File "/srv/buildbot/venv/lib/python3.8/site-packages/buildbot/pbmanager.py", line 190, in return (pb.IPerspective, persp, lambda: persp.detached(mind)) File "/srv/buildbot/venv/lib/python3.8/site-packages/buildbot/worker/protocols/pb.py", line 155, in detached import traceback, io; out = io.StringIO(); traceback.print_stack(file=out); tb = out.getvalue() It doesn't say if the client closed the connection on purpose, or if the load balancer closed an inactive connection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 06:09:52 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 28 Aug 2020 10:09:52 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1598609392.23.0.610813601322.issue15443@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 20.0 -> 21.0 pull_requests: +21096 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 06:15:59 2020 From: report at bugs.python.org (Oleg Hoefling) Date: Fri, 28 Aug 2020 10:15:59 +0000 Subject: [issue41654] Segfault when raising MemoryError Message-ID: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> New submission from Oleg Hoefling : First of all, I guess this is a somewhat obscure error that is unlikely to occur in a usual context, nevertheless IMO worth reporting. We observed this when unit-testing custom exception reporting mechanism, raising different exceptions in different contexts and then analyzing whether they are processed correctly. This is a somewhat dull example I managed to extract from our tests: from pathlib import Path from unittest.mock import patch class TestException(MemoryError): pass class report_ctx: def __enter__(self): return self def __exit__(self, exc_type, exc_value, tb): report(exc_value) class raises: def __init__(self, ex): self.ex = ex def __enter__(self): return self def __exit__(self, exc_type, exc_value, tb): return issubclass(exc_type, self.ex) def report(ex): pass def error(): raise MemoryError modname = Path(__file__).stem for _ in range(10): with patch(f"{modname}.report"): with raises(MemoryError), report_ctx(): raise MemoryError with raises(TestException): raise TestException with raises(MemoryError): error() that yields: Fatal Python error: Segmentation fault Current thread 0x00007fcf0833b740 (most recent call first): File "/home/oleg.hoefling/projects/private/python-memoryerror-segfault/main.py", line 38 in File "", line 228 in _call_with_frames_removed File "", line 790 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "/usr/lib64/python3.9/unittest/mock.py", line 1236 in _importer File "/usr/lib64/python3.9/unittest/mock.py", line 1564 in File "/usr/lib64/python3.9/unittest/mock.py", line 1389 in __enter__ File "/home/oleg.hoefling/projects/private/python-memoryerror-segfault/main.py", line 36 in ---------- components: Interpreter Core messages: 376028 nosy: hoefling priority: normal severity: normal status: open title: Segfault when raising MemoryError type: crash versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 06:17:36 2020 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Fri, 28 Aug 2020 10:17:36 +0000 Subject: [issue41651] Pip: Wrong Showing of Progressbar when Downloading Modules In-Reply-To: <1598586276.58.0.803654971013.issue41651@roundup.psfhosted.org> Message-ID: <1598609856.22.0.0876166283348.issue41651@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: Thanks for the report, that does look like unfriendly UX. pip is maintained separately and then vendored (included/packaged in). Could you please file an issue here instead: https://github.com/pypa/pip/issues (I would do so myself, but as I do not develop on Windows might not be best placed to provide feedback). ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 06:30:39 2020 From: report at bugs.python.org (Oleg Hoefling) Date: Fri, 28 Aug 2020 10:30:39 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598610639.78.0.724635954475.issue41654@roundup.psfhosted.org> Oleg Hoefling added the comment: If this is of any help, I've set up an example repository containing the snippet: https://github.com/hoefling/bpo-issue-41654 Here are the results of running the snippet in Travis with Python 3.{5-10} and Pypy 3.6: https://travis-ci.com/github/hoefling/bpo-issue-41654 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 07:50:11 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 28 Aug 2020 11:50:11 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598615411.55.0.218859636423.issue41654@roundup.psfhosted.org> STINNER Victor added the comment: Aha, interesting bug report. I attached a simplified reproducer. Output with a Python built in debug mode: --- Objects/frameobject.c:590: _Py_NegativeRefcount: Assertion failed: object has negative ref count Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed Python runtime state: initialized Current thread 0x00007efd7a2d0740 (most recent call first): File "/home/vstinner/bug.py", line 29 in Abandon (core dumped) --- ---------- nosy: +vstinner Added file: https://bugs.python.org/file49431/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 08:00:03 2020 From: report at bugs.python.org (calamina) Date: Fri, 28 Aug 2020 12:00:03 +0000 Subject: [issue36207] robotsparser deny all with some rules In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org> Message-ID: <1598616003.41.0.505409076268.issue36207@roundup.psfhosted.org> calamina added the comment: I have a problem with my robot.txt on https://www.sondage-remunere.com/ ---------- nosy: +calamina _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 08:01:35 2020 From: report at bugs.python.org (Ma Lin) Date: Fri, 28 Aug 2020 12:01:35 +0000 Subject: [issue35228] Index search in CHM help crashes viewer In-Reply-To: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za> Message-ID: <1598616095.63.0.654146347966.issue35228@roundup.psfhosted.org> Ma Lin added the comment: > when I delete the file %APPDATA%\Microsoft\HTML Help\hh.dat, > the problem seems to go away. It doesn't work for me. Moreover, `Binary Index=Yes` no longer works on my PC. A few days ago, I installed a clean Windows 10 2004, then CHM's index cannot be used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 08:15:46 2020 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 28 Aug 2020 12:15:46 +0000 Subject: [issue41652] An Advice on Turning Ellipsis into Keyword In-Reply-To: <1598586802.42.0.262932705124.issue41652@roundup.psfhosted.org> Message-ID: <1598616946.68.0.994949797887.issue41652@roundup.psfhosted.org> Josh Rosenberg added the comment: I'm closing this as not being worth the costs of adding new keywords. You're welcome to propose it on the python-ideas list (a more appropriate place to propose and suss out the details of significant language changes), but you'll need to formulate a much stronger reason for making this change. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:15:00 2020 From: report at bugs.python.org (hai shi) Date: Fri, 28 Aug 2020 13:15:00 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598620500.6.0.0512203204084.issue41654@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:32:14 2020 From: report at bugs.python.org (Chrome) Date: Fri, 28 Aug 2020 13:32:14 +0000 Subject: [issue41655] new Node may not visited in lib2to3.refactor.RefactoringTool.traverse_by Message-ID: <1598621534.19.0.258305010682.issue41655@roundup.psfhosted.org> New submission from Chrome : `lib2to3.refactor.RefactoringTool.traverse_by` do a pre-order or post-order, and apply every candidate fixer to each node when traverse the tree. when a prior fixer add a new node that contains children, these children won't be visited by posterior fixers. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 376035 nosy: chrome priority: normal severity: normal status: open title: new Node may not visited in lib2to3.refactor.RefactoringTool.traverse_by type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:33:20 2020 From: report at bugs.python.org (Chrome) Date: Fri, 28 Aug 2020 13:33:20 +0000 Subject: [issue41655] new Node may not visited in lib2to3.refactor.RefactoringTool.traverse_by In-Reply-To: <1598621534.19.0.258305010682.issue41655@roundup.psfhosted.org> Message-ID: <1598621600.34.0.122264730782.issue41655@roundup.psfhosted.org> Chrome added the comment: `lib2to3.refactor.RefactoringTool.traverse_by` do a pre-order or post-order traverse algorithm, and apply every candidate fixer to each node when traverse the tree. when a prior fixer add a new node that contains children, these children won't be visited by posterior fixers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:37:36 2020 From: report at bugs.python.org (Chrome) Date: Fri, 28 Aug 2020 13:37:36 +0000 Subject: [issue41655] new Node may not visited in lib2to3.refactor.RefactoringTool.traverse_by In-Reply-To: <1598621534.19.0.258305010682.issue41655@roundup.psfhosted.org> Message-ID: <1598621856.11.0.0964914184263.issue41655@roundup.psfhosted.org> Change by Chrome : ---------- keywords: +patch pull_requests: +21097 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:43:29 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Fri, 28 Aug 2020 13:43:29 +0000 Subject: [issue41651] Pip: Wrong Showing of Progressbar when Downloading Modules In-Reply-To: <1598586276.58.0.803654971013.issue41651@roundup.psfhosted.org> Message-ID: <1598622209.38.0.434149926203.issue41651@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:47:27 2020 From: report at bugs.python.org (Piyush Pravin) Date: Fri, 28 Aug 2020 13:47:27 +0000 Subject: [issue41656] Sets are storing elements in sorted order. Message-ID: <1598622447.24.0.949938355914.issue41656@roundup.psfhosted.org> New submission from Piyush Pravin : In documentation it is written that " Sets are unordered collection", but actually it is storing the elements in sorted order. ---------- assignee: docs at python components: Documentation files: dndndgndghbdgngdndgngtn.PNG messages: 376037 nosy: docs at python, piyushpravin1998 priority: normal severity: normal status: open title: Sets are storing elements in sorted order. type: resource usage versions: Python 3.7 Added file: https://bugs.python.org/file49432/dndndgndghbdgngdndgngtn.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 09:48:16 2020 From: report at bugs.python.org (Chrome) Date: Fri, 28 Aug 2020 13:48:16 +0000 Subject: [issue41655] New Node may not be visited in lib2to3.refactor.RefactoringTool.traverse_by In-Reply-To: <1598621534.19.0.258305010682.issue41655@roundup.psfhosted.org> Message-ID: <1598622496.7.0.323504633505.issue41655@roundup.psfhosted.org> Change by Chrome : ---------- title: new Node may not visited in lib2to3.refactor.RefactoringTool.traverse_by -> New Node may not be visited in lib2to3.refactor.RefactoringTool.traverse_by _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 10:05:01 2020 From: report at bugs.python.org (David Edelsohn) Date: Fri, 28 Aug 2020 14:05:01 +0000 Subject: [issue41642] Buildbot: workers detached every minute and "no space left on device" issue In-Reply-To: <1598434194.1.0.809832074407.issue41642@roundup.psfhosted.org> Message-ID: <1598623501.12.0.73987555107.issue41642@roundup.psfhosted.org> David Edelsohn added the comment: I can provide some information from the logs of one of the buildbots, or change a parameter. Let me know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 10:07:37 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 28 Aug 2020 14:07:37 +0000 Subject: [issue41656] Sets are storing elements in sorted order. In-Reply-To: <1598622447.24.0.949938355914.issue41656@roundup.psfhosted.org> Message-ID: <1598623657.41.0.186963816228.issue41656@roundup.psfhosted.org> Steven D'Aprano added the comment: "Unordered" means that the language doesn't promise any specific order, it doesn't mean that there is no order at all. Try strings: py> set("abcdef") {'b', 'f', 'c', 'e', 'd', 'a'} or different ints: py> set([1, 0, -2]) {0, 1, -2} ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 10:17:38 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 28 Aug 2020 14:17:38 +0000 Subject: [issue41656] Sets are storing elements in sorted order. In-Reply-To: <1598622447.24.0.949938355914.issue41656@roundup.psfhosted.org> Message-ID: <1598624258.48.0.417646954668.issue41656@roundup.psfhosted.org> Steven D'Aprano added the comment: Here's another example: py> set([1, 2**63, 4, -5, 6, 5]) {1, 9223372036854775808, 4, 6, 5, -5} By the way, in the future, please don't post screen shots of text, copy the code and output and paste it as text into your bug report. Screenshots make it hard for us to reproduce the bug, we have to re-type your code. And it makes it difficult for blind and visually impaired developers, who may be reading this with a screen-reader. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 11:04:11 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Aug 2020 15:04:11 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598627051.35.0.563995950233.issue41624@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 838316db08a8e3174e4cf8db233ff69d388b3f5c by Karthikeyan Singaravelan in branch '3.8': [3.8] bpo-41624: fix documentation of typing.Coroutine (GH-21952). (#21983) https://github.com/python/cpython/commit/838316db08a8e3174e4cf8db233ff69d388b3f5c ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 11:06:42 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Aug 2020 15:06:42 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598627202.67.0.349564967304.issue41624@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset c01a7edc67e2c2e13a6d9513f111f27761786e27 by Karthikeyan Singaravelan in branch '3.9': [3.9] bpo-41624: fix documentation of typing.Coroutine (GH-21952) (#21982) https://github.com/python/cpython/commit/c01a7edc67e2c2e13a6d9513f111f27761786e27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 11:07:08 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Aug 2020 15:07:08 +0000 Subject: [issue41624] typing.Coroutine documentation In-Reply-To: <1598272424.26.0.934323513188.issue41624@roundup.psfhosted.org> Message-ID: <1598627228.56.0.406003875938.issue41624@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 Aug 28 12:10:55 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 28 Aug 2020 16:10:55 +0000 Subject: [issue41649] Can't pass Path like objects to subprocess api's on Windows. In-Reply-To: <1598538318.99.0.184680655713.issue41649@roundup.psfhosted.org> Message-ID: <1598631055.68.0.243080525889.issue41649@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not understand how you get this result. At that line of code arg can only be string, because it is a result of os.fsdecode(). Are you sure that you use Python version which includes issue31961 changes? What exactly Python version do you use? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 12:45:00 2020 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 28 Aug 2020 16:45:00 +0000 Subject: [issue41487] Builtin bigint modulo operation can be made faster when the base is divisible by a large power of 2 (i.e: has many trailing 0 digits in binary) In-Reply-To: <1596623435.88.0.500860382488.issue41487@roundup.psfhosted.org> Message-ID: <1598633100.54.0.682696382094.issue41487@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 14:34:02 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Aug 2020 18:34:02 +0000 Subject: [issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1598639642.44.0.641583672756.issue24160@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 4.0 -> 5.0 pull_requests: +21098 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 14:40:00 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Aug 2020 18:40:00 +0000 Subject: [issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1598640000.05.0.868838192113.issue24160@roundup.psfhosted.org> Irit Katriel added the comment: I've submitted a patch that I believe fixes this problem. It adds in Bdb's __init__ a call to a function that reads the Breakpoint's 'bplist' and 'bpbynumber' class attributes and populates the new instances' 'breaks' dict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 14:58:28 2020 From: report at bugs.python.org (Elian Mariano Gabriel) Date: Fri, 28 Aug 2020 18:58:28 +0000 Subject: [issue41657] Refactor for object source files variable in Makefile Message-ID: <1598641108.18.0.0642772004669.issue41657@roundup.psfhosted.org> New submission from Elian Mariano Gabriel : Refactoring in the Makefile is needed due a hard coded declaration to the 'OBJECT_OBJS' variable in the line 388. This hard coded declaration can be replaced by a pattern substitution function which assigns the 'OBJECT_OBJS' variable in this much simpler way: OBJECT_OBJS=$(patsubst %.c, %.o, $(wildcard Objects/*.c)) This assignment will facilitate the future builds because it is not need to add a new obj reference when created a new source code inside the 'Objects' folder. ---------- components: Build messages: 376045 nosy: ElianMariano priority: normal severity: normal status: open title: Refactor for object source files variable in Makefile type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 14:59:16 2020 From: report at bugs.python.org (Lysandros Nikolaou) Date: Fri, 28 Aug 2020 18:59:16 +0000 Subject: [issue41059] Large number of Coverity reports for parser.c In-Reply-To: <1592679391.13.0.913540149945.issue41059@roundup.psfhosted.org> Message-ID: <1598641156.51.0.109912194299.issue41059@roundup.psfhosted.org> Lysandros Nikolaou added the comment: I propose that we take no further action and close this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 15:05:36 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Aug 2020 19:05:36 +0000 Subject: [issue41059] Large number of Coverity reports for parser.c In-Reply-To: <1592679391.13.0.913540149945.issue41059@roundup.psfhosted.org> Message-ID: <1598641536.05.0.46609129183.issue41059@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> works for me stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 15:20:35 2020 From: report at bugs.python.org (Lysandros Nikolaou) Date: Fri, 28 Aug 2020 19:20:35 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1598642435.77.0.646029856664.issue33337@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 15:57:22 2020 From: report at bugs.python.org (Elian Mariano Gabriel) Date: Fri, 28 Aug 2020 19:57:22 +0000 Subject: [issue41657] Refactor for object source files variable in Makefile In-Reply-To: <1598641108.18.0.0642772004669.issue41657@roundup.psfhosted.org> Message-ID: <1598644642.78.0.107088036449.issue41657@roundup.psfhosted.org> Change by Elian Mariano Gabriel : ---------- keywords: +patch pull_requests: +21099 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21993 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 17:04:14 2020 From: report at bugs.python.org (Aliona Matveeva) Date: Fri, 28 Aug 2020 21:04:14 +0000 Subject: [issue41658] http.client not allowing non-ascii in headers Message-ID: <1598648654.13.0.540906759419.issue41658@roundup.psfhosted.org> New submission from Aliona Matveeva : http.client trying to decode any header with 'latin-1', which fails when there is any non-ascii symbols in it, for example, Cyrillic. I propose to check if it's non-ascii and then decode it with 'utf-8', works perfectly. ---------- components: Library (Lib) messages: 376047 nosy: yellalena priority: normal severity: normal status: open title: http.client not allowing non-ascii in headers versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 17:43:15 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 28 Aug 2020 21:43:15 +0000 Subject: [issue41659] PEG discrepancy on 'if {x} {a}: pass' Message-ID: <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org> New submission from Guido van Rossum : I just noticed a subtle discrepancy between the old parser and the PEG parser. Consider this syntax error: ``` if x {a}: pass ``` The old parser places the caret at the '{': ``` $ python3.8 -c 'if x { a } : pass' File "", line 1 if x { a } : pass ^ SyntaxError: invalid syntax ``` The PEG parser puts it at 'a': ``` $ python3.10 -c 'if x { a } : pass' File "", line 1 if x { a } : pass ^ SyntaxError: invalid syntax ``` I don't think we should put much effort into fixing it -- it's just a curiosity. I suspect it's got to do with some lookahead. ---------- assignee: lys.nikolaou messages: 376048 nosy: gvanrossum, lys.nikolaou priority: low severity: normal stage: needs patch status: open title: PEG discrepancy on 'if {x} {a}: pass' type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 18:06:38 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 28 Aug 2020 22:06:38 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598652398.21.0.048011209132.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +21100 pull_request: https://github.com/python/cpython/pull/21994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 18:53:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Aug 2020 22:53:01 +0000 Subject: [issue20119] pdb c(ont(inue)) optional one-time-only breakpoint (like perl debugger) In-Reply-To: <1388808811.19.0.853662131976.issue20119@psf.upfronthosting.co.za> Message-ID: <1598655181.2.0.993236510724.issue20119@roundup.psfhosted.org> Irit Katriel added the comment: Pdb already has this, it's the tbreak command. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 19:00:19 2020 From: report at bugs.python.org (=?utf-8?q?Evens_Fortun=C3=A9?=) Date: Fri, 28 Aug 2020 23:00:19 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598655619.32.0.97136158405.issue41638@roundup.psfhosted.org> Evens Fortun? added the comment: I don't think this is a bug. As I have explained in the answer I have provided on StackOverflow (https://stackoverflow.com/posts/comments/112539410?noredirect=1), it seems that sqlite3 uses by default the qmark parameter substitution style for their query which uses a tuple to provide it with its values. So it makes sense that the error message only does reference the index number since the matching is done on the order where a parameter appear on the SQL query and the same order in the tuple provided. Here @Wolfgang seems to try to use the named parameter substitution style because he is using a dictionary to provide the values to the query. You have to set it globally before doing that (sqlite3.paramstyle = 'named'). So from my point of view there is no bug here. ---------- nosy: +EvensF _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 19:03:23 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 28 Aug 2020 23:03:23 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1598655803.49.0.24352192375.issue24160@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon -> Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session versions: +Python 3.10 -Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 19:48:19 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 28 Aug 2020 23:48:19 +0000 Subject: [issue41660] multiprocessing.Manager objects lose connection info Message-ID: <1598658499.79.0.244870185265.issue41660@roundup.psfhosted.org> New submission from Tim Peters : This started on StackOverflow: https://stackoverflow.com/questions/63623651/how-to-properly-share-manager-dict-between-processes Here's a simpler program. Short course: an object of a subclass of mp.Process has an attribute of seemingly any type obtained from an mp.Manager(). The report above used a Manager.dict, and the program here a Manager.Value. When .start() is invoked, the first time that attribute is used in any way that requires communication with the Manager server, the program dies. The output below is from 3.8.5 on Windows; the report above is some Linux flavor. The tracebacks are very similar, the only obvious difference being that the implementation complains about a socket on Linux but about a named pipe on Windows. Note that there's no problem passing such things as explicit arguments to functions across processes. The loss here appears specific to the inscrutable under-the-covers pickle dance needed to create a "self" by magic on worker processes. The code: from multiprocessing import Process, Manager, Event class MyProducer(Process): def __init__(self, value, event): Process.__init__(self) self.val = value self.event = event def run(self): print("at producer start:", self.val.value) self.val.value = 42 self.event.set() class MyConsumer(Process): def __init__(self, value, event): Process.__init__(self) self.val = value self.event = event def run(self): self.event.wait() print("in consumer:", self.val.value) if __name__ == "__main__": state_value = Manager().Value('i', 666) print("at start:", state_value.value) state_ready = Event() producerprocess = MyProducer(state_value, state_ready) consumerprocess = MyConsumer(state_value, state_ready) producerprocess.start() consumerprocess.start() The output: at start: 666 Process MyProducer-2: Traceback (most recent call last): File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\managers.py", line 827, in _callmethod conn = self._tls.connection AttributeError: 'ForkAwareLocal' object has no attribute 'connection' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "C:\Code\temp.py", line 10, in run print("at producer start:", self.val.value) File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\managers.py", line 1154, in get return self._callmethod('get') File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\managers.py", line 831, in _callmethod self._connect() File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\managers.py", line 818, in _connect conn = self._Client(self._token.address, authkey=self._authkey) File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\connection.py", line 500, in Client c = PipeClient(address) File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\lib\multiprocessing\connection.py", line 702, in PipeClient _winapi.WaitNamedPipe(address, 1000) FileNotFoundError: [WinError 2] The system cannot find the file specified ---------- components: Library (Lib) messages: 376051 nosy: tim.peters priority: normal severity: normal status: open title: multiprocessing.Manager objects lose connection info type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 21:01:04 2020 From: report at bugs.python.org (Chrome) Date: Sat, 29 Aug 2020 01:01:04 +0000 Subject: [issue41659] PEG discrepancy on 'if {x} {a}: pass' In-Reply-To: <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org> Message-ID: <1598662864.98.0.545168515269.issue41659@roundup.psfhosted.org> Change by Chrome : ---------- versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 21:01:30 2020 From: report at bugs.python.org (Chrome) Date: Sat, 29 Aug 2020 01:01:30 +0000 Subject: [issue41659] PEG discrepancy on 'if {x} {a}: pass' In-Reply-To: <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org> Message-ID: <1598662890.21.0.0131011622071.issue41659@roundup.psfhosted.org> Change by Chrome : ---------- versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 21:02:00 2020 From: report at bugs.python.org (Chrome) Date: Sat, 29 Aug 2020 01:02:00 +0000 Subject: [issue41655] New Node may not be visited in lib2to3.refactor.RefactoringTool.traverse_by In-Reply-To: <1598621534.19.0.258305010682.issue41655@roundup.psfhosted.org> Message-ID: <1598662920.14.0.868833193386.issue41655@roundup.psfhosted.org> Change by Chrome : ---------- 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 Aug 28 21:54:53 2020 From: report at bugs.python.org (mohamed koubaa) Date: Sat, 29 Aug 2020 01:54:53 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1598666093.13.0.475341368351.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +21101 pull_request: https://github.com/python/cpython/pull/21995 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 22:27:23 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 29 Aug 2020 02:27:23 +0000 Subject: [issue41660] multiprocessing.Manager objects lose connection info In-Reply-To: <1598658499.79.0.244870185265.issue41660@roundup.psfhosted.org> Message-ID: <1598668043.5.0.478225027902.issue41660@roundup.psfhosted.org> Tim Peters added the comment: Weird. If I insert these between the two process starts: import time time.sleep(2) then the producer produces the expected output: at start: 666 at producer start: 666 and the program blows up instead when it gets to print("in consumer:", self.val.value) Same thing if, instead of a sleep, I put producerprocess.join() before starting the consumer. If I change the tail end to: producerprocess.start() import time time.sleep(2) print(state_value) consumerprocess = MyConsumer(state_value, state_ready) consumerprocess.start() then I see at start: 666 at producer start: 666 Value('i', 42) before it blows up in the consumer. So `state_value` appears to survive intact, and mutated as intended, across the producer's life - but gets corrupted somehow when it's _also_ passed to the consumer. Weirder ;-) , if I replace the tail with the ever-more elaborate: producerprocess = MyProducer(state_value, state_ready) producerprocess.start() import time time.sleep(2) producerprocess.join() print(state_value) state_value.value = 13 producerprocess = MyProducer(state_value, state_ready) producerprocess.start() time.sleep(2) producerprocess.join() print(state_value) consumerprocess = MyConsumer(state_value, state_ready) consumerprocess.start() then I see at start: 666 at producer start: 666 Value('i', 42) at producer start: 13 Value('i', 42) before it blows up in the consumer - so it survived two full producer lifetimes! So ... generalize ... change the tail to: for i in range(10): state_value.value = i producerprocess = MyProducer(state_value, state_ready) producerprocess.start() producerprocess.join() print(state_value) consumerprocess = MyConsumer(state_value, state_ready) consumerprocess.start() and I see everything working fine before it blows up in the consumer: at start: 666 at producer start: 0 Value('i', 42) at producer start: 1 Value('i', 42) at producer start: 2 Value('i', 42) at producer start: 3 Value('i', 42) at producer start: 4 Value('i', 42) at producer start: 5 Value('i', 42) at producer start: 6 Value('i', 42) at producer start: 7 Value('i', 42) at producer start: 8 Value('i', 42) at producer start: 9 Value('i', 42) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 22:42:33 2020 From: report at bugs.python.org (Avram) Date: Sat, 29 Aug 2020 02:42:33 +0000 Subject: [issue31749] Request: Human readable byte amounts in the standard library In-Reply-To: <1507655453.9.0.213398074469.issue31749@psf.upfronthosting.co.za> Message-ID: <1598668953.59.0.945291809381.issue31749@roundup.psfhosted.org> Avram added the comment: I looked through a lot of the suggested libraries and they all seemed either too specific to an implementation or didn't fully implement compatibility. So I created Prefixed to prove out the implementation of of an expanded format specification for float would look like. It implements 3 new format types: - h: SI Decimal prefix (..., n, ?, m, k, M, G, ...) - j: IEC Binary prefix (Ki, Mi, Gi, ...) - J: Shortened IEC Binary prefix (K, M, G, ...) It also implements a new flag, '!' that will add a space before the prefix. For now, the math is pretty simple, if you cross a magnitude level it will go to that prefix. So 999 would be '999' and 1000 would be 1k. I was thinking another format specification option '%' followed by a digit could be used to set the threshold of when to switch, so f'{950.0:%5.2h}' would be '0.95k', but f'{949.0:%5.2h}' would be '949.00'. Was going to think about it a little more before implementing. I'd appreciate feedback on the library. Issues can be submitted here: https://github.com/Rockhopper-Technologies/prefixed/issues https://pypi.org/project/prefixed/ ---------- nosy: +aviso _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 22:58:14 2020 From: report at bugs.python.org (Chrome) Date: Sat, 29 Aug 2020 02:58:14 +0000 Subject: [issue41655] New Node may not be visited in lib2to3.refactor.RefactoringTool.traverse_by In-Reply-To: <1598621534.19.0.258305010682.issue41655@roundup.psfhosted.org> Message-ID: <1598669894.28.0.98601201728.issue41655@roundup.psfhosted.org> Chrome added the comment: you can run example.py to reproduce this bug. ---------- Added file: https://bugs.python.org/file49434/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 28 23:58:10 2020 From: report at bugs.python.org (Josh Rosenberg) Date: Sat, 29 Aug 2020 03:58:10 +0000 Subject: [issue36172] csv module internal consistency In-Reply-To: <1551641825.06.0.900973165633.issue36172@roundup.psfhosted.org> Message-ID: <1598673490.92.0.85919996039.issue36172@roundup.psfhosted.org> Change by Josh Rosenberg : ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 01:17:51 2020 From: report at bugs.python.org (Wolfgang Fahl) Date: Sat, 29 Aug 2020 05:17:51 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598678271.35.0.614539421493.issue41638@roundup.psfhosted.org> Wolfgang Fahl added the comment: Indeed this a request for improvement. Technically the software works as expected. Just thousands of programmers have extra debug effort at this tate of affairs as can be deducted from the view count in the stackoverflow questions. The extra step of looking up the column name from the binding number can be avoided as i have shown by my workaround. To hide the detail of set it globally before doing that (sqlite3.paramstyle = 'named'). here in the bug report is not helpful. Part of the request is also to show the record number in executeMany - just to make lifer easier for users for sqlite3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 02:15:05 2020 From: report at bugs.python.org (Andy Maier) Date: Sat, 29 Aug 2020 06:15:05 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives Message-ID: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> New submission from Andy Maier : I found that os.path.relpath() on Windows raises ValueError when the path and the start path are on different drives. This is to be expected, as there is no single root on Windows. On Python 3.7, the behavior is: >>> os.path.relpath('c:/abc', 'a:/') Traceback (most recent call last): File "", line 1, in File "...\Python\Python37\lib\ntpath.py", line 564, in relpath path_drive, start_drive)) ValueError: path is on mount 'c:', start on mount 'a:' The issue is that this ValueError and the reasons for it are not mentioned at all in the documentation for os.path.relpath(). Other os.path functions do document specific behaviors for different drives on Windows, for example os.path.commonpath(), so there is a precedence for documenting this. Also, it should be normal to document the possible exceptions that can be raised. I did read https://bugs.python.org/issue7195 from 2009 where the original issue discussed also lead to a request to update the documentation of os.path.relpath() to show the ValueError for this case, but that angle of the issue ended up being ignored back then, unfortunately. My suggestion is to add something like the following sentence the documentation: "On Windows, ValueError is raised when path and start are on different drives." ---------- assignee: docs at python components: Documentation messages: 376057 nosy: andymaier, docs at python priority: normal severity: normal status: open title: os.path.relpath does not document ValueError on Windows with different drives versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 02:46:07 2020 From: report at bugs.python.org (=?utf-8?q?Evens_Fortun=C3=A9?=) Date: Sat, 29 Aug 2020 06:46:07 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598683567.24.0.737598133561.issue41638@roundup.psfhosted.org> Evens Fortun? added the comment: Yes we could say that the documentation can be lacking but that doesn't means it's a bug in the code. If you feel that the documentation need to be improved then you should submit a patch to the documentation and not how the code should be changed. If you feel that the error message doesn't give enough information you could modify the source code of that module and submit a patch instead of a workaround. But meanwhile I would suggest that your code should check that all the information is valid before you submit it to the database. It shouldn't be really the responsibility of the database to catch this kind of errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 06:48:58 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 29 Aug 2020 10:48:58 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598698138.85.0.390072570575.issue19521@roundup.psfhosted.org> Change by Stefan Krah : ---------- pull_requests: +21103 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 07:51:02 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 29 Aug 2020 11:51:02 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598701862.95.0.894145433119.issue19521@roundup.psfhosted.org> Stefan Krah added the comment: Okay, thanks. The -G option is of course attractive for Linux projects because it requires minimal changes in the build machinery. I've added support for libmpdec/libmpdec++ (next release) for AIX-style shared libraries (shr.o inside libmpdec.a). The AIX linker has a certain elegance, but it requires something like 150 lines of code changes and conditionals inside the Makefiles. I can confirm that -G is substantially slower, so I'm going to commit this patch soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 08:47:44 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 29 Aug 2020 12:47:44 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1598705264.4.0.591450947775.issue41661@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 08:51:35 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 29 Aug 2020 12:51:35 +0000 Subject: [issue41658] http.client not allowing non-ascii in headers In-Reply-To: <1598648654.13.0.540906759419.issue41658@roundup.psfhosted.org> Message-ID: <1598705495.58.0.642934765819.issue41658@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Can you please add a short script explaining the problem? There were some recent security issues fixed in http.client disallowing non-ascii headers issue39603 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 08:59:33 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 29 Aug 2020 12:59:33 +0000 Subject: [issue41640] module zipfile issue on closing In-Reply-To: <1598427092.16.0.16834501548.issue41640@roundup.psfhosted.org> Message-ID: <1598705973.48.0.584013518106.issue41640@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks, I am closing this in favor of issue40564. Jason has provided some possible approaches in issue40564 (msg375964) and would be helpful to follow the discussion there since it has more details. ---------- nosy: +jaraco resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Using zipfile.Path with several files prematurely closes zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 09:05:08 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Aug 2020 13:05:08 +0000 Subject: [issue41662] Bugs in binding parameters in sqlite3 Message-ID: <1598706308.83.0.197807583291.issue41662@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are few bugs in the code for binding parameters specified in the sqlite3 module: 1. If argument "parameters" is a list, PyList_GET_ITEM() is called in a loop, but the size of the list is read only once before loop. Since the list can be changed during iteration, it can cause reading past the end of the list. 2. If argument "parameters" is a custom sequence, all exceptions raised in __len__() (including KeybordInterrupt) are overridden by a ProgrammingError. ---------- components: Extension Modules messages: 376062 nosy: BTaskaya, ghaering, serhiy.storchaka priority: normal severity: normal status: open title: Bugs in binding parameters in sqlite3 type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 09:11:43 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Aug 2020 13:11:43 +0000 Subject: [issue41662] Bugs in binding parameters in sqlite3 In-Reply-To: <1598706308.83.0.197807583291.issue41662@roundup.psfhosted.org> Message-ID: <1598706703.73.0.836976628529.issue41662@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +21104 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 10:04:49 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Aug 2020 14:04:49 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598709889.16.0.117826797186.issue41638@roundup.psfhosted.org> Serhiy Storchaka added the comment: I agree that the error message should contain the name of the absent parameter instead of its index when parameters are supplied as a dict. It is more informative and would consistent with other error message. As for including the number of a record in the error message, I am not sure we should do this. 1. For other errors (too large integer, string containing surrogate characters, error in custom adapter, etc) the error message does not contain neither parameter name nor index. If we want to attach references to parameter and record, it is much more larger problem. It may require designing a general method for attaching additional information to exceptions and writing a PEP. It is a LARGE problem. 2. ProgrammingError is a programming error. In correctly working program you should never see such kind of errors, because you are responsible for preparing the statement and providing the consistent number of parameter values. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 10:05:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 29 Aug 2020 14:05:12 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1598709912.56.0.488172265925.issue41638@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +21105 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 10:03:57 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 29 Aug 2020 14:03:57 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598709837.32.0.822422493972.issue19521@roundup.psfhosted.org> Stefan Krah added the comment: I can't find the reason for: if test -z "$EXPORTSYMS"; then EXPORTSYMS="Modules/python.exp" fi Modules/python.exp is hardcoded elsewhere, and I'd rather set EXPORTSYMS unconditionally on AIX and unset it unconditionally for all other systems (which don't build with the patch if EXPORTSYMS happens to be defined). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 10:41:50 2020 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sat, 29 Aug 2020 14:41:50 +0000 Subject: [issue41659] PEG discrepancy on 'if {x} {a}: pass' In-Reply-To: <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org> Message-ID: <1598712110.85.0.872592617057.issue41659@roundup.psfhosted.org> Lysandros Nikolaou added the comment: I had a look at this. I have been testing with the input a{x}, which faces the same problem. It's actually because of an invalid_* rule. The call stack looks like this: ... invalid_comprehension_rule(Parser * p) (/home/lysnikolaou/repos/cpython/Parser/parser.c:15065) genexp_rule(Parser * p) (/home/lysnikolaou/repos/cpython/Parser/parser.c:11381) primary_raw(Parser * p) (/home/lysnikolaou/repos/cpython/Parser/parser.c:10361) primary_rule(Parser * p) (/home/lysnikolaou/repos/cpython/Parser/parser.c:10285) await_primary_rule(Parser * p) (/home/lysnikolaou/repos/cpython/Parser/parser.c:10240) ... The invalid_comprehension rule acecpts an LBRACE as the starting token and only fails after it's parsed it, which means that the parser fails with three tokens in the tokens array, the NAME which is valid, the LBRACE which is parsed for the invalid_comprehension rule and the NAME thereafter, upon which the parser fails and backs out of everything. Then, we look at the last token we've parsed and that's where we're placing the caret. Because of invalid_comprehension, we can even go as far as making the parser show a completely different error, for example: ? cpython git:(master) ? cat a.py a{*x for x in a} ? cpython git:(master) ? ./python a.py File "/home/lysnikolaou/repos/cpython/a.py", line 1 a{*x for x in a} ^ SyntaxError: iterable unpacking cannot be used in comprehension Or place the caret even further: ? cpython git:(master) ? cat a.py a{*x + a + b + c} ? cpython git:(master) ? ./python a.py File "/home/lysnikolaou/repos/cpython/a.py", line 1 a{*x + a + b + c} ^ SyntaxError: invalid syntax There's a simple fix, which is adding an alternative to the primary rule, that parses something along the lines of `primary set` and then call RAISE_SYNTAX_ERROR_KNOWN_LOCATION there, but that would have to come before the genexp alternative, which worries me because of the performance implications. `primary` is a left recursive rule that gets called VERY often, probably more than a few times even when parsing a single NAME. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 10:45:16 2020 From: report at bugs.python.org (Aliona Matveeva) Date: Sat, 29 Aug 2020 14:45:16 +0000 Subject: [issue41658] http.client not allowing non-ascii in headers In-Reply-To: <1598648654.13.0.540906759419.issue41658@roundup.psfhosted.org> Message-ID: <1598712316.14.0.556973835668.issue41658@roundup.psfhosted.org> Aliona Matveeva added the comment: hi Karthikeyan Singaravelan! I'm working with a russian database called 1C. it's pretty popular here in Russia, and its 'twist' is that everything there (I mean code) is written in Russian, i.e. cyrillic. So it's obvious and normal that the request/response coming from 1C base could contain non-ascii characters in its parts. Particularly, my case was that the header has a header containing info on called method, which value was "http://www.1c-bitrix.ru#SVD_?????????:GetEmployee". which causes the "'latin-1' codec cant encode characters in position 29-37: ordinal not in range(256)" exception every time I try to send a request there. I tested locally, and same happening if I'm trying to add a Cyrillic header when creating a request/response in Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 11:00:15 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 29 Aug 2020 15:00:15 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598713215.8.0.921729220398.issue19521@roundup.psfhosted.org> Stefan Krah added the comment: New changeset e6dcd371b2c54a94584dd124e8c592a496d46a47 by Stefan Krah in branch 'master': bpo-19521: Fix parallel build race condition on AIX (GH-21997) https://github.com/python/cpython/commit/e6dcd371b2c54a94584dd124e8c592a496d46a47 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 11:36:58 2020 From: report at bugs.python.org (Roundup Robot) Date: Sat, 29 Aug 2020 15:36:58 +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: <1598715418.83.0.532026094497.issue32642@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +21106 pull_request: https://github.com/python/cpython/pull/22000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 11:49:59 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 29 Aug 2020 15:49:59 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598716199.93.0.982270646194.issue41654@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 11:55:59 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 29 Aug 2020 15:55:59 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598716559.52.0.975052428427.issue19521@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +21107 pull_request: https://github.com/python/cpython/pull/22001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 11:56:05 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 29 Aug 2020 15:56:05 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598716565.78.0.977935393125.issue19521@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21108 pull_request: https://github.com/python/cpython/pull/22002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:11:07 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 29 Aug 2020 16:11:07 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598717467.44.0.470473389926.issue41513@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 27de28607a248e5ffb8838162fca466a58c2e284 by Raymond Hettinger in branch 'master': bpo-41513: Save unnecessary steps in the hypot() calculation (#21994) https://github.com/python/cpython/commit/27de28607a248e5ffb8838162fca466a58c2e284 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:25:54 2020 From: report at bugs.python.org (mohamed koubaa) Date: Sat, 29 Aug 2020 16:25:54 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1598718354.12.0.429839343686.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +21109 pull_request: https://github.com/python/cpython/pull/22003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:33:59 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 29 Aug 2020 16:33:59 +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: <1598718839.95.0.481554204622.issue6721@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger nosy_count: 26.0 -> 27.0 pull_requests: +21110 pull_request: https://github.com/python/cpython/pull/21994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:34:00 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 29 Aug 2020 16:34:00 +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: <1598718840.21.0.075385103577.issue36533@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger nosy_count: 6.0 -> 7.0 pull_requests: +21111 pull_request: https://github.com/python/cpython/pull/21994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:34:00 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 29 Aug 2020 16:34:00 +0000 Subject: [issue33802] Regression in logging configuration In-Reply-To: <1528412435.4.0.592728768989.issue33802@psf.upfronthosting.co.za> Message-ID: <1598718840.3.0.161101267212.issue33802@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger nosy_count: 6.0 -> 7.0 pull_requests: +21112 pull_request: https://github.com/python/cpython/pull/21994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:36:47 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 29 Aug 2020 16:36:47 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598719007.06.0.175287882567.issue19521@roundup.psfhosted.org> Stefan Krah added the comment: New changeset 88b86a9752afc2c50ca196f6ba1a8d62d71cf398 by Miss Islington (bot) in branch '3.9': bpo-19521: Fix parallel build race condition on AIX (GH-22001) https://github.com/python/cpython/commit/88b86a9752afc2c50ca196f6ba1a8d62d71cf398 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 12:40:36 2020 From: report at bugs.python.org (Stefan Krah) Date: Sat, 29 Aug 2020 16:40:36 +0000 Subject: [issue19521] Parallel build race condition on AIX since python-2.7 In-Reply-To: <1383840294.95.0.0890053719997.issue19521@psf.upfronthosting.co.za> Message-ID: <1598719236.08.0.0569091800115.issue19521@roundup.psfhosted.org> Stefan Krah added the comment: This is in master and 3.9.1. I'll not backport to 3.8 because a release candidate is imminent. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 13:05:16 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 29 Aug 2020 17:05: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: <1598720716.9.0.679955874194.issue36533@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: -21111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 13:05:58 2020 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 29 Aug 2020 17:05:58 +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: <1598720758.0.0.0230558274519.issue6721@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: -21110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 14:28:07 2020 From: report at bugs.python.org (Chad Smith) Date: Sat, 29 Aug 2020 18:28:07 +0000 Subject: [issue41663] Support Windows pseudoterminals in pty and termios modules Message-ID: <1598725687.47.0.96007277971.issue41663@roundup.psfhosted.org> New submission from Chad Smith : The pty and termios modules do not support Windows. Current Python pty documentation suggest Windows might be supported: > The Linux code is supposed to work on other platforms, but hasn?t been tested yet. but I have confirmed that it is not while adding pty usage to gdbgui. The new Windows Psuedo Console, ConPTY, available in Windows 10, now makes this possible. Proof of existence of a common pty interface for all platforms exists for node with the node-pty npm package, which uses ConPTY. References: * ConPTY information, https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/ * Example ConPTY usage, https://github.com/microsoft/terminal/blob/master/samples/ConPTY/EchoCon/EchoCon/EchoCon.cpp * node-pty, https://github.com/Microsoft/node-pty * Python pty docs, https://docs.python.org/3/library/pty.html * gdbgui Windows pty issue, https://github.com/cs01/gdbgui/issues/348 ---------- messages: 376071 nosy: cs01, steve.dower priority: normal severity: normal status: open title: Support Windows pseudoterminals in pty and termios modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 14:29:14 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 18:29:14 +0000 Subject: [issue41610] Any Raspberry Pi Zero Projects to try? In-Reply-To: <1598028262.16.0.0744145450871.issue41610@roundup.psfhosted.org> Message-ID: <1598725754.39.0.888672265552.issue41610@roundup.psfhosted.org> Terry J. Reedy added the comment: Mika and supriya: this is not a 'forum'. It is a workspace for discussing possible and actual improvements to out githup python/cpython and python/devguide repositories via github pull requests. (Other python repositories have their own discussion spaces.) Most anything python related can be discussed on python-list, mirrored an newsgroup gmane.comp.python.general. This would have been a great question there and the answer would have been seen and possibly benefited 1000s, instead of just 1 person. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 15:52:32 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 19:52:32 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598730752.07.0.899029021208.issue41615@roundup.psfhosted.org> Terry J. Reedy added the comment: The docs are normative as well as descriptive. The specific doc for sys.argv is https://docs.python.org/3/library/sys.html#sys.argv. It says that a proper Python stdlib sys module has an args attribute that is a non-empty list whose first item is a string. (It implies, and to me should actually say, that all items are strings.) Since it would seem that it is easy enough to make this true, I think that Python code should be able to depend on this as much as anything else in the docs. The 2003 issue 839151 reported that warnings.warn exited with AttributeError when accessing a non-existent argv in an embedded interpreter. I presume that the latter was embedded CPython. AFAIK, the fix could have been to fix embedded interpreters to have sys.argv = ['']. (My preference.) Instead, the fix, for the warn access only, was to guard the access with try-except AttributeError. The extended fix proposed here is to document that argv is at least optional and therefore imply that all access should be wrapped in try-except. Guido, which idea comports with your idea of 'Python': sys has an argv with at least one string (the name, if any, of a 'program'); or sys has an optional argv, so that all bullet-proof code must guard access by catching at least AttributeError? --- Notes on a couple of #839151 messages: 1. The fact that one can make argv be missing by deleting it was and is irrelevant. Monkeypatching modules by deleting and changing attributes can create unlimited havoc and there is nothing special about sys.argv in this regard. 2. "this [patch] should also catch IndexError and TypeError in case sys.argv is an empty list or it is not even a list at all." I consider this similarly irrelevant because both of these would, according to the doc, be bugs, whether originally present or introduced by monkeypatching. https://github.com/pypa/keyring/445 is 404 for me in multiple tries. ---------- nosy: +gvanrossum, terry.reedy versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 16:02:16 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 20:02:16 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1598731336.86.0.317175350578.issue41620@roundup.psfhosted.org> Terry J. Reedy added the comment: You should justify the proposed change here on the issue, and see if the doc says anything about the issue either way. ---------- nosy: +ezio.melotti, michael.foord, rbcollins, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 16:32:23 2020 From: report at bugs.python.org (Spencer Baugh) Date: Sat, 29 Aug 2020 20:32:23 +0000 Subject: [issue35409] Async generator might re-throw GeneratorExit on aclose() In-Reply-To: <1543929680.9.0.788709270274.issue35409@psf.upfronthosting.co.za> Message-ID: <1598733143.71.0.115359278273.issue35409@roundup.psfhosted.org> Spencer Baugh added the comment: I'm not sure this was the correct fix - or at least, this creates further issues with asynccontextmanager. Consider the following code: --------------- import contextlib import types @contextlib.asynccontextmanager async def acm(): # GeneratorExit athrown here from AsyncContextManager __aexit__, # propagated from the body of the contextmanager in func() yield @types.coroutine def _yield(): yield async def func(): async with acm(): # GeneratorExit raised here await _yield() x = func() x.send(None) # start running func x.close() # raise GeneratorExit in func at its current yield # AsyncContextManager __aexit__ fails with "RuntimeError: generator didn't stop after throw()" --------------- The reason for the failure in AsyncContextManager __aexit__ is that the asyncgenerator raises StopIteration instead of GeneratorExit when agen.athrow(GeneratorExit()) is called and driven, so "await agen.athrow(GeneratorExit())" just evaluates to None, rather than raising GeneratorExit. On 3.6 this would work fine, because "await athrow(GeneratorExit())" will raise GeneratorExit. I suspect this was broken by this change. ---------- nosy: +catern _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 16:34:14 2020 From: report at bugs.python.org (Spencer Baugh) Date: Sat, 29 Aug 2020 20:34:14 +0000 Subject: [issue35409] Async generator might re-throw GeneratorExit on aclose() In-Reply-To: <1543929680.9.0.788709270274.issue35409@psf.upfronthosting.co.za> Message-ID: <1598733254.79.0.594021611283.issue35409@roundup.psfhosted.org> Spencer Baugh added the comment: My mistake, I see now this is just https://bugs.python.org/issue33786 and is already fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 16:54:35 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 29 Aug 2020 20:54:35 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598734475.95.0.829404153008.issue41615@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Terry. The correct URL is [jaraco/keyring#445](https://github.com/jaraco/keyring/issues/445). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 16:58:16 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 29 Aug 2020 20:58:16 +0000 Subject: [issue41660] multiprocessing.Manager objects lose connection info In-Reply-To: <1598658499.79.0.244870185265.issue41660@roundup.psfhosted.org> Message-ID: <1598734696.86.0.3324806574.issue41660@roundup.psfhosted.org> Tim Peters added the comment: And more weirdness, changing the tail to: for i in range(10): state_value.value = i state_ready.clear() producerprocess = MyProducer(state_value, state_ready) consumerprocess = MyConsumer(state_value, state_ready) producerprocess.start() consumerprocess.start() producerprocess.join() consumerprocess.join() print(state_value, state_ready.is_set()) That runs fine! All the expected output, and no tracebacks. But it ALSO runs fine if EITHER of the .join() lines is commented out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 17:19:22 2020 From: report at bugs.python.org (Tony) Date: Sat, 29 Aug 2020 21:19:22 +0000 Subject: [issue41279] Add a StreamReaderBufferedProtocol In-Reply-To: <1594484620.37.0.437755734421.issue41279@roundup.psfhosted.org> Message-ID: <1598735962.56.0.761343386063.issue41279@roundup.psfhosted.org> Tony added the comment: bump ---------- title: Convert StreamReaderProtocol to a BufferedProtocol -> Add a StreamReaderBufferedProtocol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 17:19:42 2020 From: report at bugs.python.org (Tony) Date: Sat, 29 Aug 2020 21:19:42 +0000 Subject: [issue41533] Bugfix: va_build_stack leaks the stack if do_mkstack fails In-Reply-To: <1597253261.51.0.12759996374.issue41533@roundup.psfhosted.org> Message-ID: <1598735982.5.0.28849953653.issue41533@roundup.psfhosted.org> Tony added the comment: bump ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 17:21:02 2020 From: report at bugs.python.org (Tony) Date: Sat, 29 Aug 2020 21:21:02 +0000 Subject: [issue41246] IOCP Proactor same socket overlapped callbacks In-Reply-To: <1594228808.35.0.788748619653.issue41246@roundup.psfhosted.org> Message-ID: <1598736062.94.0.283394113264.issue41246@roundup.psfhosted.org> Tony added the comment: bump ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 17:31:57 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 29 Aug 2020 21:31:57 +0000 Subject: [issue41660] multiprocessing.Manager objects lose connection info In-Reply-To: <1598658499.79.0.244870185265.issue41660@roundup.psfhosted.org> Message-ID: <1598736717.16.0.359987785266.issue41660@roundup.psfhosted.org> Tim Peters added the comment: Noting that adding a `.join()` to the failing code on the StackOverflow report appeared to fix that problem too. In hindsight, I guess I'm only mildly surprised that letting the main process run full speed into interpreter shutdown code while worker processes are still running can have bad effects. But I am _somewhat_ surprised. For threads, early in shutdown we automatically run a loop to .join() them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 17:47:33 2020 From: report at bugs.python.org (Anit Rajpurohit) Date: Sat, 29 Aug 2020 21:47:33 +0000 Subject: [issue41664] re.sub does NOT substitute all the matching patterns when re.IGNORECASE is used Message-ID: <1598737653.28.0.435333490934.issue41664@roundup.psfhosted.org> New submission from Anit Rajpurohit : Usage of re flags leads to inconsistent results when 1. The pattern directly used in re.sub 2. The pattern is re.compile'd and used Note 1: Input string is all in the lowercase 'all is fair in love and war' Note 2: Results are always consistent in case of re.compile'd pattern ======================================= 1. The pattern directly used in re.sub ======================================= >>> import re >>> re.sub(r'[aeiou]', '#', 'all is fair in love and war') '#ll #s f##r #n l#v# #nd w#r' >>> >>> re.sub(r'[aeiou]', '#', 'all is fair in love and war', re.IGNORECASE) '#ll #s fair in love and war' >>> >>> re.sub(r'[aeiou]', '#', 'all is fair in love and war', re.IGNORECASE|re.DOTALL) '#ll #s f##r #n l#v# #nd w#r' >>> >>> ======================================= 2. The pattern is re.compile'd and used ======================================= >>> pattern = re.compile(r'[aeiou]', re.IGNORECASE) >>> re.sub(pattern, '#', 'all is fair in love and war') '#ll #s f##r #n l#v# #nd w#r' >>> >>> pattern = re.compile(r'[aeiou]') >>> re.sub(pattern, '#', 'all is fair in love and war') '#ll #s f##r #n l#v# #nd w#r' >>> >>> pattern = re.compile(r'[aeiou]', re.IGNORECASE | re.DOTALL) >>> re.sub(pattern, '#', 'all is fair in love and war') '#ll #s f##r #n l#v# #nd w#r' ---------- components: Regular Expressions messages: 376083 nosy: anitrajpurohit28, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.sub does NOT substitute all the matching patterns when re.IGNORECASE is used type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:12:46 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 22:12:46 +0000 Subject: [issue41622] Add support for emoji-data.txt and emoji-variation-sequences.txt to unicodedata In-Reply-To: <1598214890.63.0.84270917383.issue41622@roundup.psfhosted.org> Message-ID: <1598739166.14.0.982194911341.issue41622@roundup.psfhosted.org> Terry J. Reedy added the comment: Base facts: The Unicode Character Database, UCD, is defined in Tech Report 44, https://www.unicode.org/reports/tr44/. The latest files (now for 13.0) are at https://www.unicode.org/Public/UCD/latest/ and in particular, in the ucd subdirectory. ucd/UnicodeData.txt has a sequential list of current codepoints, including emoji codepoints. Version 13 added subdirectly ucd/emoji with the 2 files listed above. emoji-variation-sequences.txt comprises 177 highly redundant pairs of lines like this: 0023 FE0E ; text style; # (1.1) NUMBER SIGN 0023 FE0F ; emoji style; # (1.1) NUMBER SIGN The only difference between the lines is 'FE0E; text' versus 'FE0F; emoji', 'TEXT PRESENTATION SELECTOR' versus 'EMOJI PRESENTATION SELECTOR'. tr51 does not explicitly say that every line is paired, but perusal suggests that this is true, making the file highly redundant. The 177 characters include some non-emoji symbols, like #, and omits most emoji, including SNAKE, '\U0001f40d', '?' (colored coiled snake). And yet, here, at least in Firefox, is the supposedly invalid text snake, '\U0001f40d\ufe0e': '??' (a flat black-only, uncoiled wiggling snake head). I don't know how '#\ufe0f' might be different from plain '#'. Our UCD copy is accessed via 13 functions in the unicodedata module. Support for the file could consist of a new function, such as 'emoji_text'. The implementation could be 'chr in emoji_text_set', where the latter is the set of 177 characters. But given the accidental experiment above with an unauthorized sequence, I don't know how useful it would be. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:24:29 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 22:24:29 +0000 Subject: [issue41627] Relocate user site packages on Windows 32-bit In-Reply-To: <1598298331.25.0.959731633335.issue41627@roundup.psfhosted.org> Message-ID: <1598739869.66.0.857398112334.issue41627@roundup.psfhosted.org> Terry J. Reedy added the comment: If it is otherwise possible to user-only install both 32 and 64 bit versions, then using the same site-packages strikes me a bug, even if only fixed in the next version. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:26:31 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 22:26:31 +0000 Subject: [issue41629] __class__ not set defining 'X' as In-Reply-To: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org> Message-ID: <1598739991.71.0.313674977523.issue41629@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: __class__ not set defining 'X' as . Was __classcell__ propagated to type.__new__? -> __class__ not set defining 'X' as _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:32:24 2020 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 29 Aug 2020 22:32:24 +0000 Subject: [issue41664] re.sub does NOT substitute all the matching patterns when re.IGNORECASE is used In-Reply-To: <1598737653.28.0.435333490934.issue41664@roundup.psfhosted.org> Message-ID: <1598740344.37.0.126754031775.issue41664@roundup.psfhosted.org> Matthew Barnett added the comment: The 4th argument of re.sub is 'count', not 'flags'. re.IGNORECASE has the numeric value of 2, so: re.sub(r'[aeiou]', '#', 'all is fair in love and war', re.IGNORECASE) is equivalent to: re.sub(r'[aeiou]', '#', 'all is fair in love and war', count=2) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:33:51 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 22:33:51 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598740431.92.0.845222364144.issue41634@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 6b5e88744cb48156a5dee47244dbc1b0dd82567c by Miss Islington (bot) in branch '3.9': bpo-41634: Fix a typo in the curses documentation (GH-21958) https://github.com/python/cpython/commit/6b5e88744cb48156a5dee47244dbc1b0dd82567c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:33:50 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 22:33:50 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598740430.51.0.595475689414.issue41634@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset a1473d2c9106abbdc619bdcc973c15a87e3f0f12 by Miss Islington (bot) in branch '3.8': bpo-41634: Fix a typo in the curses documentation (GH-21958) https://github.com/python/cpython/commit/a1473d2c9106abbdc619bdcc973c15a87e3f0f12 ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 18:36:49 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 29 Aug 2020 22:36:49 +0000 Subject: [issue41634] Typo in curses documentation In-Reply-To: <1598381066.25.0.836031112719.issue41634@roundup.psfhosted.org> Message-ID: <1598740609.87.0.377612678712.issue41634@roundup.psfhosted.org> Terry J. Reedy added the comment: Karthikeyan, I went ahead and merged and closed this trivial fix because I could not imagine any reason to hold it up. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 20:00:57 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 00:00:57 +0000 Subject: [issue41637] Calling with an infinite number of parameters is not detected In-Reply-To: <1598419436.9.0.814986663177.issue41637@roundup.psfhosted.org> Message-ID: <1598745657.66.0.622995570789.issue41637@roundup.psfhosted.org> Terry J. Reedy added the comment: On Windows, I get an indefinite hang rather than an overt crash with a crash box. I believe that there was some swapping out to disk. I got the same with list(itertools.count()). If you got a core dump or crash report, you might upload it. There is infinite looping in the argument collection but no infinite recursion (calling) here. The latter is detected pretty quickly because of sys.recursion limit. Infinite loops by themselves are not necessarily wrong. This typing box is run by an infinite loop. Change your 'use' to def use(iter): for i in iter: print(i) and there would be no problem. So I disagree with 'should have been detected'. I am only leaving this open in case you got an overt crash for this particular loop. Those we try to fix. ---------- nosy: +terry.reedy title: Calling a function with an infinite number of parameters is not detected and crash the interpreter instead of causing an exception -> Calling with an infinite number of parameters is not detected versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 20:09:01 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 00:09:01 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1598746141.09.0.980904396913.issue41645@roundup.psfhosted.org> Terry J. Reedy added the comment: I agree that a second verb might be better but 'is' is wrong. How about Python has ... and uses a simple but effective approach .. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 20:13:26 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 00:13:26 +0000 Subject: [issue41653] About the use of cpython console mode problem In-Reply-To: <1598589603.24.0.524762493055.issue41653@roundup.psfhosted.org> Message-ID: <1598746406.26.0.267202657018.issue41653@roundup.psfhosted.org> Change by Terry J. Reedy : Removed file: https://bugs.python.org/file49430/Screenshot_2020_0828_104656.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 20:39:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 00:39:06 +0000 Subject: [issue41653] About the use of cpython console mode problem In-Reply-To: <1598589603.24.0.524762493055.issue41653@roundup.psfhosted.org> Message-ID: <1598747946.95.0.887426714752.issue41653@roundup.psfhosted.org> Terry J. Reedy added the comment: I am replacing the text snippet screenshot with a link to the online doc: https://docs.python.org/3/c-api/init.html#c.Py_Initialize The only encoding python 'forces' in recent Python is utf-8 in utf-8 mode and on some systems. See https://docs.python.org/3/library/sys.html#sys.getfilesystemencoding. I am guessing that you are using *nix and that your locale uses gbk. I am closing because there is no usable description of a bug. I suggest asking on Python-list about how to do whatever it is you want. Start with your OS and version. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 20:49:06 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 00:49:06 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598748546.71.0.867060443676.issue41615@roundup.psfhosted.org> Terry J. Reedy added the comment: I just noticed that Py_Initialize "does not set sys.argv; use PySys_SetArgvEx() for that." https://docs.python.org/3/c-api/init.html#c.Py_Initialize https://docs.python.org/3/c-api/init.html#c.PySys_SetArgvEx void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) The latter treats failure to initialize sys.argv as fatal. It suggests that embedders might want updatepath = 0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 21:00:43 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 01:00:43 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598749243.35.0.875073816198.issue41615@roundup.psfhosted.org> Terry J. Reedy added the comment: New link works and I read it, including the reference to #839151. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 22:58:02 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 Aug 2020 02:58:02 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598756282.05.0.451674712001.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49435/best_frac.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 29 23:21:39 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 Aug 2020 03:21:39 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598757699.73.0.957892452889.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +21113 pull_request: https://github.com/python/cpython/pull/22013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 00:14:28 2020 From: report at bugs.python.org (Ma Lin) Date: Sun, 30 Aug 2020 04:14:28 +0000 Subject: [issue37095] [Feature Request]: Add zstd support in tarfile In-Reply-To: <1559187768.11.0.7498103877.issue37095@roundup.psfhosted.org> Message-ID: <1598760868.71.0.401555812251.issue37095@roundup.psfhosted.org> Ma Lin added the comment: I have spent two weeks, almost complete the code, a preview: https://github.com/animalize/cpython/pull/8/files Write directly for stdlib, since there are already zstd modules on pypi. In addition, the API of zstd is simple, not as complicated as lzma. Can also use these: 1, argument clinic 2, multi-phase init 3. internal function _PyLong_AsInt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 00:27:27 2020 From: report at bugs.python.org (Camion) Date: Sun, 30 Aug 2020 04:27:27 +0000 Subject: [issue41637] Calling with an infinite number of parameters is not detected In-Reply-To: <1598745657.66.0.622995570789.issue41637@roundup.psfhosted.org> Message-ID: <898911945.351226.1598761642533@mail.yahoo.com> Camion added the comment: Well, I know an infinite loop? is not necessarily wrong, especially in a generator. and I also know how to avoid this problem. My problem is not there. It's just that I believe it should possibly crash the program and not the interpreter. I even wonder if being able to cause an interpreter crash couldn't become a security hole in some cases.probably the basic solution would be to forward an exception to the program if the interpreter running it gets an allocation error. About core dump or crash report, it didn't generate one but I think I should install a few things on the computer to get it. Le dimanche 30 ao?t 2020 ? 02:02:01 UTC+2, Terry J. Reedy a ?crit : Terry J. Reedy added the comment: On Windows, I get an indefinite hang rather than an overt crash with a crash box.? I believe that there was some swapping out to disk.? I got the same with list(itertools.count()). If you got a core dump or crash report, you might upload it.? There is infinite looping in the argument collection but no infinite recursion (calling) here.? The latter is detected pretty quickly because of sys.recursion limit.? Infinite loops by themselves are not necessarily wrong.? This typing box is run by an infinite loop.? Change your 'use' to def use(iter): ? ? for i in iter: print(i) and there would be no problem.? So I disagree with 'should have been detected'.? I am only leaving this open in case you got an overt crash for this particular loop.? Those we try to fix. ---------- nosy: +terry.reedy title: Calling a function with an infinite number of parameters is not detected and crash the interpreter instead of causing an exception -> Calling with an infinite number of parameters is not detected versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 00:53:16 2020 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 30 Aug 2020 04:53:16 +0000 Subject: [issue41533] Bugfix: va_build_stack leaks the stack if do_mkstack fails In-Reply-To: <1597253261.51.0.12759996374.issue41533@roundup.psfhosted.org> Message-ID: <1598763196.82.0.25654624034.issue41533@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 75c80b0bda89debf312f075716b8c467d411f90e by Tony Solomonik in branch 'master': closes bpo-41533: Fix a potential memory leak when allocating a stack (GH-21847) https://github.com/python/cpython/commit/75c80b0bda89debf312f075716b8c467d411f90e ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 00:53:37 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 30 Aug 2020 04:53:37 +0000 Subject: [issue41533] Bugfix: va_build_stack leaks the stack if do_mkstack fails In-Reply-To: <1597253261.51.0.12759996374.issue41533@roundup.psfhosted.org> Message-ID: <1598763217.39.0.0827676571766.issue41533@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21115 pull_request: https://github.com/python/cpython/pull/22015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 00:53:30 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 30 Aug 2020 04:53:30 +0000 Subject: [issue41533] Bugfix: va_build_stack leaks the stack if do_mkstack fails In-Reply-To: <1597253261.51.0.12759996374.issue41533@roundup.psfhosted.org> Message-ID: <1598763210.9.0.790482264191.issue41533@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +21114 pull_request: https://github.com/python/cpython/pull/22014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 01:01:41 2020 From: report at bugs.python.org (Jim Jewett) Date: Sun, 30 Aug 2020 05:01:41 +0000 Subject: [issue41246] IOCP Proactor same socket overlapped callbacks In-Reply-To: <1594228808.35.0.788748619653.issue41246@roundup.psfhosted.org> Message-ID: <1598763701.66.0.385330122016.issue41246@roundup.psfhosted.org> Change by Jim Jewett : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 01:22:04 2020 From: report at bugs.python.org (Tim Peters) Date: Sun, 30 Aug 2020 05:22:04 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598764924.08.0.445407505655.issue41513@roundup.psfhosted.org> Tim Peters added the comment: About test_frac.py, I changed the main loop like so: got = [float(expected)] # NEW for hypot in hypots: actual = hypot(*coords) got.append(float(actual)) # NEW err = (actual - expected) / expected bits = round(1 / err).bit_length() errs[hypot][bits] += 1 if len(set(got)) > 1: # NEW print(got) # NEW That is, to display every case where the four float results weren't identical. Result: nothing was displayed (although it's still running the n=1000 chunk, there's no sign that will change). None of these variations made any difference to results users actually get. Even the "worst" of these reliably develops dozens of "good bits" beyond IEEE double precision, but invisibly (under the covers, with no visible effect on delivered results). So if there's something else that speeds the code, perhaps it's worth pursuing, but we're already long beyond the point of getting any payback for pursuing accuracy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 01:28:40 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Aug 2020 05:28:40 +0000 Subject: [issue41637] Calling with an infinite number of parameters is not detected In-Reply-To: <1598419436.9.0.814986663177.issue41637@roundup.psfhosted.org> Message-ID: <1598765320.54.0.796655344352.issue41637@roundup.psfhosted.org> Serhiy Storchaka added the comment: It does not differ much from list(inf()). Sooner or later it will raise MemoryError. You can interrupt the execution by pressing Ctrl-C. Although the response may be slow if your computer started swapping. There is nothing special about unpacking infinite number of parameters. You can achieve the same result in many other ways in any programming language. If you want you program do not use too much swap, limit the virtual memory size by the shell ulimit command (or by resource.setrlimit() in Python). ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 02:06:34 2020 From: report at bugs.python.org (Damien Ruiz) Date: Sun, 30 Aug 2020 06:06:34 +0000 Subject: [issue41665] Function called Message-ID: <1598767594.85.0.0689417039156.issue41665@roundup.psfhosted.org> Change by Damien Ruiz : ---------- nosy: x_0euf priority: normal severity: normal status: open title: Function called _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 02:09:03 2020 From: report at bugs.python.org (Damien Ruiz) Date: Sun, 30 Aug 2020 06:09:03 +0000 Subject: [issue41665] Empty Message-ID: <1598767743.64.0.774300616633.issue41665@roundup.psfhosted.org> New submission from Damien Ruiz : Didn't mean to create this and can't delete. ---------- stage: -> resolved status: open -> closed title: Function called -> Empty _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 02:53:16 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 30 Aug 2020 06:53:16 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598770396.82.0.252037286875.issue41524@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 901c2eae6e27ee7793e5a3c638664e01a3bf8de8 by Miss Islington (bot) in branch '3.9': bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) (GH-21978) https://github.com/python/cpython/commit/901c2eae6e27ee7793e5a3c638664e01a3bf8de8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 02:54:02 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 30 Aug 2020 06:54:02 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598770442.7.0.291292170828.issue41524@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21116 pull_request: https://github.com/python/cpython/pull/22016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 03:20:43 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 30 Aug 2020 07:20:43 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598772043.33.0.427983884867.issue41524@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 85ca9c049c5a490d143d28933bbb02ab80394ed8 by Miss Islington (bot) in branch '3.8': bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) (GH-22016) https://github.com/python/cpython/commit/85ca9c049c5a490d143d28933bbb02ab80394ed8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 03:21:09 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 30 Aug 2020 07:21:09 +0000 Subject: [issue41524] PyOS_mystricmp advances pointers too far In-Reply-To: <1597183298.26.0.225375554526.issue41524@roundup.psfhosted.org> Message-ID: <1598772069.63.0.717805765992.issue41524@roundup.psfhosted.org> Dong-hee Na added the comment: Thanks William ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 08:22:16 2020 From: report at bugs.python.org (M-o-T) Date: Sun, 30 Aug 2020 12:22:16 +0000 Subject: [issue41666] Problem in tutorial/introduction.html#strings Message-ID: <1598790136.78.0.89811884777.issue41666@roundup.psfhosted.org> New submission from M-o-T : Hi, I found a problem with this address https://docs.python.org/3/tutorial/introduction.html#strings In here >>> word[0:2] # characters from position 0 (included) to 2 (excluded) 'Py' >>> word[2:5] # characters from position 2 (included) to 5 (excluded) 'tho' In the second example word[2:5] becomes 'hto' ---------- messages: 376104 nosy: mohammadtavakoli1378 priority: normal severity: normal status: open title: Problem in tutorial/introduction.html#strings versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 08:29:15 2020 From: report at bugs.python.org (M-o-T) Date: Sun, 30 Aug 2020 12:29:15 +0000 Subject: [issue41666] Problem in tutorial/introduction.html#strings In-Reply-To: <1598790136.78.0.89811884777.issue41666@roundup.psfhosted.org> Message-ID: <1598790555.82.0.951763439964.issue41666@roundup.psfhosted.org> Change by M-o-T : ---------- nosy: -mohammadtavakoli1378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 08:30:08 2020 From: report at bugs.python.org (M-o-T) Date: Sun, 30 Aug 2020 12:30:08 +0000 Subject: [issue41666] fix In-Reply-To: <1598790136.78.0.89811884777.issue41666@roundup.psfhosted.org> Message-ID: <1598790608.32.0.718706072646.issue41666@roundup.psfhosted.org> Change by M-o-T : ---------- title: Problem in tutorial/introduction.html#strings -> fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 08:40:24 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 30 Aug 2020 12:40:24 +0000 Subject: [issue41666] fix In-Reply-To: <1598790136.78.0.89811884777.issue41666@roundup.psfhosted.org> Message-ID: <1598791224.85.0.912646159918.issue41666@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Closing this as not a bug since the example seems to be correct. Feel free to reopen with more details if needed. ---------- nosy: +xtreak resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 09:08:15 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 30 Aug 2020 13:08:15 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598792895.24.0.763535276686.issue41615@roundup.psfhosted.org> Jason R. Coombs added the comment: One possible option to guarantee initialization could be for PyInitialize to always call PySys_SetArgvEx(1, [""], 0), providing a default value for embedded interpreters that fail to call it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 09:17:16 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 30 Aug 2020 13:17:16 +0000 Subject: [issue41666] fix In-Reply-To: <1598790136.78.0.89811884777.issue41666@roundup.psfhosted.org> Message-ID: <1598793436.92.0.516711299159.issue41666@roundup.psfhosted.org> Steven D'Aprano added the comment: I agree with xtreak. I guess you probably misspelled the initial word: >>> 'Python'[2:5] # same as the tutorial 'tho' >>> 'Pyhton'[2:5] # misspelling 'hto' ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 10:26:59 2020 From: report at bugs.python.org (Ben Darnell) Date: Sun, 30 Aug 2020 14:26:59 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598797619.27.0.539337211121.issue39010@roundup.psfhosted.org> Change by Ben Darnell : ---------- pull_requests: +21117 pull_request: https://github.com/python/cpython/pull/22017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 10:40:52 2020 From: report at bugs.python.org (Ben Darnell) Date: Sun, 30 Aug 2020 14:40:52 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598798452.67.0.246418993533.issue39010@roundup.psfhosted.org> Ben Darnell added the comment: I've posted a pull request with a test and fix: https://github.com/python/cpython/pull/22017. It's a more targeted fix than cmeyer's PR (which I didn't even notice until now due to unfamiliarity with the BPO UI) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 11:00:39 2020 From: report at bugs.python.org (Johannes Reiff) Date: Sun, 30 Aug 2020 15:00:39 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1598799639.28.0.126102069547.issue41402@roundup.psfhosted.org> Johannes Reiff added the comment: It has been almost a month since the last update, so pinging as suggested in the Developer's Guide. Do I need to do something before the PR can be merged? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 11:33:37 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 30 Aug 2020 15:33:37 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598792895.24.0.763535276686.issue41615@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I think it?s reasonable to expect sys.argv to have at least one item, possibly empty. The proposed fix of setting it to [??] seems right to me. -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 11:33:53 2020 From: report at bugs.python.org (jack1142) Date: Sun, 30 Aug 2020 15:33:53 +0000 Subject: [issue39102] Increase Enum performance In-Reply-To: <1576810108.88.0.911071266859.issue39102@roundup.psfhosted.org> Message-ID: <1598801633.89.0.302751297915.issue39102@roundup.psfhosted.org> Change by jack1142 : ---------- nosy: +jack1142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 12:27:51 2020 From: report at bugs.python.org (Facundo Batista) Date: Sun, 30 Aug 2020 16:27:51 +0000 Subject: [issue40153] json dump with repeated key In-Reply-To: <1585829958.79.0.134366704668.issue40153@roundup.psfhosted.org> Message-ID: <1598804871.77.0.572786248998.issue40153@roundup.psfhosted.org> Facundo Batista added the comment: The balance here is allow an invalid JSON to be created (but documenting that on some situations that will happen), or sticking to always produce valid JSONs, but with a hit in performance (which we don't know so far if it's big or small). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 12:33:00 2020 From: report at bugs.python.org (Christoph Zwerschke) Date: Sun, 30 Aug 2020 16:33:00 +0000 Subject: [issue35228] Index search in CHM help crashes viewer In-Reply-To: <1542107217.87.0.788709270274.issue35228@psf.upfronthosting.co.za> Message-ID: <1598805180.49.0.0185110729373.issue35228@roundup.psfhosted.org> Christoph Zwerschke added the comment: Had the same problem for years and wondered why nobody else complained. Still reproducable with Win 10 Pro 2004, Python 3.8, cp1252 locale. Deleting hh.dat did not solve the problem for me. ---------- nosy: +cito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 12:36:20 2020 From: report at bugs.python.org (Facundo Batista) Date: Sun, 30 Aug 2020 16:36:20 +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: <1598805380.48.0.931978727872.issue15947@roundup.psfhosted.org> Facundo Batista added the comment: I'm closing this, it looks to me that behaviour changed and this is safe now. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 12:48:49 2020 From: report at bugs.python.org (Facundo Batista) Date: Sun, 30 Aug 2020 16:48:49 +0000 Subject: [issue40486] pathlib's iterdir doesn't specify what happens if directory content change In-Reply-To: <1588523788.71.0.846056751312.issue40486@roundup.psfhosted.org> Message-ID: <1598806129.95.0.35015238042.issue40486@roundup.psfhosted.org> Facundo Batista added the comment: However, Serhiy, `os.listdir()` builds a list quickly and gives you that, so the chance of the directory being modified is quite low (however, for big directories, that may happen, and it's probably good to notice that in the docs). For `Path.iterdir()` that list is not built, and as it's iteration is external, the amount of time between getting one item to the other is unbound, *anything* could happen in the middle. In short, I think that both docs should state that the directory could change while it's iterated (in the os.listdir case probably stating that the chances are low). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 12:54:15 2020 From: report at bugs.python.org (Camion) Date: Sun, 30 Aug 2020 16:54:15 +0000 Subject: [issue41637] Calling with an infinite number of parameters is not detected In-Reply-To: <1598765320.54.0.796655344352.issue41637@roundup.psfhosted.org> Message-ID: <87889404.579703.1598806452828@mail.yahoo.com> Camion added the comment: I understand all that. But the problem is that it should crash the program and not the interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 12:57:37 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 30 Aug 2020 16:57:37 +0000 Subject: [issue40153] json dump with repeated key In-Reply-To: <1585829958.79.0.134366704668.issue40153@roundup.psfhosted.org> Message-ID: <1598806657.4.0.487147976287.issue40153@roundup.psfhosted.org> Raymond Hettinger added the comment: This module has been heavily used in the real world and we have no evidence that there is an actual problem to be solved. Marking this as closed. If a real world issue does arise, feel free to reopen and we can consider extending the API to have a validation step. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 13:29:57 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 30 Aug 2020 17:29:57 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1598808597.67.0.727269908484.issue39994@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 582f13786bb75c73d609790967fea03a5b50148a by Irit Katriel in branch 'master': bpo-39994: Fix pprint handling of dict subclasses that override __repr__ (GH-21892) https://github.com/python/cpython/commit/582f13786bb75c73d609790967fea03a5b50148a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 14:10:28 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 18:10:28 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598811028.65.0.839215357607.issue41615@roundup.psfhosted.org> Terry J. Reedy added the comment: I had the same idea late last night, though after 20 years, I have forgotten how to spell "['']" in C. (Is some sort of allocation or declaration required?). In the doc, change "It does not set sys.argv; use PySys_SetArgvEx() for that." to "It initializes sys.argv to ['']; use PySys_SetArgvEx() to modify it or change sys.path." "This is a no-op when called for a second time (without calling Py_FinalizeEx() first)." needs to be respected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 14:17:33 2020 From: report at bugs.python.org (hai shi) Date: Sun, 30 Aug 2020 18:17:33 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598811453.15.0.786997336239.issue41654@roundup.psfhosted.org> hai shi added the comment: Hm, Looks like we need check the double free risk of `Py_DECREF()`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 14:35:24 2020 From: report at bugs.python.org (Facundo Batista) Date: Sun, 30 Aug 2020 18:35:24 +0000 Subject: [issue37168] Decimal divisions sometimes 10x or 100x too large In-Reply-To: <1559772321.45.0.42770583159.issue37168@roundup.psfhosted.org> Message-ID: <1598812524.07.0.0126919481671.issue37168@roundup.psfhosted.org> Change by Facundo Batista : ---------- nosy: -facundobatista _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 14:37:00 2020 From: report at bugs.python.org (Facundo Batista) Date: Sun, 30 Aug 2020 18:37:00 +0000 Subject: [issue18417] urlopen() has a hidden default for its timeout argument In-Reply-To: <1373400669.07.0.823647394418.issue18417@psf.upfronthosting.co.za> Message-ID: <1598812620.99.0.36031049755.issue18417@roundup.psfhosted.org> Change by Facundo Batista : ---------- nosy: -facundobatista _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 14:45:10 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 30 Aug 2020 18:45:10 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1598813110.64.0.762942391267.issue39994@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Serhiy. This ticket can be closed now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 14:50:41 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 30 Aug 2020 18:50:41 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598811028.65.0.839215357607.issue41615@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Something just occurred to me. What if the caller has already set says.argv? We shouldn?t overwrite it. Or what if they only set it (later) if not already set. Would we break their code? -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:03:18 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:03:18 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598814198.5.0.88432468033.issue41344@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 475a5fbb5644ea200c990d85d8c264e78ab6c7ea by Vinay Sharma in branch 'master': bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) https://github.com/python/cpython/commit/475a5fbb5644ea200c990d85d8c264e78ab6c7ea ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:03:26 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 30 Aug 2020 19:03:26 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598814206.35.0.534456519872.issue41344@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +21118 pull_request: https://github.com/python/cpython/pull/22018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:03:34 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 30 Aug 2020 19:03:34 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598814214.66.0.228073409172.issue41344@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21119 pull_request: https://github.com/python/cpython/pull/22019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:07:08 2020 From: report at bugs.python.org (Stefan Krah) Date: Sun, 30 Aug 2020 19:07:08 +0000 Subject: [issue37168] small_ints[] modified (third party C-extension?) In-Reply-To: <1559772321.45.0.42770583159.issue37168@roundup.psfhosted.org> Message-ID: <1598814428.84.0.406532801296.issue37168@roundup.psfhosted.org> Change by Stefan Krah : ---------- title: Decimal divisions sometimes 10x or 100x too large -> small_ints[] modified (third party C-extension?) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:08:01 2020 From: report at bugs.python.org (Stefan Krah) Date: Sun, 30 Aug 2020 19:08:01 +0000 Subject: [issue37168] small_ints[] modified (third party C-extension?) In-Reply-To: <1559772321.45.0.42770583159.issue37168@roundup.psfhosted.org> Message-ID: <1598814481.22.0.359830763089.issue37168@roundup.psfhosted.org> Stefan Krah added the comment: If nothing has been diagnosed, I suggest closing this. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:27:28 2020 From: report at bugs.python.org (Tim Peters) Date: Sun, 30 Aug 2020 19:27:28 +0000 Subject: [issue37168] small_ints[] modified (third party C-extension?) In-Reply-To: <1559772321.45.0.42770583159.issue37168@roundup.psfhosted.org> Message-ID: <1598815648.6.0.421839917602.issue37168@roundup.psfhosted.org> Tim Peters added the comment: Closing, since it remains a unique report and there hasn't been another word about it in over a year. ---------- resolution: -> works for me stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:40:32 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:40:32 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598816432.63.0.214921411493.issue41654@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch nosy: +pablogsal nosy_count: 4.0 -> 5.0 pull_requests: +21120 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:42:30 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:42:30 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598816550.99.0.479438951154.issue41344@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 38e32872eb3cf0dc9dd8cef9b05e47ba03638d34 by Miss Islington (bot) in branch '3.8': bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) (GH-22019) https://github.com/python/cpython/commit/38e32872eb3cf0dc9dd8cef9b05e47ba03638d34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:42:25 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:42:25 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598816545.35.0.819916027317.issue41344@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ca55ecbf9aab305fa301ec69410ca3d3d18ec848 by Miss Islington (bot) in branch '3.9': bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) (GH-22018) https://github.com/python/cpython/commit/ca55ecbf9aab305fa301ec69410ca3d3d18ec848 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:42:46 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:42:46 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598816566.51.0.695803053058.issue41344@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the report and the PR, vinay0410! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:42:50 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:42:50 +0000 Subject: [issue41344] SharedMemory crash when size is 0 In-Reply-To: <1595230536.74.0.865685098947.issue41344@roundup.psfhosted.org> Message-ID: <1598816570.63.0.322397738695.issue41344@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 Sun Aug 30 15:43:45 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 19:43:45 +0000 Subject: [issue41654] Segfault when raising MemoryError In-Reply-To: <1598609759.16.0.336877665683.issue41654@roundup.psfhosted.org> Message-ID: <1598816625.01.0.474752714419.issue41654@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The problem is that the deallocator of MemoryError class is not taking into account subclasses for the freelist management, but the allocator (tp_new) is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 15:46:24 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 30 Aug 2020 19:46:24 +0000 Subject: [issue39994] pprint handling of dict subclasses that override __repr__ In-Reply-To: <1584461973.52.0.394481201775.issue39994@roundup.psfhosted.org> Message-ID: <1598816784.38.0.0887785045488.issue39994@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 16:08:36 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 20:08:36 +0000 Subject: [issue41667] The python PEG generator incorrectly handles empty sequences in gather rules Message-ID: <1598818116.29.0.0798714458289.issue41667@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Currently, empty sequences in gather rules make the conditional for gather rules fail as empty sequences evaluate as "False". We need to explicitly check for "None" (the failure condition) to avoid false negatives. ---------- messages: 376129 nosy: pablogsal priority: normal severity: normal status: open title: The python PEG generator incorrectly handles empty sequences in gather rules versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 16:08:49 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 20:08:49 +0000 Subject: [issue41667] The python PEG generator incorrectly handles empty sequences in gather rules In-Reply-To: <1598818116.29.0.0798714458289.issue41667@roundup.psfhosted.org> Message-ID: <1598818129.19.0.547847155483.issue41667@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +21121 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 16:15:17 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 20:15:17 +0000 Subject: [issue41668] Expose eventfd for high-performance event notifier in Linux Message-ID: <1598818517.47.0.408259765239.issue41668@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : The eventfd system calls can allow us to implement some Linux-specific high performance version of some event notifier abstractions in the standard library. eventfd() creates an "eventfd object" that can be used as an event wait/notify mechanism by user-space applications. The object contains an unsigned 64-bit integer counter that is maintained by the kernel. This acts as a file descriptor that can be used by the usual suspects (read/write/poll/close...). The advantage here is that the kernel maintains the counter and if used in conjunction with poll/epoll, it allows for a high-performance and scallabe event notification system. ---------- components: IO, Library (Lib) messages: 376130 nosy: pablogsal priority: normal severity: normal status: open title: Expose eventfd for high-performance event notifier in Linux versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 16:48:04 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 30 Aug 2020 20:48:04 +0000 Subject: [issue41668] Expose eventfd for high-performance event notifier in Linux In-Reply-To: <1598818517.47.0.408259765239.issue41668@roundup.psfhosted.org> Message-ID: <1598820484.72.0.786039530564.issue41668@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +21122 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 17:48:06 2020 From: report at bugs.python.org (Gregory Szorc) Date: Sun, 30 Aug 2020 21:48:06 +0000 Subject: [issue41669] Case mismatch between "include" and "Include" Message-ID: <1598824086.3.0.112428112748.issue41669@roundup.psfhosted.org> New submission from Gregory Szorc : On Windows, `sysconfig.get_path('include')` returns `Include` (capital I). However, the actual installation path is `include` (lowercase i). I believe the reason for the case mismatch is in this code in PC/layout/main.py: ``` if ns.include_dev: for dest, src in rglob(ns.source / "Include", "**/*.h"): yield "include/{}".format(dest), src src = ns.source / "PC" / "pyconfig.h" yield "include/pyconfig.h", src ``` The case mismatch is relevant for case sensitive filesystems. In my case, I was extracting a Windows Python install on Linux and then using the `sysconfig` value to locate directories within that install. Due to the case mismatch, Linux says `Include` doesn't exist since `sysconfig` points to "include." Case only renames can be a bit wonky to perform. I would suggest preserving what is shipped today and changing `sysconfig` to advertise lowercase "include." However, this would create a mismatch between the cpython source repo and built distributions. So maybe attempting the case-only rename is doable. Note that Windows will not allow you to have a file/directory varying only in case. i.e. you can have both an "include" and "Include." I can't recall if you can perform a case-only rename with a single system call (meaning it is atomic) or whether you need to go through a temporary directory. ---------- components: Windows messages: 376131 nosy: indygreg, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Case mismatch between "include" and "Include" type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 17:55:51 2020 From: report at bugs.python.org (Shantanu) Date: Sun, 30 Aug 2020 21:55:51 +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: <1598824551.28.0.837373442024.issue28724@roundup.psfhosted.org> Shantanu added the comment: I was looking at adding stubs for these to typeshed. Is it intentional that we ignore the flags and address arguments in the implementation? ---------- nosy: +hauntsaninja _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 18:24:46 2020 From: report at bugs.python.org (Shantanu) Date: Sun, 30 Aug 2020 22:24:46 +0000 Subject: [issue39349] Add "cancel_futures" parameter to concurrent.futures.Executor.shutdown() In-Reply-To: <1579147714.25.0.252393666546.issue39349@roundup.psfhosted.org> Message-ID: <1598826286.15.0.793511603745.issue39349@roundup.psfhosted.org> Shantanu added the comment: I was working on updating typeshed stubs to reflect this change. It looks like the parameter wasn't actually added to the base class (https://github.com/python/cpython/blob/c3a651ad2544d7d1be389b63e9a4a58a92a31623/Lib/concurrent/futures/_base.py#L608), even though it's documented as having the new parameter (https://docs.python.org/3.9/library/concurrent.futures.html#concurrent.futures.Executor.shutdown). Is this intentional? If not, I'd be happy to submit a PR adding the parameter to the base class. ---------- nosy: +hauntsaninja _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 18:28:29 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 30 Aug 2020 22:28:29 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598099717.03.0.849817579096.issue41615@roundup.psfhosted.org> Message-ID: <1598826509.94.0.24825884817.issue41615@roundup.psfhosted.org> Terry J. Reedy added the comment: sys.argv cannot be set until sys exists. As I mentioned above, subsequent calls before finalization must continue to be no-ops. Code that depends on a bug, in this case of sys.argv not existing, is always vulnerable. In this case, I would expect that people who want sys.argv to have a particular value would unconditionally set it. If it were conditionally set, the program would likely exit or otherwise fail a test. I intentionally have not suggested backporting a code change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 18:49:31 2020 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 30 Aug 2020 22:49:31 +0000 Subject: [issue41670] Windows and Linux execute the same code differently Message-ID: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> New submission from Ned Batchelder : Coverage.py bug reports https://github.com/nedbat/coveragepy/issues/1022 and https://github.com/nedbat/coveragepy/issues/959 demonstrate the same Python code, with the same disassembly, executing differently. In https://discuss.python.org/t/same-python-version-different-optimizations-on-different-os/5098, Ammar Askar said: > For any core developer who wants to look into this, based on my preliminary research this seems to be related to opcode prediction and computed GOTOS. > > If you put #define USE_COMPUTED_GOTOS 0 above https://github.com/python/cpython/blob/master/Python/ceval.c#L1033 then this issue is re-creatable on Linux/Mac. > > It seems to be an issue relating to how f_lasti is updated. ---------- components: Interpreter Core keywords: 3.8regression messages: 376135 nosy: nedbat priority: normal severity: normal status: open title: Windows and Linux execute the same code differently type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 18:53:18 2020 From: report at bugs.python.org (RalfM) Date: Sun, 30 Aug 2020 22:53:18 +0000 Subject: [issue41671] inspect.getdoc/.cleandoc doesn't always remove trailing blank lines Message-ID: <1598827998.17.0.2637020471.issue41671@roundup.psfhosted.org> New submission from RalfM : Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> def func1(): ... """This is func1. ... """ ... pass ... >>> inspect.getdoc(func1) 'This is func1.\n ' >>> >>> def func2(): ... """Line1 ... Line2 ... ... """ ... >>> inspect.getdoc(func2) 'Line1\nLine2 \n \n ' Note: The blank line between "Line2 " and the closing """ contains 11 spaces. The algorithm given in PEP 257 returns what I would expect, i.e. 'This is func1.' and 'Line1\nLine2' respectively. Strictly speaking, inspect.cleandoc doesn't claim to implement PEP 257. However, there is a comment "# Remove any trailing or leading blank lines." in the code of inspect.cleandoc, and this is obviously not done. Looking at the code, the reason seems to be twofold: 1. When removing the indentation, PEP 257 also does a .rstrip() on the lines, inspect.cleandoc doesn't. As a consequence, in inspect.cleandoc trailing lines with many spaces will still contain spaces after the indentation has been removed, thus are not empty and the "while lines and not lines[-1]" doesn't remove them. That explains func2 above. 2. If all lines but the first are blank (as in func1 above), indent / margin will be sys.maxint / sys.maxsize and no indentation will be removed. PEP 257 copies dedented lines to a new list. If no indentation needs to be removed, nothing but the first line will be copied, and so the trailing lines are gone. inspect.cleandoc dedents lines inplace. If no indentation needs to be removed the trailing lines with spaces remain and, as they contain spaces, the "while lines and not lines[-1]" doesn't remove them. There is another difference between PEP 257 and inspect.cleandoc: PEP 257 removes trailing whitespace on every line, inspect.cleandoc preserves it. I don't know whether that's intentional. I see this behaviour in 3.7 and 3.8, and the inspect.cleandoc code is unchanged in 3.9.0rc1. ---------- components: Library (Lib) messages: 376136 nosy: RalfM priority: normal severity: normal status: open title: inspect.getdoc/.cleandoc doesn't always remove trailing blank lines type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 19:01:26 2020 From: report at bugs.python.org (Ammar Askar) Date: Sun, 30 Aug 2020 23:01:26 +0000 Subject: [issue41670] Windows and Linux execute the same code differently In-Reply-To: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> Message-ID: <1598828486.42.0.681876966619.issue41670@roundup.psfhosted.org> Ammar Askar added the comment: minimal reproducer without coverage: import sys def f(): try: for i in []: pass return 1 except: return 2 def tracer(frame, event, _): if event == 'line': print("executing line {}".format(frame.f_lineno)) return tracer sys.settrace(tracer) f() With computed gotos this results in: > executing line 4 > executing line 5 > executing line 6 but without: > executing line 4 > executing line 5 ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 20:02:18 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 31 Aug 2020 00:02:18 +0000 Subject: [issue41615] sys.argv may be None or an empty list In-Reply-To: <1598826509.94.0.24825884817.issue41615@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Got it. On Sun, Aug 30, 2020 at 15:28 Terry J. Reedy wrote: > > > Terry J. Reedy added the comment: > > > > sys.argv cannot be set until sys exists. As I mentioned above, subsequent > calls before finalization must continue to be no-ops. > > > > Code that depends on a bug, in this case of sys.argv not existing, is > always vulnerable. In this case, I would expect that people who want > sys.argv to have a particular value would unconditionally set it. If it > were conditionally set, the program would likely exit or otherwise fail a > test. I intentionally have not suggested backporting a code change. > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 21:41:32 2020 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 31 Aug 2020 01:41:32 +0000 Subject: [issue39349] Add "cancel_futures" parameter to concurrent.futures.Executor.shutdown() In-Reply-To: <1579147714.25.0.252393666546.issue39349@roundup.psfhosted.org> Message-ID: <1598838092.1.0.837924086758.issue39349@roundup.psfhosted.org> Kyle Stanley added the comment: Good catch, Shantanu. It was not intentional on my part, and it would make sense to include *cancel_futures* in the base Executor class as documented. If you'd like to submit a PR to add it (attaching it to this issue), I should be able to review it within a reasonable period. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 23:31:35 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 03:31:35 +0000 Subject: [issue41670] Windows and Linux execute the same code differently In-Reply-To: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> Message-ID: <1598844695.19.0.0374656819945.issue41670@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +Mark.Shannon, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 23:44:47 2020 From: report at bugs.python.org (Ammar Askar) Date: Mon, 31 Aug 2020 03:44:47 +0000 Subject: [issue41670] ceval traces code differently based with USE_COMPUTED_GOTOS In-Reply-To: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> Message-ID: <1598845487.71.0.78228751183.issue41670@roundup.psfhosted.org> Ammar Askar added the comment: So I think this is a weird edge case with a set of opcode predictions (GET_ITER -> FOR_ITER -> POP_BLOCK) going outside of a line boundary. The disassembly of the reproducer above is: 4 0 SETUP_FINALLY 16 (to 18) 5 2 LOAD_CONST 1 (()) 4 GET_ITER >> 6 FOR_ITER 4 (to 12) 8 STORE_FAST 0 (i) 10 JUMP_ABSOLUTE 6 6 >> 12 POP_BLOCK 14 LOAD_CONST 2 (1) 16 RETURN_VALUE When computed gotos are disabled and there is a tracing function, instructions 0, 2, 4, 14 and 16 hit the `fast_next_opcode` label and have a chance to be traced as line hits. Note that `maybe_call_line_trace` will only cause a line hit if the instruction that starts a line (POP_BLOCK in this case) is being executed. When computed gotos are enabled, DISPATCH is a no-op and there is a special case for when tracing is enabled that causes every opcode to go through `fast_next_opcode`: https://github.com/python/cpython/blob/c3a651ad2544d7d1be389b63e9a4a58a92a31623/Python/ceval.c#L1054-L1059 When computed gotos are not enabled, there is no similar check for PREDICT (and might be too costly to add) causing this issue: https://github.com/python/cpython/blob/c3a651ad2544d7d1be389b63e9a4a58a92a31623/Python/ceval.c#L1131-L1141 ---------- title: Windows and Linux execute the same code differently -> ceval traces code differently based with USE_COMPUTED_GOTOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 30 23:45:05 2020 From: report at bugs.python.org (Ammar Askar) Date: Mon, 31 Aug 2020 03:45:05 +0000 Subject: [issue41670] ceval traces code differently with USE_COMPUTED_GOTOS In-Reply-To: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> Message-ID: <1598845505.53.0.119822844489.issue41670@roundup.psfhosted.org> Change by Ammar Askar : ---------- title: ceval traces code differently based with USE_COMPUTED_GOTOS -> ceval traces code differently with USE_COMPUTED_GOTOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 02:07:30 2020 From: report at bugs.python.org (Shantanu) Date: Mon, 31 Aug 2020 06:07:30 +0000 Subject: [issue39349] Add "cancel_futures" parameter to concurrent.futures.Executor.shutdown() In-Reply-To: <1579147714.25.0.252393666546.issue39349@roundup.psfhosted.org> Message-ID: <1598854050.84.0.563456428676.issue39349@roundup.psfhosted.org> Change by Shantanu : ---------- pull_requests: +21123 pull_request: https://github.com/python/cpython/pull/22023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 03:52:58 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 31 Aug 2020 07:52:58 +0000 Subject: [issue41154] test_pkgutil:test_name_resolution fails on macOS HFS+ file systems In-Reply-To: <1593413801.07.0.974965447149.issue41154@roundup.psfhosted.org> Message-ID: <1598860378.11.0.504331911951.issue41154@roundup.psfhosted.org> Ned Deily added the comment: > I wonder if it's a problem from Unicode representation That does seem to be the issue. In particular, there are differences in Unicode representation between file names on traditional HFS+ versus the newer APFS. APFS is the default for system file systems as of macOS 10.13; unlike HFS+, APFS is by default file name normalization insensitive. By creating two disk image files systems on a current macOS system, it's easy to demonstrate that test_name_resolution passes on APFS but fails on HFS+. So the question becomes what to do about the test. Without digging into it further, I suppose we could add something to test whether the file system where test temp files are created is normalization insensitive and, if so, skip. Or use brute force and always skip on macOS. In any case, while annoying, it probably doesn't need to be a "deferred blocker". ---------- priority: deferred blocker -> critical title: test_pkgutil:test_name_resolution fails on some platforms -> test_pkgutil:test_name_resolution fails on macOS HFS+ file systems _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 03:59:19 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 31 Aug 2020 07:59:19 +0000 Subject: [issue40486] pathlib's iterdir doesn't specify what happens if directory content change In-Reply-To: <1588523788.71.0.846056751312.issue40486@roundup.psfhosted.org> Message-ID: <1598860759.46.0.879381179548.issue40486@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +21124 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 04:40:38 2020 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 31 Aug 2020 08:40:38 +0000 Subject: [issue41627] Relocate user site packages on Windows 32-bit In-Reply-To: <1598298331.25.0.959731633335.issue41627@roundup.psfhosted.org> Message-ID: <1598863238.99.0.160728633585.issue41627@roundup.psfhosted.org> Dong-hee Na added the comment: > We should switch the pattern to Python{sys.winver}, which is XY or XY-32, the same as elsewhere. +1 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 04:47:03 2020 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 31 Aug 2020 08:47:03 +0000 Subject: [issue14611] inspect.getargs fails on some anonymous tuples In-Reply-To: <1334738109.2.0.700206080535.issue14611@psf.upfronthosting.co.za> Message-ID: <1598863623.43.0.0248741227973.issue14611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 05:41:11 2020 From: report at bugs.python.org (Norbert Cyran) Date: Mon, 31 Aug 2020 09:41:11 +0000 Subject: [issue41672] imaplib: wrong return type documented Message-ID: <1598866871.14.0.71273864789.issue41672@roundup.psfhosted.org> New submission from Norbert Cyran : Documentation on IMAP4 class specifies wrong return type of its commands: Each command returns a tuple: (type, [data, ...]) where type is usually 'OK' or 'NO', and data is either the text from the command response, or mandated results from the command. Each data is either a string, or a tuple. If a tuple, then the first part is the header of the response, and the second part contains the data (ie: ?literal? value). That's not valid for Python 3, as IMAP4 commands return bytes-like objects in data, what's shown in the example before:: >>> from imaplib import IMAP4 >>> with IMAP4("domain.org") as M: ... M.noop() ... ('OK', [b'Nothing Accomplished. d25if65hy903weo.87']) That of course can cause a lot of trouble due to incompatibility of strings and bytes. Suggested change is to replace string occurences to bytes-like object. I don't know what types are returned in case when tuple is returned though. ---------- assignee: docs at python components: Documentation messages: 376143 nosy: docs at python, norbertcyran priority: normal severity: normal status: open title: imaplib: wrong return type documented versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 05:57:27 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 31 Aug 2020 09:57:27 +0000 Subject: [issue41668] Expose eventfd for high-performance event notifier in Linux In-Reply-To: <1598818517.47.0.408259765239.issue41668@roundup.psfhosted.org> Message-ID: <1598867847.63.0.889712089487.issue41668@roundup.psfhosted.org> Zackery Spytz added the comment: I think this is a duplicate of bpo-41001. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 05:58:41 2020 From: report at bugs.python.org (Erik Bray) Date: Mon, 31 Aug 2020 09:58:41 +0000 Subject: [issue39671] Mention in docs that asyncio.FIRST_COMPLETED does not guarantee the completion of no more than one task In-Reply-To: <1582018412.2.0.458600281682.issue39671@roundup.psfhosted.org> Message-ID: <1598867921.13.0.135213883808.issue39671@roundup.psfhosted.org> Change by Erik Bray : ---------- keywords: +patch nosy: +erik.bray nosy_count: 4.0 -> 5.0 pull_requests: +21125 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 05:59:28 2020 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 31 Aug 2020 09:59:28 +0000 Subject: [issue20747] Charset.header_encode in email.charset doesn't take a maxlinelen argument and has inconsistent behavior with different encodings In-Reply-To: <1393178377.04.0.906048305625.issue20747@psf.upfronthosting.co.za> Message-ID: <1598867968.55.0.731283357865.issue20747@roundup.psfhosted.org> Zackery Spytz added the comment: Python 2.7 is no longer supported, so I think this issue should be closed. ---------- nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 06:01:17 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 31 Aug 2020 10:01:17 +0000 Subject: [issue41670] ceval traces code differently with USE_COMPUTED_GOTOS In-Reply-To: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> Message-ID: <1598868077.8.0.873308707308.issue41670@roundup.psfhosted.org> Mark Shannon added the comment: A couple of things to fix here. Firstly, the PREDICTion of POP_BLOCK in FOR_ITER shouldn't be there. POP_BLOCK doesn't normally occur after a loop and hasn't since we removed "pseudo exceptions" from the interpreter a couple of years ago. Secondly, there is the issue of PREDICTs skipping tracing. Either we can make sure that no PREDICTs cross a line boundary, which seems error prone, or we add the check for tracing into the PREDICT macro, which seems more robust. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 06:39:47 2020 From: report at bugs.python.org (Mark Shannon) Date: Mon, 31 Aug 2020 10:39:47 +0000 Subject: [issue41670] ceval traces code differently with USE_COMPUTED_GOTOS In-Reply-To: <1598827771.16.0.682087136522.issue41670@roundup.psfhosted.org> Message-ID: <1598870387.66.0.547254394457.issue41670@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +21126 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22026 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 07:23:59 2020 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 31 Aug 2020 11:23:59 +0000 Subject: [issue2506] Add mechanism to disable optimizations In-Reply-To: <1206797921.05.0.258043023613.issue2506@psf.upfronthosting.co.za> Message-ID: <1598873039.0.0.101566246721.issue2506@roundup.psfhosted.org> Ned Batchelder added the comment: If there is any doubt that this affects people, it was reported *again* against coverage.py today: https://github.com/nedbat/coveragepy/issues/1025 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 07:41:44 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 11:41:44 +0000 Subject: [issue41668] Expose eventfd for high-performance event notifier in Linux In-Reply-To: <1598818517.47.0.408259765239.issue41668@roundup.psfhosted.org> Message-ID: <1598874104.19.0.217737389384.issue41668@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Indeed it is. CLosing in favour of bpo-41001 ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 08:56:22 2020 From: report at bugs.python.org (Eric Wieser) Date: Mon, 31 Aug 2020 12:56:22 +0000 Subject: [issue41673] Result of multiprocessing.heap.BufferWrapper.create_memoryview can point to freed memory Message-ID: <1598878582.68.0.23646842714.issue41673@roundup.psfhosted.org> New submission from Eric Wieser : The full definition of `multiprocessing.heap.BufferWrapper` is: class BufferWrapper(object): _heap = Heap() def __init__(self, size): if size < 0: raise ValueError("Size {0:n} out of range".format(size)) if sys.maxsize <= size: raise OverflowError("Size {0:n} too large".format(size)) block = BufferWrapper._heap.malloc(size) self._state = (block, size) util.Finalize(self, BufferWrapper._heap.free, args=(block,)) def create_memoryview(self): (arena, start, stop), size = self._state return memoryview(arena.buffer)[start:start+size] But this means that a `memoryview` can be constructed that point to free'd "memory", >>> b = BufferWrapper(10) >>> m = b.create_memoryview() >>> del b # free is called >>> b[0] # making this invalid It would be better if `m` would keep a reference to `b` so that it remains alive. `RawArray` works around this by placing a reference to `b` in `ctypes_obj._wrapper`, but this results in `b` being lost again if `m2 = memoryview(ctypes_obj); del ctypes_obj` is used. ---------- components: Library (Lib), ctypes messages: 376149 nosy: Eric Wieser priority: normal severity: normal status: open title: Result of multiprocessing.heap.BufferWrapper.create_memoryview can point to freed memory versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 08:57:18 2020 From: report at bugs.python.org (Eric Wieser) Date: Mon, 31 Aug 2020 12:57:18 +0000 Subject: [issue41673] Result of multiprocessing.heap.BufferWrapper.create_memoryview can point to freed memory In-Reply-To: <1598878582.68.0.23646842714.issue41673@roundup.psfhosted.org> Message-ID: <1598878638.24.0.882185382428.issue41673@roundup.psfhosted.org> Eric Wieser added the comment: Whoops, typo. `>>> b[0]` should read `m[0]`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:12:00 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 13:12:00 +0000 Subject: [issue2506] Add mechanism to disable optimizations In-Reply-To: <1206797921.05.0.258043023613.issue2506@psf.upfronthosting.co.za> Message-ID: <1598879520.94.0.316766770949.issue2506@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +21127 pull_request: https://github.com/python/cpython/pull/22027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:15:37 2020 From: report at bugs.python.org (Emmanuel Arias) Date: Mon, 31 Aug 2020 13:15:37 +0000 Subject: [issue41674] Doc tests failing for many PRs on GitHub Message-ID: <1598879737.34.0.734115433925.issue41674@roundup.psfhosted.org> New submission from Emmanuel Arias : Hi, This issue was reported by Mark Shannon on Python-dev mailing list Seems that there's an issue on doc build on Github pipeline https://github.com/python/cpython/pull/22026/checks?check_run_id=1050881634 https://github.com/python/cpython/pull/22025/checks?check_run_id=1050403463 ---------- messages: 376151 nosy: eamanu priority: normal severity: normal status: open title: Doc tests failing for many PRs on GitHub versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:51:22 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 13:51:22 +0000 Subject: [issue41675] Modernize siginterrupt calls Message-ID: <1598881882.83.0.824642954099.issue41675@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : siginterrupt is deprecated: ./Modules/signalmodule.c:667:5: warning: ?siginterrupt? is deprecated: Use sigaction with SA_RESTART instead [-Wdeprecated-declarations] 667 | if (siginterrupt(signalnum, flag)<0) { ---------- messages: 376152 nosy: pablogsal priority: normal severity: normal status: open title: Modernize siginterrupt calls versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:51:29 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 13:51:29 +0000 Subject: [issue41675] Modernize siginterrupt calls In-Reply-To: <1598881882.83.0.824642954099.issue41675@roundup.psfhosted.org> Message-ID: <1598881889.63.0.961045301134.issue41675@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:53:50 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 13:53:50 +0000 Subject: [issue41675] Modernize siginterrupt calls In-Reply-To: <1598881882.83.0.824642954099.issue41675@roundup.psfhosted.org> Message-ID: <1598882030.55.0.205338427489.issue41675@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +21128 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:54:37 2020 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 31 Aug 2020 13:54:37 +0000 Subject: [issue41676] asyncio.Event.wait broken link from asyncio.Event Message-ID: <1598882077.33.0.587005753181.issue41676@roundup.psfhosted.org> New submission from Thomas Grainger : https://docs.python.org/dev/library/asyncio-sync.html#asyncio.Event links to https://docs.python.org/dev/library/asyncio-task.html#asyncio.wait instead of https://docs.python.org/dev/library/asyncio-sync.html#asyncio.Event.wait ---------- assignee: docs at python components: Documentation messages: 376153 nosy: docs at python, graingert priority: normal severity: normal status: open title: asyncio.Event.wait broken link from asyncio.Event versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:55:28 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 31 Aug 2020 13:55:28 +0000 Subject: [issue41676] asyncio.Event.wait broken link from asyncio.Event In-Reply-To: <1598882077.33.0.587005753181.issue41676@roundup.psfhosted.org> Message-ID: <1598882128.16.0.0413080002413.issue41676@roundup.psfhosted.org> STINNER Victor added the comment: Do you want to propose a documentation fix? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 09:55:28 2020 From: report at bugs.python.org (Ben) Date: Mon, 31 Aug 2020 13:55:28 +0000 Subject: [issue41676] asyncio.Event.wait broken link from asyncio.Event In-Reply-To: <1598882077.33.0.587005753181.issue41676@roundup.psfhosted.org> Message-ID: <1598882128.22.0.185310281036.issue41676@roundup.psfhosted.org> Change by Ben : ---------- nosy: +bjs, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 10:01:57 2020 From: report at bugs.python.org (Ben) Date: Mon, 31 Aug 2020 14:01:57 +0000 Subject: [issue41676] asyncio.Event.wait broken link from asyncio.Event In-Reply-To: <1598882077.33.0.587005753181.issue41676@roundup.psfhosted.org> Message-ID: <1598882517.44.0.301232138007.issue41676@roundup.psfhosted.org> Ben added the comment: looking at the source https://raw.githubusercontent.com/python/cpython/3.8/Doc/library/asyncio-sync.rst it says :meth:`wait` just like the surrounding methods and surrounding types, which all work. Maybe :meth:`Event.wait` would fix? But why :meth:`wait` didn't work is not obvious to me? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 10:04:07 2020 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 31 Aug 2020 14:04:07 +0000 Subject: [issue41676] asyncio.Event.wait broken link from asyncio.Event In-Reply-To: <1598882077.33.0.587005753181.issue41676@roundup.psfhosted.org> Message-ID: <1598882647.42.0.635301105581.issue41676@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch pull_requests: +21129 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 11:09:40 2020 From: report at bugs.python.org (Paul Madden) Date: Mon, 31 Aug 2020 15:09:40 +0000 Subject: [issue33997] multiprocessing Pool hangs in terminate() In-Reply-To: <1530275873.32.0.56676864532.issue33997@psf.upfronthosting.co.za> Message-ID: <1598886580.85.0.192336392621.issue33997@roundup.psfhosted.org> Change by Paul Madden : ---------- nosy: +paul.madden _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 11:29:10 2020 From: report at bugs.python.org (Michael Pelletier) Date: Mon, 31 Aug 2020 15:29:10 +0000 Subject: [issue41677] os.access() doesn't recognize lack of permissions on an SMB mountpoint Message-ID: <1598887750.34.0.874039613548.issue41677@roundup.psfhosted.org> New submission from Michael Pelletier : This emerged during a fault in a fileserver mounted on a Linux machine via a Samba client mount. The access to the mountpoint was being blocked by the fileserver, but os.access() wasn't able to recognize it as unreadable: >>> os.access('/opt/xray', os.R_OK) True >>> s = os.stat('/opt/xray') Traceback (most recent call last): File "", line 1, in PermissionError: [Errno 13] Permission denied: '/opt/xray' >>> Python version is 3.6.8. ---------- components: IO messages: 376156 nosy: mvpel priority: normal severity: normal status: open title: os.access() doesn't recognize lack of permissions on an SMB mountpoint type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 12:01:22 2020 From: report at bugs.python.org (Platon workaccount) Date: Mon, 31 Aug 2020 16:01:22 +0000 Subject: [issue41678] File-level, optionally external sorting Message-ID: <1598889682.73.0.396107473033.issue41678@roundup.psfhosted.org> New submission from Platon workaccount : Feature request: a convenient sorter of whole files with the possibility of disk usage. Here's the syntax in my mind: shutil.sort(src, dst, headers=0, key=None, reverse=False, allow_disk_use=False) ---------- messages: 376157 nosy: platon.work priority: normal severity: normal status: open title: File-level, optionally external sorting type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 12:11:53 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 31 Aug 2020 16:11:53 +0000 Subject: [issue41679] Deprecation warning due to invalid escape sequences in Doc/tools/extensions/peg_highlight.py Message-ID: <1598890312.99.0.135296062189.issue41679@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Following warnings are caused in Doc/tools/extensions/peg_highlight.py . These warnings show up during doc builds since the extension is used in the build. This is an easy issue to fix. ./python -Wall -m py_compile /root/cpython/Doc/tools/extensions/peg_highlight.py /root/cpython/Doc/tools/extensions/peg_highlight.py:62: DeprecationWarning: invalid escape sequence \s r"^\s*" + _name + "\s*" + "(\[.*\])?" + "\s*" + "(\(.+\))?" + "\s*(:)", /root/cpython/Doc/tools/extensions/peg_highlight.py:62: DeprecationWarning: invalid escape sequence \[ r"^\s*" + _name + "\s*" + "(\[.*\])?" + "\s*" + "(\(.+\))?" + "\s*(:)", /root/cpython/Doc/tools/extensions/peg_highlight.py:62: DeprecationWarning: invalid escape sequence \s r"^\s*" + _name + "\s*" + "(\[.*\])?" + "\s*" + "(\(.+\))?" + "\s*(:)", /root/cpython/Doc/tools/extensions/peg_highlight.py:62: DeprecationWarning: invalid escape sequence \( r"^\s*" + _name + "\s*" + "(\[.*\])?" + "\s*" + "(\(.+\))?" + "\s*(:)", /root/cpython/Doc/tools/extensions/peg_highlight.py:62: DeprecationWarning: invalid escape sequence \s r"^\s*" + _name + "\s*" + "(\[.*\])?" + "\s*" + "(\(.+\))?" + "\s*(:)", ---------- components: Build messages: 376158 nosy: pablogsal, xtreak priority: normal severity: normal status: open title: Deprecation warning due to invalid escape sequences in Doc/tools/extensions/peg_highlight.py type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 13:47:08 2020 From: report at bugs.python.org (Piotr Dobrogost) Date: Mon, 31 Aug 2020 17:47:08 +0000 Subject: [issue36318] Adding support for setting the "disabled" attribute of loggers from logging.config.dictConfig In-Reply-To: <1552761329.43.0.180278602772.issue36318@roundup.psfhosted.org> Message-ID: <1598896028.73.0.823995117955.issue36318@roundup.psfhosted.org> Change by Piotr Dobrogost : ---------- nosy: +piotr.dobrogost _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:24:37 2020 From: report at bugs.python.org (Weyl) Date: Mon, 31 Aug 2020 18:24:37 +0000 Subject: [issue41680] Turtles in Python 3.8.5 crashes OSX 10.14.6 Message-ID: <1598898277.27.0.605010219391.issue41680@roundup.psfhosted.org> New submission from Weyl : The following python sequence will crash OSX 10.14.6 and Python 3.8 import turtle theScreen=turtle.Screen() mertle=turtle.Turtle() ---------- components: macOS messages: 376159 nosy: dulcimoo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Turtles in Python 3.8.5 crashes OSX 10.14.6 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:24:58 2020 From: report at bugs.python.org (Weyl) Date: Mon, 31 Aug 2020 18:24:58 +0000 Subject: [issue41680] Turtles in Python 3.8.5 crashes OSX 10.14.6 In-Reply-To: <1598898277.27.0.605010219391.issue41680@roundup.psfhosted.org> Message-ID: <1598898298.37.0.860461434106.issue41680@roundup.psfhosted.org> Change by Weyl : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:30:12 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 31 Aug 2020 18:30:12 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1598898612.66.0.216027884474.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +21130 pull_request: https://github.com/python/cpython/pull/22032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:40:25 2020 From: report at bugs.python.org (Hanish) Date: Mon, 31 Aug 2020 18:40:25 +0000 Subject: [issue41681] f-string error description seems wrong Message-ID: <1598899225.8.0.488933679404.issue41681@roundup.psfhosted.org> New submission from Hanish : There seems to an error in the `f-string` error description when one do: >>> f'{1:,,}' Traceback (most recent call last): File "", line 1, in ValueError: Cannot specify both ',' and '_'. >>> The error seems to be that, i am not specifying both ',' and '_', but it does seem to think so. This also seems to be happening for `str.format`: >>> '{:,,}'.format(1) Traceback (most recent call last): File "", line 1, in ValueError: Cannot specify both ',' and '_'. So i was just wondering if this is an issue worth raising :) Thank you ---------- components: Interpreter Core messages: 376160 nosy: eric.smith, han-solo priority: normal severity: normal status: open title: f-string error description seems wrong type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:43:30 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 31 Aug 2020 18:43:30 +0000 Subject: [issue41681] f-string error description seems wrong In-Reply-To: <1598899225.8.0.488933679404.issue41681@roundup.psfhosted.org> Message-ID: <1598899410.29.0.954460029333.issue41681@roundup.psfhosted.org> Eric V. Smith added the comment: It has to do with how the specification for the mini-language is parsed and how the defaults work. It could probably be fixed, but I'm personally not super motivated to track it down. But I'd look at a patch! I'm going to remove versions that we wouldn't backport this to. ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:46:00 2020 From: report at bugs.python.org (Hanish) Date: Mon, 31 Aug 2020 18:46:00 +0000 Subject: [issue41681] f-string error description seems wrong In-Reply-To: <1598899225.8.0.488933679404.issue41681@roundup.psfhosted.org> Message-ID: <1598899560.31.0.677583014468.issue41681@roundup.psfhosted.org> Hanish added the comment: Sure. Thanks for the quick response :) Let me see if i can try to come up with something :) ---------- versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 14:47:07 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 31 Aug 2020 18:47:07 +0000 Subject: [issue41681] f-string error description seems wrong In-Reply-To: <1598899225.8.0.488933679404.issue41681@roundup.psfhosted.org> Message-ID: <1598899627.68.0.718675263764.issue41681@roundup.psfhosted.org> Change by Eric V. Smith : ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:00:25 2020 From: report at bugs.python.org (Aaron Meurer) Date: Mon, 31 Aug 2020 19:00:25 +0000 Subject: [issue35212] Expressions with format specifiers in f-strings give wrong code position in AST In-Reply-To: <1541939640.9.0.788709270274.issue35212@psf.upfronthosting.co.za> Message-ID: <1598900425.31.0.626360231329.issue35212@roundup.psfhosted.org> Aaron Meurer added the comment: The same thing occurs with specifiers like {a!r}. ---------- nosy: +asmeurer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:01:35 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Aug 2020 19:01:35 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1598900495.13.0.0129800629827.issue26053@roundup.psfhosted.org> Irit Katriel added the comment: The regression was introduced here: https://github.com/python/cpython/commit/e023091815e4946e42c1af102be1f258b2f47cb8 in main() it prints " ".join(sys.argv[1:]) instead of " ".join(args). In do_run (line 1029) sys.argv gets updated with the arg for that particular "run" command: sys.argv = shlex.split(arg) The quickest fix would be to change main back to print sys.argv rather than arg. But I'm a little uneasy with a program modifying sys.argv (I wouldn't do it). So I'm wondering if that should be changed. What do you think? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:40:02 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Aug 2020 19:40:02 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1598902802.47.0.974073170834.issue26053@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +21131 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:43:19 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 31 Aug 2020 19:43:19 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1598902999.62.0.0224312835806.issue26053@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:57:06 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 31 Aug 2020 19:57:06 +0000 Subject: [issue41154] test_pkgutil:test_name_resolution fails on macOS HFS+ file systems In-Reply-To: <1593413801.07.0.974965447149.issue41154@roundup.psfhosted.org> Message-ID: <1598903826.05.0.0533921134181.issue41154@roundup.psfhosted.org> Brett Cannon added the comment: I think if we can craft a skip check that is targeted enough then that's our best solution, but barring that then skipping for all of macOS wouldn't be the end of the world (maybe a slightly less brute force is a macOS version check?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:58:01 2020 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 31 Aug 2020 19:58:01 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598903881.44.0.833257923515.issue39010@roundup.psfhosted.org> Yury Selivanov added the comment: New changeset ea5a6363c3f8cc90b7c0cc573922b10f296073b6 by Ben Darnell in branch 'master': bpo-39010: Fix errors logged on proactor loop restart (#22017) https://github.com/python/cpython/commit/ea5a6363c3f8cc90b7c0cc573922b10f296073b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:58:20 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Aug 2020 19:58:20 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598903900.34.0.156281628221.issue39010@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +21132 pull_request: https://github.com/python/cpython/pull/22034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 15:58:29 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 31 Aug 2020 19:58:29 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598903909.07.0.138014764596.issue39010@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21133 pull_request: https://github.com/python/cpython/pull/22035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 16:33:11 2020 From: report at bugs.python.org (Facundo Batista) Date: Mon, 31 Aug 2020 20:33:11 +0000 Subject: [issue41400] Remove references to nonexisting __ne__ methods In-Reply-To: <1595758726.41.0.0930061303675.issue41400@roundup.psfhosted.org> Message-ID: <1598905991.97.0.272981594953.issue41400@roundup.psfhosted.org> Facundo Batista added the comment: >From a "consumer" POV, it's totally useful to see that `__ne__` is part of what Set (and others) provides, even if it's implemented in the Set class itself or wherever. So +1 to leave it like it's currently is. ---------- nosy: +facundobatista _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 16:51:39 2020 From: report at bugs.python.org (Hanish) Date: Mon, 31 Aug 2020 20:51:39 +0000 Subject: [issue41681] f-string error description seems wrong In-Reply-To: <1598899225.8.0.488933679404.issue41681@roundup.psfhosted.org> Message-ID: <1598907099.5.0.860517496711.issue41681@roundup.psfhosted.org> Change by Hanish : ---------- keywords: +patch pull_requests: +21134 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 17:17:29 2020 From: report at bugs.python.org (Ethan Furman) Date: Mon, 31 Aug 2020 21:17:29 +0000 Subject: [issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...) In-Reply-To: <1580120758.52.0.283644207368.issue39461@roundup.psfhosted.org> Message-ID: <1598908649.17.0.657248651297.issue39461@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 17:18:15 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 31 Aug 2020 21:18:15 +0000 Subject: [issue41678] File-level, optionally external sorting In-Reply-To: <1598889682.73.0.396107473033.issue41678@roundup.psfhosted.org> Message-ID: <1598908695.66.0.746583742448.issue41678@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: What do you refer when you say "sorting a file"? What does "key" act upon? Strings representing the lines in the file? For allow_disk_use=False, what's the difference between opening the file, reading the lines, using sort() and writing the contents? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 17:28:53 2020 From: report at bugs.python.org (Murat Turan) Date: Mon, 31 Aug 2020 21:28:53 +0000 Subject: [issue40083] No run option available in python idle in version 3.8.2 In-Reply-To: <1585292684.98.0.176532437082.issue40083@roundup.psfhosted.org> Message-ID: <1598909333.24.0.794086390342.issue40083@roundup.psfhosted.org> Murat Turan added the comment: There is a very simple solution for that. Open IDLE, if you dont see RUN tab, its opened in "Shell" mode. Go Options --> Configure IDLE, click to "General" tab and choose "Open Edit Window" option for start-up. That's it! ---------- nosy: +Murat_Turan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 18:13:25 2020 From: report at bugs.python.org (Hanish) Date: Mon, 31 Aug 2020 22:13:25 +0000 Subject: [issue41681] f-string error description seems wrong In-Reply-To: <1598899225.8.0.488933679404.issue41681@roundup.psfhosted.org> Message-ID: <1598912005.87.0.133832240804.issue41681@roundup.psfhosted.org> Hanish added the comment: I have raised a pull request for the fix https://github.com/python/cpython/pull/22036. Your review is appreciated :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 18:16:17 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 31 Aug 2020 22:16:17 +0000 Subject: [issue40083] No run option available in python idle in version 3.8.2 In-Reply-To: <1585292684.98.0.176532437082.issue40083@roundup.psfhosted.org> Message-ID: <1598912177.06.0.07925174249.issue40083@roundup.psfhosted.org> Terry J. Reedy added the comment: I am assuming that Murat is correct that the only problem is confusion between 'Shell' (which is a subclass of the base editor window) and Editor Window (which is a different subclass). For further help, please to to a general forum, such as python-list. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 19:11:44 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 31 Aug 2020 23:11:44 +0000 Subject: [issue41669] Case mismatch between "include" and "Include" In-Reply-To: <1598824086.3.0.112428112748.issue41669@roundup.psfhosted.org> Message-ID: <1598915504.3.0.210376115681.issue41669@roundup.psfhosted.org> Steve Dower added the comment: Unfortunately, it's easier to change what we distribute, except that has _always_ been "include" (based on a 2.4 installer I had laying around). And of course we can't change the repo. Still, case sensitivity is becoming more acceptable on Windows and there are more ways to enable it, so we're probably best to deal with this. For 3.10, we can update PC/layout/main.py and tools/msi/common.wxs#L80 to create "Include", and we probably want to go over the few places where we may reference it to make sure the case is consistent. (Noting that distutils is fully deprecated in 3.10, so it doesn't matter.) I'm not sure that it qualifies as enough of a bugfix for 3.8 or 3.9.1, so I think we'll leave them alone. A case-sensitive file system can easily support a symlink/junction from "Include" to "include" anyway, which is a pretty straightforward workaround ;) ---------- versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 19:13:08 2020 From: report at bugs.python.org (Steve Dower) Date: Mon, 31 Aug 2020 23:13:08 +0000 Subject: [issue39010] ProactorEventLoop raises unhandled ConnectionResetError In-Reply-To: <1575924458.67.0.403977169674.issue39010@roundup.psfhosted.org> Message-ID: <1598915588.76.0.0410200761027.issue39010@roundup.psfhosted.org> Steve Dower added the comment: Thanks, Ben! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 19:55:19 2020 From: report at bugs.python.org (Platon workaccount) Date: Mon, 31 Aug 2020 23:55:19 +0000 Subject: [issue41678] File-level, optionally external sorting In-Reply-To: <1598908695.66.0.746583742448.issue41678@roundup.psfhosted.org> Message-ID: Platon workaccount added the comment: I mean Python's analog of sort [-k x.y] table.txt from GNU Coreutils. >> What do you refer when you say "sorting a file"? Sorting a file with multi-line plain text. Optionally, text consisting of several columns separated by a specific character. >> What does "key" act upon? Strings representing the lines in the file? This is a sort rule argument similar to that of the existing in-memory sort()/sorted() method. >> For allow_disk_use=False, what's the difference between opening the file, reading the lines, using sort() and writing the contents? If False, there is no difference. ??, 1 ????. 2020 ?. ? 00:18, Pablo Galindo Salgado : > > Pablo Galindo Salgado added the comment: > > What do you refer when you say "sorting a file"? > > What does "key" act upon? Strings representing the lines in the file? > > For allow_disk_use=False, what's the difference between opening the file, > reading the lines, using sort() and writing the contents? > > ---------- > nosy: +pablogsal > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 21:20:55 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 01 Sep 2020 01:20:55 +0000 Subject: [issue41682] test_asyncio: Proactor Message-ID: <1598923255.6.0.989955407462.issue41682@roundup.psfhosted.org> Change by Kyle Stanley : ---------- nosy: aeros priority: normal severity: normal status: open title: test_asyncio: Proactor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 21:24:09 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 01 Sep 2020 01:24:09 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure Message-ID: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> New submission from Kyle Stanley : In an unrelated PR to add a new argument to the base Executor class for concurrent.futures, there was a test_asyncio failure in test_sendfile for the ProactorEventLoop tests: ====================================================================== FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 452, in test_sendfile_close_peer_in_the_middle_of_receiving self.run_loop( AssertionError: ConnectionError not raised ---------------------------------------------------------------------- https://github.com/python/cpython/pull/22023/checks?check_run_id=1049760805#step:5:2373 ---------- title: test_asyncio: Proactor -> test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 21:26:06 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 01 Sep 2020 01:26:06 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1598923566.61.0.902522236967.issue41682@roundup.psfhosted.org> Change by Kyle Stanley : ---------- components: +Tests nosy: +asvetlov, yselivanov type: -> behavior versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 21:36:41 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 01 Sep 2020 01:36:41 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1598924201.94.0.633218091451.issue41682@roundup.psfhosted.org> Kyle Stanley added the comment: In case the link to the logs are lost from closing and reopening the PR, it was a Windows CI test (GitHub actions) ran with the following configuration: D:\a\cpython\cpython>"D:\a\cpython\cpython\PCbuild\amd64\python.exe" -u -Wd -E -bb -m test -uall -u-cpu -rwW --slowest --timeout 1200 -j0 == CPython 3.10.0a0 (remotes/pull/22023/merge:992cc27, Aug 31 2020, 06:11:21) [MSC v.1927 64 bit (AMD64)] == Windows-10-10.0.17763-SP0 little-endian == cwd: D:\a\cpython\cpython\build\test_python_6372? == CPU count: 2 == encodings: locale=cp1252, FS=utf-8 Using random seed 491155 0:00:00 Run tests in parallel using 4 child processes (timeout: 20 min, worker timeout: 25 min) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 21:51:13 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 01 Sep 2020 01:51:13 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1598925073.78.0.922165316489.issue41682@roundup.psfhosted.org> Change by Kyle Stanley : ---------- components: +Windows, asyncio nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 21:51:47 2020 From: report at bugs.python.org (Kyle Stanley) Date: Tue, 01 Sep 2020 01:51:47 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1598925107.28.0.616101423272.issue41682@roundup.psfhosted.org> Change by Kyle Stanley : ---------- nosy: -paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 22:55:56 2020 From: report at bugs.python.org (Prasanth R) Date: Tue, 01 Sep 2020 02:55:56 +0000 Subject: [issue41683] Python3: Installation error on Ubunti-18 Message-ID: <1598928956.49.0.0670717412104.issue41683@roundup.psfhosted.org> New submission from Prasanth R : Got this error on Ubuntu-18 alone ``` _PYTHON_PROJECT_BASE=python3-3.8.3/Python-3.8.3 _PYTHON_HOST_PLATFORM=linux-x86_64 PYTHONPATH=python3-3.8.3/Python-3.8.3/build/lib.linux-x86_64-3.8/sysconfigdata:./Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_x86_64-linux-gnu python3.8 -m ensurepip \ $ensurepip --root=toolchain/ ; \ fi ERROR: Exception: Traceback (most recent call last): File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 188, in main status = self.run(options, args) File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 286, in run with self._build_session(options) as session: File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 101, in _build_session session = PipSession( File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/download.py", line 559, in __init__ self.headers["User-Agent"] = user_agent() File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_internal/download.py", line 144, in user_agent zip(["name", "version", "id"], distro.linux_distribution()), File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 122, in linux_distribution return _distro.linux_distribution(full_distribution_name) File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 677, in linux_distribution self.version(), File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 737, in version self.lsb_release_attr('release'), File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 899, in lsb_release_attr return self._lsb_release_info.get(attribute, '') File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 552, in __get__ ret = obj.__dict__[self._fname] = self._f(obj) File "/tmp/tmp48him7rr/pip-19.2.3-py2.py3-none-any.whl/pip/_vendor/distro.py", line 1012, in _lsb_release_info stdout = subprocess.check_output(cmd, stderr=devnull) File "python3-3.8.3/Python-3.8.3/Lib/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "python3-3.8.3/Python-3.8.3/Lib/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1. Makefile:1189: recipe for target 'install' failed make[1]: *** [install] Error 2 make[1]: Leaving directory 'python3-3.8.3/Python-3.8.3' ``` ---------- components: Build messages: 376177 nosy: prasanth priority: normal severity: normal status: open title: Python3: Installation error on Ubunti-18 type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 31 23:22:16 2020 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 01 Sep 2020 03:22:16 +0000 Subject: [issue41678] File-level, optionally external sorting In-Reply-To: <1598889682.73.0.396107473033.issue41678@roundup.psfhosted.org> Message-ID: <1598930536.92.0.655062185265.issue41678@roundup.psfhosted.org> Dennis Sweeney added the comment: If we were to do this, I think a better API might be to accept an arbitrary iterable, then produce a sorted iterable: def sorted_on_disk(iterable, key=None, reverse=False) -> Iterable: ... It would sort chunks of the input and store them in files as sequences of pickles, merging them as they got bigger, and then return an iterator over the resulting single sorted file. This would be more composable with other standard Python functions and would be a good way of separating concerns. sorted(...) and heapq.merge(...) already have the correct APIs to do it this way. Potential implementation detail: For some small fixed n, always doing a 2^n-way heapq.merge instead of a bunch of 2-way merges would do fewer passes over the data and would allow the keys to be computed 1/n as many times, assuming we wouldn't decorate-sort-undecorate. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________