[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2021-07-22 Thread Josh Meranda
Change by Josh Meranda : -- pull_requests: +25838 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27295 ___ Python tracker ___

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 2e3744d50b6e30ea24351e55b4352dcc58fd469e by Serhiy Storchaka in branch 'main': bpo-44653: Support typing types in parameter substitution in the union type. (GH-27247)

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25839 pull_request: https://github.com/python/cpython/pull/27296 ___ Python tracker

[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Jack DeVries
New submission from Jack DeVries : Good feedback from @merwork just missed the merge, but he is right: it should be ``shell=True``, not ``"shell=True"``. https://github.com/python/cpython/pull/26755#discussion_r675128438 I'll be attaching a PR in just a moment. -- messages: 398010

[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Jack DeVries
Change by Jack DeVries : -- keywords: +patch pull_requests: +25840 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27297 ___ Python tracker ___

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +25833 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27291 ___ Python tracker

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Anton Grübel
Anton Grübel added the comment: I know that :) , it is just weird to do also do the type check on an empty string, which can be replaced with str directly, but as far as I know it is usually better to use isinstance instead of type. -- ___ Python

[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25835 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27292 ___ Python tracker

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I suppose it is a very old code written when str was a function, not a type (thus using type('')) and builtin types were not subclassable (thus not using isinstance()). I once analyzed other similar cases in the stdlib. Seems it is time to revive my old

[issue44712] Replace `type(literal)` with corresponding builtin types

2021-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All cases was manually checked several times (with months passes between checks). Several cases were preserved: when the name of built-in type conflicted with the name of function parameter (in weakref.py), when the code was used for testing type() and

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue44712. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
Change by Łukasz Langa : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Eric V. Smith
Eric V. Smith added the comment: The difference is that type(cmd) is doing an exact match on the type, while isinstance is checking for types or derived types. I don't know if that makes a difference here, but it's worth noting. -- nosy: +eric.smith

[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK pointer arithmetic with NULL has undefined behavior. There is similar case in list_slice(). -- components: +Interpreter Core nosy: +mark.dickinson, serhiy.storchaka type: -> compile error versions: +Python 3.10, Python 3.11, Python 3.9

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 9608719e12b14087c1cb34f77c847974442cd6e7 by Miss Islington (bot) in branch '3.10': bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27290)

[issue44712] Replace `type(literal)` with corresponding builtin types

2021-07-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There are several occurrences of type(literal) in the code of the stdlib where literal is a literal of built-in type: '', 1, [], {}, etc. I suppose it is a remnants of very old code written when str, int, list, dict, etc were functions and not classes.

[issue44353] PEP 604 NewType

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: Note: we won't be backporting _typing to Python 3.10 as it is much too late for a new module at this point in the life cycle. Consequently, 3.10 will be a (temporary) performance regression in terms of typing.NewType. Thanks everyone, most of all Josepth for

[issue19217] Calling assertEquals for moderately long list takes too long

2021-07-22 Thread Jack DeVries
Jack DeVries added the comment: Hi all! @eamanu, I went ahead and picked up where you left off. I stopped short of opening up a PR, because I don't want to step on any toes, but I definitely want to do what I can to give this bpo one final shove over the finish line. Despite not creating a

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Anton G.
New submission from Anton G. : When I did some work on typeshed I found some weird syntax in pipes.py. if type(cmd) is not type(''): which can easily be changed to if not isinstance(cmd, str): There are two occurrences and I will directly create the PR :) -- components: Library

[issue44712] Replace `type(literal)` with corresponding builtin types

2021-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25837 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27294 ___ Python tracker

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +25836 pull_request: https://github.com/python/cpython/pull/27293 ___ Python tracker ___

[issue44353] PEP 604 NewType

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 96c4cbd96c769e92869c62ba898dd9eb670baa81 by Yurii Karabas in branch 'main': bpo-44353: Implement typing.NewType __call__ method in C (#27262) https://github.com/python/cpython/commit/96c4cbd96c769e92869c62ba898dd9eb670baa81 --

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 0f55d21212a0fb6dec4479eb76249ab2b54e57a3 by Łukasz Langa in branch '3.9': [3.9] bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27293)

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 21db59fc75b6ebb01bf120a8e5930fe032174f73 by Miss Islington (bot) in branch '3.10': bpo-44653: Support typing types in parameter substitution in the union type. (GH-27247) (#27296)

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks Serhiy for the report and the fix, and Ken for reviews. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: Interestingly I cannot reproduce the clang report on macOS 10.15 with clang 12.0.0. Maybe it's a new capability of clang 12.0.5 in Big Sur. -- nosy: +lukasz.langa ___ Python tracker

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-22 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for taking over here, Ł! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread miss-islington
miss-islington added the comment: New changeset 7d25254cf0763b62f4c4a3019e56385cab597b9f by Jack DeVries in branch 'main': bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297) https://github.com/python/cpython/commit/7d25254cf0763b62f4c4a3019e56385cab597b9f -- nosy:

[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +25841 pull_request: https://github.com/python/cpython/pull/27298 ___ Python tracker ___

[issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True``

2021-07-22 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the follow-up! Note that the original bug could have been reused. -- nosy: +eric.araujo resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue44697] Memory leak when asyncio.open_connection raise

2021-07-22 Thread Andrey
Andrey added the comment: Confirmed. I have the same problem. I suspect this is related to https://bugs.python.org/issue41699. -- nosy: +whoKilledLora ___ Python tracker ___

[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Tzach Yarimi
New submission from Tzach Yarimi : Primitives usually accept an instance of their own type in the constructor, for example: int(5) str("a") tuple((1,2,3)) This is not the case for UUID: >>> from uuid import uuid4, UUID >>> x = uuid4() >>> UUID(x) Traceback (most recent call last): File "",

[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Tzach Yarimi
Change by Tzach Yarimi : -- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___

[issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c

2021-07-22 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
New submission from Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : After seeing this issue https://bugs.python.org/issue44698, I wanted to run clang on the main branch (c878f5d81772dc6f718d6608c78baa4be9a4f176) with an undefined option enabled. Is the following a bug or false

[issue42414] unable to document fields of dataclass

2021-07-22 Thread Denis Laxalde
Change by Denis Laxalde : -- nosy: +dlax ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44651] An unclear definition in Doc/glossary.rst

2021-07-22 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset c05a790693b3b00ac7cb5b96ad416ca9d8ecb14a by Steven Hsu in branch 'main': bpo-44651: delete entry of "coercion" in Doc/glossary.rst (GH-27226) https://github.com/python/cpython/commit/c05a790693b3b00ac7cb5b96ad416ca9d8ecb14a --

[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-22 Thread Tobias Bergkvist
Tobias Bergkvist added the comment: You are absolutely right! From the manpage of dlopen(3) on MacOS Big Sur: > dlopen() examines the mach-o file specified by path. If the file is > compatible with the current process and has not already been loaded into the > current process, it is loaded

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
New submission from Łukasz Langa : When the CPython test suite re-runs a flaky failed test, it doesn’t actually re-run just that failed test but the entire test file. The most common case for flaky tests is when networking, threading, or multiprocessing is involved. Frustratingly those are

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
Change by Łukasz Langa : -- keywords: +patch pull_requests: +25829 pull_request: https://github.com/python/cpython/pull/27287 ___ Python tracker ___

[issue41556] hostname verification fails if hostname starts with literal IPv4

2021-07-22 Thread Devin Bayer
Change by Devin Bayer : -- nosy: +akvadrako ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44697] Memory leak when asyncio.open_connection raise

2021-07-22 Thread Artem
Change by Artem : -- nosy: +bquinlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-22 Thread San
New submission from San : I was trying to wrap an old game server executable with a built-in console using Popen. class ServerWrapper(Thread): def __init__(self, pathToExecutable: str, statusMonitor: Popen = None, active: bool = False): super().__init__()

[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-22 Thread Ronald Oussoren
Ronald Oussoren added the comment: The disadvantage of using dlopen is that this function has side effects, and those can affect program behaviour. Because of this I'm against switching to using dlopen to probe for libraries. -- ___ Python

[issue35183] os.path.splitext documentation needs typical example

2021-07-22 Thread Jake Stockwin
Change by Jake Stockwin : -- keywords: +patch pull_requests: +25828 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27286 ___ Python tracker ___

[issue44705] Support Windows file open modes for `open` built-in function

2021-07-22 Thread Eryk Sun
Eryk Sun added the comment: Currently you can use os.open() if you need platform-specific open flags such as Windows O_RANDOM, O_SEQUENTIAL, O_SHORT_LIVED, and O_TEMPORARY. The file descriptor can be passed to builtin open() to get a file object that owns the fd. It might be more

[issue35183] os.path.splitext documentation needs typical example

2021-07-22 Thread Jake Stockwin
Jake Stockwin added the comment: Thanks for the info, @jack__d - very helpful. I have now submitted a PR for this and will await a review. Let me know if anything else is needed. -- ___ Python tracker

[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Tzach Yarimi
Change by Tzach Yarimi : -- components: Library (Lib) nosy: tzach priority: normal severity: normal status: open title: UUID constructor should accept another UUID instance type: behavior versions: Python 3.11 ___ Python tracker

[issue44706] UUID constructor should accept another UUID instance

2021-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a duplicate of issue32112. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Should uuid.UUID() accept another UUID() instance? ___ Python

[issue44710] Unexpected behavior in empty class with pass (Python 3.7.3)

2021-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because super().__init__(name, bases, nmspc) does not have any effect. Type is created by the metaclass' __new__ method, and the __init__ method is virtually no-op. -- nosy: +serhiy.storchaka ___ Python tracker

[issue44689] MacOS: Python binaries not portable between Catalina and Big Sur

2021-07-22 Thread Tobias Bergkvist
Tobias Bergkvist added the comment: Okay, I decided to look into how I could do dynamic loading as you suggested. Here is a POC (executable) for using _dyld_shared_cache_contains_path when available: ``` #include #include void* libsystemb_handle; typedef bool

[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel
Irit Katriel added the comment: New changeset 5ffbb05f1c3c952588ba5c1927da0e8223f5aaa7 by Miss Islington (bot) in branch '3.9': bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27289)

[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel
Irit Katriel added the comment: New changeset d0c61753036dcae292d49aa8ddac555062da6b76 by Miss Islington (bot) in branch '3.10': bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27288)

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25832 pull_request: https://github.com/python/cpython/pull/27290 ___ Python tracker

[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +25831 pull_request: https://github.com/python/cpython/pull/27289 ___ Python tracker ___

[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel
Irit Katriel added the comment: New changeset 50ffbe3dafcae7826d114df61d56c7ac45a6358c by Jack DeVries in branch 'main': bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755)

[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25830 pull_request: https://github.com/python/cpython/pull/27288 ___ Python tracker

[issue44651] An unclear definition in Doc/glossary.rst

2021-07-22 Thread Mark Dickinson
Mark Dickinson added the comment: Closing. @StevenHsuYL: Thank you for the contribution! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue44710] Unexpected behavior in empty class with pass (Python 3.7.3)

2021-07-22 Thread Cheuk Ting Ho
New submission from Cheuk Ting Ho : Demo example: === class MyType(type): def __init__(cls, name, bases, nmspc): if "__annotations__" in nmspc: annotations = nmspc["__annotations__"] else: nmspc["__annotations__"] = {}

[issue14879] invalid docs for subprocess exceptions with shell=True

2021-07-22 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44708] Regression tests with -w should only re-run affected test methods, not the entire file

2021-07-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset f1afef5e0d93d66fbf3c9aaeab8b3b8da9617583 by Łukasz Langa in branch 'main': bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287)

[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: I might be missing something here, but if you send arbitrary binary data to stdout, where it gets written to the terminal, strange things are likely to happen. The terminal interprets the shell characters before Python gets to see them. I think that this

[issue44711] Optimize type check in pipes.py

2021-07-22 Thread Ma Lin
Ma Lin added the comment: > I suppose it is a very old code I also found a few old code may have performance loss. memoryview.cast() method was add in Python 3.3. This code doesn't use memoryview.cast(), which will bring extra memory overhead when the amount of data is very large.

[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-22 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe we should not fix this then? Copying seems unattractive, and the reason we proxy in the first place is not absolute safety but to make sure people don’t accidentally update the dict when they intend to update the class (for the side effect of updating

[issue44717] Improve AttributeError on circular imports of submodules

2021-07-22 Thread Filipe Laíns
New submission from Filipe Laíns : Consider the following $ tree a a ├── b │ ├── c.py │ └── __init__.py └── __init__.py 1 directory, 3 files $ cat a/b/__init__.py import a.b.c $ cat a/b/c.py import a.b a.b $ python Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type

[issue44717] Improve AttributeError on circular imports of submodules

2021-07-22 Thread Filipe Laíns
Change by Filipe Laíns : -- keywords: +patch pull_requests: +25842 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27299 ___ Python tracker ___

[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-22 Thread Brandt Bucher
Brandt Bucher added the comment: I believe that delegating to the actual underlying mapping without exposing it is a bit of a lost cause, since for some type m we still need these to work: >>> types.MappingProxyType(m({"a": 0)) | types.MappingProxyType(m({"b": 1})) m({'a': 0, 'b': 1}) >>>

[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-07-22 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +25843 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27300 ___ Python tracker ___

[issue36643] Forward reference is not resolved by dataclasses.fields()

2021-07-22 Thread Eric V. Smith
Eric V. Smith added the comment: It can’t be resolved in fields(): it is still undefined when the fields are created. I think the best solution is PEP 649. -- ___ Python tracker

[issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'

2021-07-22 Thread Fantix King
Change by Fantix King : -- nosy: +fantix nosy_count: 3.0 -> 4.0 pull_requests: +25844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/8620 ___ Python tracker

[issue39632] variadic function call broken on armhf when passing a float argument

2021-07-22 Thread Filipe Laíns
Filipe Laíns added the comment: #28491 is now resolved, so the PR should be unblocked. Would you mind rebasing it on main to retrigger the CI? -- nosy: +FFY00 ___ Python tracker

[issue44718] Incorrect arguments in function select() cause segfault

2021-07-22 Thread Xinmeng Xia
New submission from Xinmeng Xia : The following program can trigger segfault on all releases of Python. I think it may be caused by incorrect arguments. Version of Python: 3.6 - master(3.11.0a0) system: ubuntu 16.04 test.py import select def

[issue44719] Incorrect callable object crashes Python 3.11.0a0

2021-07-22 Thread Xinmeng Xia
New submission from Xinmeng Xia : This program can trigger "Aborted (core dumped)" on Python 3.9.0, Python 3.8.0, Python3.10.0a2. It trigger " segmentation fault" on the master (Python 3.11.0a0). == import weakref class Object: def __init__(self, arg):

[issue44720] Finding string in iteratively deleted object cause segfault

2021-07-22 Thread Xinmeng Xia
New submission from Xinmeng Xia : This piece of code is originally from https://github.com/python/cpython/tree/main/Lib/test/test_weakref.py. In function test_proxy_iter(), we change the original data dependency and then this generated test case (see the following "test.py") crashes Python.

[issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9

2021-07-22 Thread Jack DeVries
Jack DeVries added the comment: I just took a look at this, and I'm getting an output of "no data" (just one time) on 3.9.6. Has this been fixed? -- nosy: +jack__d ___ Python tracker

[issue44721] Problem in tkinter button widget

2021-07-22 Thread Seyed Amirhossein Misaghi
New submission from Seyed Amirhossein Misaghi : Hello The piece of code has false behavior. When click the button, the relief changes to tk.SUNKEN. I think this is a wrong behavior. Thanks -- components: Tkinter files: test.tar.gz messages: 398031 nosy: a.h.misaghi priority: normal