[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-16 Thread Christian Steinmeyer
Christian Steinmeyer added the comment: Thank you for the in depth look Jason! Especially that last comment was very useful to me. Perhaps it would make sense to add something like this to the documentation of zipfile. I'm not sure what would be the best hint, but perhaps in zipfile.Path's do

[issue44646] hash() of the unity type is not consistent with equality

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

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-16 Thread Paul Moore
Paul Moore added the comment: In "Apps and Features" on Windows 10, the application name is shown by default but not the version. I have 3 different versions of Python installed on my PC and if they all reported as "Python" it would be a lot harder to manage them (I'd have to click on each o

[issue44646] hash() of the unity type is not consistent with equality

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset aeaa553d650786afc6e68df1f4813ae1a5b71d05 by Serhiy Storchaka in branch 'main': bpo-44646: Fix the hash of the union type. (#27179) https://github.com/python/cpython/commit/aeaa553d650786afc6e68df1f4813ae1a5b71d05 -- nosy: +lukasz.langa _

[issue44646] hash() of the unity type is not consistent with equality

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

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue44646] hash() of the unity type is not consistent with equality

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 705988056e028bab3dbc5cff3671a8ddefc88ec7 by Miss Islington (bot) in branch '3.10': bpo-44646: Fix the hash of the union type. (GH-27179) (#27180) https://github.com/python/cpython/commit/705988056e028bab3dbc5cff3671a8ddefc88ec7 -- __

[issue44646] hash() of the unity type is not consistent with equality

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

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-16 Thread Pavel Moiseenko
Pavel Moiseenko added the comment: @paul.moore, but you don't need to open additional menus in the control panel to see the version of the app. -- ___ Python tracker ___

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread hongweipeng
hongweipeng added the comment: >>> from datetime import timedelta as a >>> from _datetime import timedelta as b >>> a is b True >>> `timedelta` is a C-level class, so inspect.signature(timedelta) is the same with inspect.signature(int). But `signature` allow C-level function such as `inspect

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-16 Thread Paul Moore
Paul Moore added the comment: See the attached screenshot. Only the app name is visible by default. I see no benefit to the change and a definite usability degradation for people like me with multiple Python versions. -- Added file: https://bugs.python.org/file50152/Apps and Features

[issue44636] It is possible to create a 1-type union type

2021-07-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d9f923280f204204f8703756aef4f655b579b4b8 by Serhiy Storchaka in branch 'main': bpo-44636: Collapse union of equal types (GH-27178) https://github.com/python/cpython/commit/d9f923280f204204f8703756aef4f655b579b4b8 --

[issue44636] It is possible to create a 1-type union type

2021-07-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +25718 pull_request: https://github.com/python/cpython/pull/27181 ___ Python tracker ___

[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25719 pull_request: https://github.com/python/cpython/pull/27182 ___ Python tracker ___

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Mark Shannon
Mark Shannon added the comment: New changeset 000e70ad5246732fcbd27cf59268185cbd5ad734 by Mark Shannon in branch 'main': bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) https://github.com/python/cpython/commit/000e70ad5246732fcbd27cf59268185cbd5ad734 --

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +25720 pull_request: https://github.com/python/cpython/pull/27183 ___ Python tracker ___

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 0e349ea5541104c76cafc173bfcfef8de872f96f by Mark Shannon in branch '3.10': [3.10] bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) (GH-27183) https://github.com/python/cpython/commit/0e349ea5541104c76cafc173b

[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 37686f78ccef5f1cf4776419a4270cf0ea7eadf0 by Mark Shannon in branch '3.10': bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) (GH-27182) https://github.com/python/cpython/commit

[issue44626] Incorrect tracing of nested if/if/for/yield

2021-07-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44640] Fix punctuation in isinstance() error message

2021-07-16 Thread wyz23x2
Change by wyz23x2 : -- title: Typos in error messages of isinstance() & issubclass() -> Fix punctuation in isinstance() error message ___ Python tracker ___ __

[issue44618] inspect.signature does not work for datetime classes

2021-07-16 Thread hongweipeng
Change by hongweipeng : -- keywords: +patch nosy: +hongweipeng nosy_count: 2.0 -> 3.0 pull_requests: +25721 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27177 ___ Python tracker __

[issue44652] Preserve natural order of args in the union type

2021-07-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There are two issues related to the order of __args__ in typing.Union and the union type. 1. Indexing typing.Union preserves the order of arguments, but it is not always true when use the | operator. >>> A = typing.NewType('A', str) >>> typing.Union[typ

[issue44652] Preserve natural order of args in the union type

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

[issue15907] move doctest test-data files into a subdirectory of Lib/test

2021-07-16 Thread Irit Katriel
Irit Katriel added the comment: This kind of reorg was recently rejected in issue44573, while this issue being open inspired similar initiative (eg issue44650). For those reasons I am closing this. -- ___ Python tracker

[issue44650] Move test_futures files*.py into a subdirectory of Lib/test

2021-07-16 Thread Irit Katriel
Irit Katriel added the comment: This kind of reorg was recently rejected in issue44573. -- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue15907] move doctest test-data files into a subdirectory of Lib/test

2021-07-16 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44636] It is possible to create a 1-type union type

2021-07-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c3007ab3c6cb384203bac8aa64d89c4b42f671a1 by Serhiy Storchaka in branch '3.10': [3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181) https://github.com/python/cpython/commit/c3007ab3c6cb384203bac8aa64d89c4b42f671a1 --

[issue44636] It is possible to create a 1-type union type

2021-07-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-16 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +25723 pull_request: https://github.com/python/cpython/pull/27187 ___ Python tracker ___ _

[issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 8ce3008585feed51bd08ec256a19923940d744d4 by Ammar Askar in branch 'main': bpo-44569: Decouple frame formatting in traceback.py (GH-27038) https://github.com/python/cpython/commit/8ce3008585feed51bd08ec256a19923940d744d4 -- resol

[issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary

2021-07-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-16 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +25724 pull_request: https://github.com/python/cpython/pull/27188 ___ Python tracker ___ _

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 6aab5f9bf303a8e4cd8377fabcdcb499e0541f9a by Weipeng Hong in branch 'main': bpo-40897:Give priority to using the current class constructor in `inspect.signature` (#27177) https://github.com/python/cpython/commit/6aab5f9bf303a8e4cd8377fabcdcb499e054

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +25725 pull_request: https://github.com/python/cpython/pull/27189 ___ Python tracker ___

[issue44652] Preserve natural order of args in the union type

2021-07-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0cd2d51aadcd2a0c0739a5df0a6235d64f35619e by Serhiy Storchaka in branch 'main': bpo-44652: Preserve natural order of args in the union type. (GH-27185) https://github.com/python/cpython/commit/0cd2d51aadcd2a0c0739a5df0a6235d64f35619e

[issue44638] zipfile.ZipFile is closed when zipfile.Path is closed

2021-07-16 Thread miss-islington
miss-islington added the comment: New changeset 29358e93f2bb60983271c14ce4c2f3eab35a60ca by Jason R. Coombs in branch 'main': bpo-44638: Add a reference to the zipp project and hint as to how to use it. (GH-27188) https://github.com/python/cpython/commit/29358e93f2bb60983271c14ce4c2f3eab35a6

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: We won't be backporting this fix to 3.9 due to larger changes between versions. -- versions: +Python 3.10, Python 3.11 ___ Python tracker ___ __

[issue44652] Preserve natural order of args in the union type

2021-07-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +25726 pull_request: https://github.com/python/cpython/pull/27190 ___ Python tracker ___

[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 7915c96ffd7ddc5cb6d54015ee4c31255a416892 by Łukasz Langa in branch 'main': bpo-44647: Add a permanent Unicode-valued env var to regrtest (#27187) https://github.com/python/cpython/commit/7915c96ffd7ddc5cb6d54015ee4c31255a416892 --

[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +25727 pull_request: https://github.com/python/cpython/pull/27191 ___ Python tracker ___ __

[issue44650] Move test_futures files*.py into a subdirectory of Lib/test

2021-07-16 Thread Leonardo Freua
Leonardo Freua added the comment: Definitely not the same kind of reorganization! In issue44573 what was proposed was the reorganization of the data files used in the tests. And what I'm proposing now is equivalent to what was proposed in issue15907 (and there it was accepted, there is even

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 948e39a866ccf33b4e30668c3f88a95a65966159 by Miss Islington (bot) in branch '3.10': bpo-40897:Give priority to using the current class constructor in `inspect.signature` (GH-27177) (#27189) https://github.com/python/cpython/commit/948e39a866ccf33b4

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

2021-07-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> import typing >>> T = typing.TypeVar('T') >>> (int | T)[typing.Union[str, list]] NotImplemented See also issue44633. But in this case the expected result is int | str | list or typing.Union[init, str, list]. -- components: Interpreter Core me

[issue44633] Indexing the union type can return NotImplemented

2021-07-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Expected raising a TypeError. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue42626] readline history, vi-editingmode and ANSI color codes bug

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: I can't reproduce on MacOS in both Py 3.9.1 and in dev version. Works fine, I can erase everything after '2' and before it. -- nosy: +andrei.avk ___ Python tracker

[issue44650] Move test_futures files*.py into a subdirectory of Lib/test

2021-07-16 Thread Irit Katriel
Irit Katriel added the comment: A patch awaiting review since 2012 is not exactly the same as "the issue was accepted". -- ___ Python tracker ___

[issue44652] Preserve natural order of args in the union type

2021-07-16 Thread miss-islington
miss-islington added the comment: New changeset 80844d1ebc03e1cf3ffdeb47751522499e90b0bc by Serhiy Storchaka in branch '3.10': [3.10] bpo-44652: Preserve natural order of args in the union type. (GH-27185) (GH-27190) https://github.com/python/cpython/commit/80844d1ebc03e1cf3ffdeb47751522499e

[issue44652] Preserve natural order of args in the union type

2021-07-16 Thread Ken Jin
Change by Ken Jin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: Why do you think OSError fits here? Since objects provided on the command line by definition cannot have source code files, the problem isn't that the file is missing or inaccessible. Rather, the value provided to getsource() is wrong. So, in my view, this shou

[issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 93d36a5bcec8e55026b9a749c8310b1ce490d15e by Miss Islington (bot) in branch '3.10': bpo-44647: Add a permanent Unicode-valued env var to regrtest (GH-27187) (#27191) https://github.com/python/cpython/commit/93d36a5bcec8e55026b9a749c8310b1ce490d15e

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: Łukasz: Thanks for looking at this! - I agree OSError is not ideal, but I chose it because it's consistent with how inspect reports similar errors. For example, see all instances of OSError, except for first, in this function: https://github.com/python/cpy

[issue44642] Union of a type and the typing module function

2021-07-16 Thread Guido van Rossum
Guido van Rossum added the comment: I think making NewType into a class isn't a good idea, it would be too slow. But I like issue34963 (PR 9951). So then let's do some variation on (3) -- unionable things would include all types (of course), typevars, and things that have a special attribute

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: On second thought it's a bummer not to fix this in 3.9.x that will still be the only stable version until October. I'll refactor the relevant part of inspect.py in 3.9 to make the backport applicable. -- ___ Python t

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm not sure though how is the unit test succeeding since the test module should have __file__ set. Looking into it.. -- ___ Python tracker

[issue44654] Refactor and clean up the union type implementation

2021-07-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : I started reviewing and rewriting Objects/unionobject.c several weeks ago. Some discovered bugs were reported and fixed in separate issues: issue44606, issue44632, issue44635, issue44636, issue44646, issue44652. Before fixing the remaining bugs (issue446

[issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor

2021-07-16 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +25728 pull_request: https://github.com/python/cpython/pull/27193 ___ Python tracker ___ _

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: This is kind of interesting: - The unit test was wrong, it was catching the wrong OSError. (I was catching regex first but after some tweaking and changes I lost it and forgot to readd) - The reason it was passing is exactly what you pointed out -- the __m

[issue44654] Refactor and clean up the union type implementation

2021-07-16 Thread Ken Jin
Ken Jin added the comment: > I am going to backport these changes to 3.10 to make backporting of future > fixes easier. > * Move declarations of _Py_make_parameters and _Py_subs_parameters ... Unfortunately, _Py_make_parameters and _Py_subs_parameters are 3.11 only. They were part of https:/

[issue20201] Argument Clinic: rwbuffer support broken

2021-07-16 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: New changeset 9af34c935185eca497617a216d141c72ffaeae9c by Batuhan Taskaya in branch 'main': bpo-20201: variadic arguments support for AC (GH-18609) https://github.com/python/cpython/commit/9af34c935185eca497617a216d141c72ffaeae9c -- nosy: +BTaskaya

[issue20201] Argument Clinic: rwbuffer support broken

2021-07-16 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- Removed message: https://bugs.python.org/msg397638 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue44654] Refactor and clean up the union type implementation

2021-07-16 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: PR 27167 hangs or fails. in the refleak buildbots, so I am going to proceed to revert -- resolution: fixed -> status: closed -> open ___ Python tracker

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +25729 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27194 ___ Python tracker ___ ___

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: To reproduce the problem: ./python -m test test_threading -R : - -- ___ Python tracker ___ __

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg397640 ___ Python tracker ___ ___ Python-bugs-list

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: To reproduce the problem: $./python -m test test_threading -R : -v ... test_original_excepthook (test.test_threading.ExceptHookTests) ... ok test_system_exit (test.test_threading.ExceptHookTests) ... ok test_can_interrupt_tight_loops (test.test_thread

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c90c591e5158ab7b531dcd6e2a5f00bc70ba7637 by Pablo Galindo Salgado in branch 'main': Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (#27194) https://github.com/python/cpython/commit/c90c591e5158ab7b531dcd6e2a

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25730 pull_request: https://github.com/python/cpython/pull/27195 ___ Python tracker _

[issue44654] Refactor and clean up the union type implementation

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

[issue44645] Python 3.10: Under some trivial circunstances, GIL not released

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 42a5514cca6b4542f6b492b5652e337f15a89227 by Miss Islington (bot) in branch '3.10': Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (GH-27194) (#27195) https://github.com/python/cpython/commit/42a5514cca6b4542

[issue44654] Refactor and clean up the union type implementation

2021-07-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Yeah I noticed it re-lookups __module__ unnecessarily multiple times for the > same type. Actually I thought about this change, but did not implement it. Because it does not look performance critical, and future versions will likely do different tests (

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

2021-07-16 Thread Mark Dickinson
Mark Dickinson added the comment: Agreed that "of the same type" part is confusing. I suspect the intended meaning was that the operation *expects* both arguments to have the same type, so if the actual arguments have different types then they have to be coerced to a common type. In the exam

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

2021-07-16 Thread Mark Dickinson
Mark Dickinson added the comment: Searching further, none of the uses of "coerce" or "coercion" in the docs seem to be a good match for the definition in this glossary entry. For example, from ipaddress.rst: > By default, attempting to create a network object with host bits set will result i

[issue44631] Refactoring the repr() of the _Environ class (os module)

2021-07-16 Thread Éric Araujo
Éric Araujo added the comment: Hello! I’ve seen your name on a few recent tickets, thanks for contributing and welcome here! In general, the CPython project doesn’t do esthetic code changes for their own sake. Not all code is changed from %-formatting when format is added, not all code us

[issue44629] Some files from distutils module are importing all exceptions unnecessarily

2021-07-16 Thread Éric Araujo
Éric Araujo added the comment: distutils is a special case in the standard library: complicated code with even private helpers used by code in the wild, so we are extra careful when changing things in there. But I should say it used to be special, and we used to be careful: setuptools copied

[issue10572] Move test sub-packages to Lib/test

2021-07-16 Thread Brett Cannon
Brett Cannon added the comment: > After so long a reason came up that prevents the movement of tests of ctypes, > lib2to3, and idlelib (which even continues in the same folder, only the > nomenclature was changed)? Time and energy. -- ___ Python

[issue44624] Script name for venv PowerShell activate

2021-07-16 Thread Éric Araujo
Change by Éric Araujo : -- components: +Library (Lib) -Installation nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list ma

[issue44628] Remove the broken link for issue #445902 in unixcompiler.py (distutils)

2021-07-16 Thread Éric Araujo
Éric Araujo added the comment: distutils is being removed, see https://bugs.python.org/issue41282 -- nosy: +eric.araujo resolution: -> out of date stage: patch review -> resolved status: open -> closed versions: -Python 3.11 ___ Python tracker

[issue42581] Docs site redirection doesn't work for 3.9

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: It works for me (the first link) -- I think this can be closed. -- nosy: +andrei.avk ___ Python tracker ___ _

[issue44655] Confusing error with __slots__

2021-07-16 Thread Eric V. Smith
New submission from Eric V. Smith : This is related to issue 44649. This is the simplest non-dataclasses case I could come up with. Given: class Example: __slots__ = ('a', 'b') def __init__(self, a): self.a = a obj = Example(42) print(obj.b) I get this in 3.10 and main: Tra

[issue44649] dataclasses slots with init=False field raises AttributeException

2021-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: I created issue 44655 for the confusing error message. The problem with dataclasses is that the instance variable 'b' needs to be initialized, instead of the current dataclasses behavior where it relies on the class variable when reading 'b'. -- ___

[issue44655] Confusing error with __slots__

2021-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: Also, the dot after the first 'b' was confusing to me: I thought it had something to do with an attribute of b. And the quotes around the second 'b' were also confusing, but that's mostly because the original example initialized a class variable named 'b' wit

[issue44656] Dangerous mismatch between MAXPATHLEN and MAX_PATH on Windows

2021-07-16 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : In PC/getpathp.c CPython uses buffers with length MAXPATHLEN+1, which is 257 on Windows[1]. On Windows 7, where PathCch* functions are not available, CPython <= 3.8 fallbacks to PathCombineW()/PathCanonicalizeW()[2]. Those functions assume that the destin

[issue44655] Confusing error with __slots__

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: For attribute errors we just call dir() on the object and we do a suggestion based on the names so if a name appears in the dir() then we will consider it for the suggestion. -- ___ Python tracker

[issue44655] Confusing error with __slots__

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Maybe don't print the "Did you mean" part if the suggestion is the same as > the requested attribute? I think this is a good idea and will take care of many other similar cases. Thanks for the suggestion, Eric! I will prepare a PR -- _

[issue44655] Confusing error with __slots__

2021-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: It's obviously not super important, but it would be nicer if the version with the suggestion were more like the version without the suggestion. Specifically, mentioning the object type: >>> class E: ... __slots__=('a') ... >>> E().a Traceback (most recent

[issue44655] Confusing error with __slots__

2021-07-16 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, Pablo! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro

2021-07-16 Thread Sam Gross
New submission from Sam Gross : The instancemethod_call function should use the PyInstanceMethod_GET_FUNCTION macro instead of the PyMethod_GET_FUNCTION macro. The current code is incorrect, but still works okay (doesn't crash) because PyInstanceMethodObject.func is at the same offset as PyM

[issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro

2021-07-16 Thread Sam Gross
Change by Sam Gross : -- type: enhancement -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue44629] Some files from distutils module are importing all exceptions unnecessarily

2021-07-16 Thread Leonardo Freua
Leonardo Freua added the comment: Hi Éric, thanks for the info. I'm still learning about all the processes and how things work around here in order to avoid opening issues that no longer make sense. Thanks you again. -- ___ Python tracker

[issue44655] Confusing error with __slots__

2021-07-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +25732 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27197 ___ Python tracker __

[issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match

2021-07-16 Thread Jack DeVries
New submission from Jack DeVries : Consider the following code: class A: a = 'a' # runs without error match {'a': 1}: case {'a': 1, A.a: 1}: pass # raises ValueError match {'a': 1, 'b': 1}: case {'a': 1, A.a: 1}: pass In both cases, the mapping pattern is the same

[issue44655] Confusing error with __slots__

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > it would be nicer if the version with the suggestion were more like the > version without the suggestion Agreed, but that is actually not related with the suggestions. We only append a string at the end of whatever exception it was there. This diffe

[issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match

2021-07-16 Thread Jack DeVries
Jack DeVries added the comment: Another option if this problem is isolated to mapping patterns, we could introduce a new op-code: BUILD_MATCH_MAP, which is essentially a wrapper around BUILD_MAP that disallows duplicate key values. -- ___ Python t

[issue10551] mimetypes read from the registry should not overwrite standard mime mappings

2021-07-16 Thread Shane Harvey
Shane Harvey added the comment: This issue says "mimetypes read from the registry should not overwrite standard mime mappings". Was this change ever made? the following issue claims that the "HKEY_CLASSES_ROOT\.js\Content Type" registry can still overrides ".js" files: https://bugs.python.or

[issue43950] Include column offsets for bytecode instructions

2021-07-16 Thread Ammar Askar
Ammar Askar added the comment: As reported by Will McGugan on twitter: Printing may be wrong for some unicode characters like: Traceback (most recent call last): File "test.py", line 1, in x = ("该" / 0) + (1 / 2) ~~^ TypeError: unsupported operand type(s) for /: 'str' and

[issue43950] Include column offsets for bytecode instructions

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ah, this is our friend _PyPegen_byte_offset_to_character_offset. I am glad we refactor it to be used by the Parser and the traceback mechanism. Ammar, would you like to take a look? -- ___ Python tracker <

[issue44655] Confusing error with __slots__

2021-07-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 6714dec5e104bdee4a0ed4d9966de27d1bfa1e3d by Pablo Galindo Salgado in branch 'main': bpo-44655: Don't include suggestions for attributes that are the same as the missing one (GH-27197) https://github.com/python/cpython/commit/6714dec5e104

[issue43950] Include column offsets for bytecode instructions

2021-07-16 Thread Ammar Askar
Ammar Askar added the comment: Aah, I won't have time to investigate until Monday. I'll take a look then unless someone gets to it first :) -- ___ Python tracker ___

  1   2   >