[issue43741] http.client leaks from self.fp.read()

2021-04-07 Thread Hynek Petrak
Hynek Petrak added the comment: The leak does not seem to occure, when I use ret = r.read(1).decode('utf-8') instead. -- ___ Python tracker ___ ___

[issue5758] fileinput.hook_compressed returning bytes from gz file

2021-04-07 Thread Inada Naoki
Change by Inada Naoki : -- versions: +Python 3.10 -Python 3.2, Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue43759] StreamHandler does not print to sys.stderr immediately

2021-04-07 Thread Nguyen Thai Binh
New submission from Nguyen Thai Binh : When logger.exception() is called in a `catch` clause, it never logs to sys.stderr immediately. Sometimes it only outputs when the program almost finishes. I don't know how to reproduce as it is occasional. Attached is the logging configuration for my pr

[issue43759] StreamHandler does not print to sys.stderr immediately

2021-04-07 Thread Nguyen Thai Binh
Nguyen Thai Binh added the comment: I have managed to solve this by flushing the buffer. So issue closed. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker __

[issue43220] Argparse: Explicit default required arguments with add_mutually_exclusive_group are rejected

2021-04-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll review this but it may take a little while to get to it. -- assignee: -> rhettinger nosy: +paul.j3, rhettinger ___ Python tracker __

[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-04-07 Thread Michael Felt
Michael Felt added the comment: Willing to spend more time on this - but the variable names chosen blind me - looks like a circle. And, thinking about the address in the core dump starting with 0xd (segment 13) - confuses me somewhat - as from memory - I thought the shared library code/data

[issue43244] Move PyArena C API to the internal C API

2021-04-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23982 pull_request: https://github.com/python/cpython/pull/25242 ___ Python tracker ___ __

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: For any sane design of tagged pointers, `x == y` (in C) will work fine. `is` is not well defined except for a small set of values, so the docs for `Py_Is` would have to so vague as to be worthless, IMO. -- nosy: +Mark.Shannon _

[issue40228] Make setting line number in frame more robust.

2021-04-07 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue39537] Change line number table format

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: PEP 626 fixed this -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue39537] Change line number table format

2021-04-07 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-07 Thread Mark Shannon
New submission from Mark Shannon : The DISPATCH() macro has two failings. 1. Its check for tracing involves too much pointer chaser. 2. The logic assumes that computed-gotos is the "fast path" which makes switch dispatch, and therefore Python on Windows unnecessarily slow. -- message

[issue43244] Move PyArena C API to the internal C API

2021-04-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23983 pull_request: https://github.com/python/cpython/pull/25243 ___ Python tracker ___ __

[issue31861] add aiter() and anext() functions

2021-04-07 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue5758] fileinput.hook_compressed returning bytes from gz file

2021-04-07 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue43760] The DISPATCH() macro is not as efficient as it could be.

2021-04-07 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +23984 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25244 ___ Python tracker ___ ___

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: > For any sane design of tagged pointers, `x == y` (in C) will work fine. I wrote a proof-of-concept for using tagged pointners in CPython: https://github.com/vstinner/cpython/pull/6 "The PR is large because of the first changes which add Py_IS_NONE(), Py_IS

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: > Also, there is too much faith in functions marked as "inline" always being > inlined. I proposed to declare it as a "static inline" function, but I'm fine with a macro as well. I mostly care about the API: call "Py_Is()", not really about the exact implem

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Adrian Freund
New submission from Adrian Freund : PEP 634 structural pattern matching adds an auto-generated __match_args__ attribute to classes with the dataclass decorator and to namedtuples. This change is currently not documented in the dataclass and namedtuple documentation, nor is it mentioned in PEP

[issue43762] Add audit events for loading of sqlite3 extensions

2021-04-07 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : If Python is configured with --enable-loadable-sqlite-extensions, it is possible to load third party SQLite extensions (shared libraries/DLL’s) via the sqlite3 extension module. When enabled, the sqlite3.Connection.enable_load_extension() class meth

[issue43075] ReDoS in urllib.request

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: > header = '' + ',' * (10 ** 5) I guess that a more generic protection against future attacks would be to limit the maximum length of a HTTP header. 100,000 characters for a HTTP Basic authentification does not sound reasonable. But for now, let's fix the r

[issue43244] Move PyArena C API to the internal C API

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset d36d6a9c1808e87628ebaa855d4bec80130189f4 by Victor Stinner in branch 'master': bpo-43244: Remove Yield macro from pycore_ast.h (GH-25243) https://github.com/python/cpython/commit/d36d6a9c1808e87628ebaa855d4bec80130189f4 -- ___

[issue43762] Add audit events for loading of sqlite3 extensions

2021-04-07 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +23985 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25246 ___ Python tracker _

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue43075] ReDoS in urllib.request

2021-04-07 Thread yeting li
yeting li added the comment: For a regex has polynomial worst-case complexity, limiting the maximum input length is indeed a very effective method. As shown below, as the input length becomes smaller, the matching time becomes significantly smaller. header = '' + ',' * (10 ** 4)1.617s h

[issue43164] test_nntplib.NetworkedNNTP_SSLTests fails on "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot

2021-04-07 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: The issue seems to be resolved and the buildbot is green. -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker ___

[issue43075] ReDoS in urllib.request

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: redos_python2.py: Updated benchmark. I confirm that PR 24391 fix a worst case performance, starting with 100 characters. Since the complexity is quadratic, strings longer 10^4 characters are likely to hang a client for several minutes. == Reference (vulner

[issue43075] ReDoS in urllib.request

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

[issue43075] ReDoS in urllib.request

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7215d1ae25525c92b026166f9d5cac85fb1defe1 by Yeting Li in branch 'master': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) https://github.com/python/cpython/commit/7215d1ae25525c92b026166f9d5cac85fb1defe1 --

[issue43075] ReDoS in urllib.request

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

[issue43075] ReDoS in urllib.request

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

[issue43075] ReDoS in urllib.request

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

[issue40038] pathlib: remove partial support for preserving accessor when modifying a path

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-04-07 Thread Steve Dower
Steve Dower added the comment: New changeset 0af99b44edf559305def22b2d68be685ce50d7f6 by Steve Dower in branch '3.9': bpo-43105: Importlib now resolves relative paths when creating module spec objects from file locations (GH-25121) https://github.com/python/cpython/commit/0af99b44edf559305de

[issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension()

2021-04-07 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : Quoting from the SQLite docs: "It is recommended that extension loading be enabled using the SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION method rather than this interface, so the load_extension() SQL function remains disabled. This will prevent SQL injec

[issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 ___ Python tracker ___ __

[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-04-07 Thread Steve Dower
Steve Dower added the comment: Just needs the 3.8 backport - will get to that later tonight. -- stage: patch review -> backport needed ___ Python tracker ___ _

[issue43756] About updating audit events when function gains new arguments

2021-04-07 Thread Steve Dower
Steve Dower added the comment: To remove an event, it needs to be deprecated as any public facing feature would be deprecated. I'm not sure how we'd go about publicising it though. There's currently no way to raise a warning, so it'd just have to be very clearly advertised in documentation (

[issue43075] ReDoS in urllib.request

2021-04-07 Thread miss-islington
miss-islington added the comment: New changeset e7654b6046090914a8323931ed759a94a5f85d60 by Miss Islington (bot) in branch '3.8': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) https://github.com/python/cpython/commit/e7654b6046090914a8323931ed759a94a5f85d60 --

[issue43759] StreamHandler does not print to sys.stderr immediately

2021-04-07 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: fixed -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue43244] Move PyArena C API to the internal C API

2021-04-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23990 pull_request: https://github.com/python/cpython/pull/25252 ___ Python tracker ___ __

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Eric V. Smith
Eric V. Smith added the comment: Turning off the generation of __match_args__ should be a separate issue. -- ___ Python tracker ___ ___

[issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension()

2021-04-07 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > We could add an optional argument for also enabling the SQL function. Actually, using sqlite3_db_config(SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, ...) can only enable the C API, not the SQL API, so adding an optional argument to sqlite3.enable_load_ex

[issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension()

2021-04-07 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > Suggesting to make sqlite3.Connection.enable_load_extension a module level > function This actually needs to be a sqlite3.Connection method, thus altering the behaviour of the current function. -- ___ P

[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-07 Thread Adrian Freund
New submission from Adrian Freund : The dataclass decorator can take multiple parameters to enable or disable the generation of certain methods. PEP 634 Structural Pattern Matching extends dataclasses to also generate a __match_args__ attribute. I think adding a parameter to enable and disab

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Adrian Freund
Adrian Freund added the comment: Ok. I created https://bugs.python.org/issue43764 for that. -- ___ Python tracker ___ ___ Python-bu

[issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension()

2021-04-07 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Attached patch alters the behaviour of sqlite3.Connection.enable_load_extension() to never enabling the SQL API. This may require a deprecation period and a warning since it's a change in behaviour, but since enable_load_extention() is not enabled by

[issue43765] Add support for the RFC5705 SSL_export_keying_material function

2021-04-07 Thread Christer Weinigel
New submission from Christer Weinigel : OpenSSL has a function to "SSL_export_keying_material" as described in RFC5705. This function is needed to be able to support a bunch of other protocols such as "Network Time Security for the Network Time Protocol" defined in RFC8915 and half a dozen

[issue43765] Add support for the RFC5705 SSL_export_keying_material function

2021-04-07 Thread Christer Weinigel
Change by Christer Weinigel : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyt

[issue37952] Add support for export_keying_material to SSL library

2021-04-07 Thread Christer Weinigel
Christer Weinigel added the comment: OpenSSL has a function to "SSL_export_keying_material" as described in RFC5705. This functionality is needed to be able to support a bunch of other protocols such as "Network Time Security for the Network Time Protocol" which has now become a proper RFC

[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-07 Thread Eric V. Smith
Eric V. Smith added the comment: What's the situation where having __match_args__ is actually harmful in some way? I understand that if the generated version is wrong, you'd want to specify it yourself. But what's the use case for not having __match_args__ at all? -- assignee: -> er

[issue37952] Add support for export_keying_material to SSL library

2021-04-07 Thread Christer Weinigel
Change by Christer Weinigel : -- keywords: +patch pull_requests: +23991 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25255 ___ Python tracker __

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: Just chiming in to say that for PyPy this API would be extremely useful, because PyPy's "is" is not implementable with a pointer comparison on the C level (due to unboxing we need to compare integers, floats, etc by value). Right now, C extensio

[issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py

2021-04-07 Thread Ken Jin
New submission from Ken Jin : PEP 647 was recently accepted by the SC: https://mail.python.org/archives/list/[email protected]/thread/2ME6F6YUVKHOQYKSHTVQQU5WD4CVAZU4/ I'd like to work on the implementation for typing.py and any required docs later on (unless someone is already working on

[issue43495] Missing frame block push in compiler_async_comprehension_generator()

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: New changeset 7a7ba3d343d360a03a34bc3901628f9f40a58307 by tomKPZ in branch 'master': bpo-43495 : Push missing frame block in compile.c (GH-24865) https://github.com/python/cpython/commit/7a7ba3d343d360a03a34bc3901628f9f40a58307 -- nosy: +Mark.Shannon

[issue43751] await anext() returns None when default is given

2021-04-07 Thread PEW's Corner
PEW's Corner added the comment: Regarding the custom async iterator, I don't know if this is the problem you're referring to, but the following code seems to terminate abruptly when running main2() (main1() is fine). This is without your changes, though. import asyncio class CustomAsyncIter

[issue43244] Move PyArena C API to the internal C API

2021-04-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23992 pull_request: https://github.com/python/cpython/pull/25256 ___ Python tracker ___ __

[issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`

2021-04-07 Thread Steve Dower
Steve Dower added the comment: New changeset abf964942f97f6489360a75fd57b5e4f41c75f57 by Barney Gale in branch 'master': bpo-39906: Add follow_symlinks parameter to pathlib.Path.stat() and chmod() (GH-18864) https://github.com/python/cpython/commit/abf964942f97f6489360a75fd57b5e4f41c75f57

[issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-07 Thread Shreyan Avigyan
Change by Shreyan Avigyan : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue42999] `pathlib.Path.link_to()` documentation is misleading

2021-04-07 Thread Steve Dower
Steve Dower added the comment: New changeset 8aac1bea2eeac25a49f8912b67aacbedf9bc7934 by Barney Gale in branch 'master': bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294) https://github.com/python/cpython/commit/8aac1bea2eeac25a49f8912b67aacbedf9bc7934 -

[issue43075] ReDoS in urllib.request

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset a21d4fbd549ec9685068a113660553d7f80d9b09 by Miss Islington (bot) in branch '3.9': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) (GH-25247) https://github.com/python/cpython/commit/a21d4fbd549ec9685068a113660553d7f80d9b09 -

[issue43723] Deprecate camelCase aliases from threading.py

2021-04-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Just to add the last time isAlive was removed in favor of is_alive it was significant change enough that several libraries in Fedora packaging Python libraries and other open source code. The GitHub PR shows several projects that were affected and

[issue43220] Argparse: Explicit default required arguments with add_mutually_exclusive_group are rejected

2021-04-07 Thread paul j3
paul j3 added the comment: An overlapping issue https://bugs.python.org/issue18943 argparse: default args in mutually exclusive groups That issue shows that this problem arises with small integers as well (<257), which in cpython have unique ids. It's an implementation detail, pypy for exam

[issue43244] Move PyArena C API to the internal C API

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: typed-ast was updated for these changes and to avoid including explicitly pydebug.h (it's included by Python.h: see bpo-35134 change): https://github.com/python/typed_ast/pull/158 -- ___ Python tracker

[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-04-07 Thread Steve Dower
Steve Dower added the comment: The 3.8 backport is much more complicated, as we don't have access to the PathSkipRoot function there. So we can't use the native function. There's probably another way to implement the fix for 3.8, but I'm leaving that for another day. Feel free to chime in wi

[issue42999] `pathlib.Path.link_to()` documentation is misleading

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +23993 pull_request: https://github.com/python/cpython/pull/25257 ___ Python tracker ___ _

[issue39659] pathlib calls `os.getcwd()` without using accessor

2021-04-07 Thread Steve Dower
Steve Dower added the comment: New changeset b05440c52b9814dbd47f679d47367e87855bd7b5 by Barney Gale in branch 'master': bpo-39659: Route calls from pathlib.Path to os.getcwd() via the path accessor (GH-18834) https://github.com/python/cpython/commit/b05440c52b9814dbd47f679d47367e87855bd7b5

[issue43716] curses.pair_number() function incorrect value under Windows

2021-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The curses module is not supported on Windows. windows-curses is a third-party library. Use the corresponding bug tracker to report an issue with windows-curses. -- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: ope

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-04-07 Thread Ethan Furman
Ethan Furman added the comment: Mark, it looks like the consensus is your proposal: "The implementation is allowed to skip any boolean test of a value, when it has *no* effect on the flow of the program and *at least one test* has already been performed on that value." Has the implementatio

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-04-07 Thread Steve Dower
Steve Dower added the comment: I think this is worth unifying, but I'm concerned about making expanduser() return the original path on Windows - "~name" is a valid filename/relative path, and so code that does mkdir(expanduser("~nonuser/dir")) could create garbage in the current directory. I

[issue42999] `pathlib.Path.link_to()` documentation is misleading

2021-04-07 Thread Steve Dower
Steve Dower added the comment: New changeset 34f93002bac980176a670ce2a4038c3be84effed by Steve Dower in branch '3.9': bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294) https://github.com/python/cpython/commit/34f93002bac980176a670ce2a4038c3be84effed --

[issue42999] `pathlib.Path.link_to()` documentation is misleading

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +23994 pull_request: https://github.com/python/cpython/pull/25258 ___ Python tracker ___ _

[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

2021-04-07 Thread Mark Shannon
Mark Shannon added the comment: I implemented it ages ago :) https://github.com/python/cpython/pull/24417 I need to be better at closing issues. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-04-07 Thread Barney Gale
Barney Gale added the comment: Thanks for taking a look, Steve. A couple things maybe worth noting: Firstly, `os.path.expanduser()` is already documented to return the path unchanged if the home directory can't be resolved: > If the expansion fails or if the path does not begin with a tilde

[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-07 Thread Brandt Bucher
Brandt Bucher added the comment: I agree with Eric. You can already disable the automatic creation of __match_args__ by setting it yourself on the class being decorated, and "__match_args__ = ()" will make the class behave the exact same as if __match_args__ is not defined at all. >>> from

[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-07 Thread Brandt Bucher
Brandt Bucher added the comment: > Note that setting compare=False on a dataclass.field already excludes that > field from __match_args__... It appears you did find a genuine bug though! I was surprised by this comment, and after digging a bit deeper into _process_class found that we should

[issue18861] Problems with recursive automatic exception chaining

2021-04-07 Thread Irit Katriel
Irit Katriel added the comment: For the issue of which contexts need to be suppressed when __suppress_context__ is true, I think we don't need to keep the whole tree of exceptions. It might be enough to save the dynamic "nesting depth of the try-excepts". Here is a solution with two integer

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Just chiming in to say that for PyPy this API would be extremely useful Thanks for that input. Given that there would be some value add, I withdraw my objection. > I proposed to declare it as a "static inline" function, > but I'm fine with a macro as we

[issue43761] Documenting dataclass and namedtuple changes for structural pattern matching

2021-04-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > This change is currently not documented in the dataclass > and namedtuple documentation, I don't think we need to do that. In the end, __match_args__ will be added in many places. The right place to document it is in the pattern matching docs. ---

[issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py

2021-04-07 Thread Guido van Rossum
Guido van Rossum added the comment: Go for it! I assume that this will be pretty simple, right? TypeGuard[X] should show up in __annotations__ as exactly that. It can be implemented in pure Python. -- ___ Python tracker

[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-07 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue43755] lambda expression no longer valid at comp_if in Python 3.9

2021-04-07 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset f91fc7a679e076cb9a703f6db4d95b63935562e3 by Miss Islington (bot) in branch '3.9': bpo-43755: Update docs to reflect that lambda is not allowed in `comp_if` since 3.9 (GH-25231) (GH-25233) https://github.com/python/cpython/commit/f91fc7a6

[issue42999] `pathlib.Path.link_to()` documentation is misleading

2021-04-07 Thread Steve Dower
Steve Dower added the comment: New changeset 9f578734624d1c0172220556ca97898730144172 by Steve Dower in branch '3.8': bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294) https://github.com/python/cpython/commit/9f578734624d1c0172220556ca97898730144172 --

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2021-04-07 Thread Steve Dower
Steve Dower added the comment: > Firstly, `os.path.expanduser()` is already documented to return the path > unchanged if the home directory can't be resolved: Ah, too bad. Doesn't prevent us from changing it, but hopefully it means that everyone using it is already checking the result and no

[issue39659] pathlib calls `os.getcwd()` without using accessor

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue42999] `pathlib.Path.link_to()` documentation is misleading

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue43767] Compiler arning about 'Yield' macro redefinition on Windows

2021-04-07 Thread Guido van Rossum
New submission from Guido van Rossum : When building from scratch on Windows I get this warning: c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\winbase.h(103): warning C4005: 'Yield': macro redefinition [C:\Users\gvanrossum\cpython\PCbuild\pythoncore.vcxproj] I know there is

[issue43767] Compiler arning about 'Yield' macro redefinition on Windows

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: This issue should be fixed: commit d36d6a9c1808e87628ebaa855d4bec80130189f4 Author: Victor Stinner Date: Wed Apr 7 13:01:09 2021 +0200 bpo-43244: Remove Yield macro from pycore_ast.h (GH-25243) * pycore_ast.h no longer defines the Yield macro.

[issue43767] Compiler arning about 'Yield' macro redefinition on Windows

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: Fixing this super annoying Yield warning was one of my motivation for moving Python-ast.h to the internal C API (pycore_ast.h) :-D I disliked that Python-ast.h defined tons of symbols without "Py" (or "_Py") prefix: commit 94faa0724f8cbae6867c491c8e465e35f4f

[issue43764] Turning off generation of __match_args__ for dataclasses

2021-04-07 Thread Guido van Rossum
Guido van Rossum added the comment: I assume the OP wants to have a class that doesn't allow positional patterns. The right way to spell that is indeed to add __match_args__ = () to the class, there's no need to add another flag to @dataclass. -- resolution: -> rejected stage:

[issue43767] Compiler arning about 'Yield' macro redefinition on Windows

2021-04-07 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! Dup of bpo-43244. -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ ___

[issue36540] PEP 570: Python Positional-Only Parameters

2021-04-07 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 58d72cab89cf9652acc0bf0007aa20b2bcc98499 by Saiyang Gou in branch 'master': bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) https://github.com/python/cpython/commit/58d72cab89cf9652acc0bf0007a

[issue36540] PEP 570: Python Positional-Only Parameters

2021-04-07 Thread Saiyang Gou
Change by Saiyang Gou : -- pull_requests: +23995 pull_request: https://github.com/python/cpython/pull/25259 ___ Python tracker ___ _

[issue43768] Possible race condition on multiprocessing.Manager().dict() on macOS

2021-04-07 Thread Jerry Chen
New submission from Jerry Chen : I am not sure if this is a bug or an expected case. Long story short, I tried to print the content of a `multiprocessing.Manager().dict()` in the main thread, but I got a strange error. I encountered this error only when the number of pools is rather large (>

[issue36540] PEP 570: Python Positional-Only Parameters

2021-04-07 Thread Saiyang Gou
Change by Saiyang Gou : -- pull_requests: +23996 pull_request: https://github.com/python/cpython/pull/25260 ___ Python tracker ___ _

[issue37609] support "UNC" device paths in ntpath.splitdrive

2021-04-07 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +23997 pull_request: https://github.com/python/cpython/pull/25261 ___ Python tracker ___ _

[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-04-07 Thread STINNER Victor
STINNER Victor added the comment: PR 25227: I reimplemented Py_Is() as a macro and I added unit tests. Other added functions simply call Py_Is(), example: #define Py_IsNone(x) Py_Is(x, Py_None) -- ___ Python tracker

[issue36540] PEP 570: Python Positional-Only Parameters

2021-04-07 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 4554ab435727a0f3b6441c9c1a8d3fe6534433c7 by Saiyang Gou in branch '3.8': [3.8] bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) (GH-25260) https://github.com/python/cpython/commit/4554ab435727a

[issue36540] PEP 570: Python Positional-Only Parameters

2021-04-07 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 3b1cf202976d9590d5b453c47b883f2e7cd1a7a5 by Saiyang Gou in branch '3.9': [3.9] bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) (GH-25259) https://github.com/python/cpython/commit/3b1cf202976d9

  1   2   >