[issue43785] Remove RLock from BZ2File

2021-04-11 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +24086 pull_request: https://github.com/python/cpython/pull/25351 ___ Python tracker ___

[issue43785] Remove RLock from BZ2File

2021-04-11 Thread Inada Naoki
Inada Naoki added the comment: New changeset cc2ffcdfd78df3a18edae60df81b2f1b044b1634 by Inada Naoki in branch 'master': bpo-43785: Improve BZ2File performance by removing RLock (GH-25299) https://github.com/python/cpython/commit/cc2ffcdfd78df3a18edae60df81b2f1b044b1634 --

[issue43810] os.path.abspath returns invalid path (resolves symbolic link)

2021-04-11 Thread Eryk Sun
Eryk Sun added the comment: In POSIX, os.path.abspath(p) is normpath(join(os.getcwd(), p)). normpath() doesn't touch the filesystem, and it's documented that its "string manipulation may change the meaning of a path that contains symbolic links". You can use os.path.realpath() to resolve

[issue41515] typing.get_type_hints generates KeyError

2021-04-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I guess more libraries will experience this with `from __future__ import annotations` becoming default in Python 3.10 and they switch to get_type_hints. https://github.com/sphinx-doc/sphinx/issues/8084

[issue43810] os.path.abspath returns invalid path (resolves symbolic link)

2021-04-11 Thread Rene Visser
New submission from Rene Visser : According to the python documentation os.path.abspath() does *not* resolve symbolic links. This however does not always seem to be true causing an invalid path return by abspath. This could potentially be exploited to crash python applications. Example for

[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-11 Thread hai shi
hai shi added the comment: I created PR 25226. It's a another way to solve this problem. Compared to PR 15175, `_set_sentinel()` don't need to receive any params :) -- ___ Python tracker

[issue42248] Raised exception in Enum keeping user objects alive unnecessarily

2021-04-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +24085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25350 ___ Python tracker ___

[issue42454] Move slice creation to the compiler for constants

2021-04-11 Thread Andrei Kulakov
Andrei Kulakov added the comment: One possibility for this being a breaking change is this scenario: some codebase may have logic that takes a list and uses a slice operation on it; in a rare circumstance the list is really a dict and a TypeError is caught upstream and dealt with; with this

[issue43744] enum: Adding a member named _classname__ raises IndexError

2021-04-11 Thread Ethan Furman
Ethan Furman added the comment: It should not be an error at all, but a False result. PR created. -- assignee: -> ethan.furman ___ Python tracker ___

[issue43744] enum: Adding a member named _classname__ raises IndexError

2021-04-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +24084 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25349 ___ Python tracker ___

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-11 Thread Eryk Sun
Eryk Sun added the comment: > My opinion is that no extra flags are necessary. The default of > deleting on close is fine, unless a context manager is active -- in > which case delete on CM exit. There is a use case of needing to let another thread or process open the temporary file while

[issue28708] Low FD_SETSIZE limit on Windows

2021-04-11 Thread Alan
Alan added the comment: The big innovation with poll() is that it takes an array of descriptors like a normal function. https://www.geometrydash.me/ -- nosy: +alanpreston ___ Python tracker

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-11 Thread Ma Lin
Ma Lin added the comment: > I don't really _like_ that this is a .h file acting as a C template to inject > effectively the same static code into each module that wants to use it... > Which I think is the concern Victor is expressing in a comment above. I think so too. The defines of

[issue34309] Trouble when reloading extension modules.

2021-04-11 Thread Shakeeb Alireza
Shakeeb Alireza added the comment: In my project (https://github.com/shakfu/py-js), which provides an embedded python3 interpreter to Max/MSP in the form of an 'external' plugin, I have faced similar issues of being unable to reload extension modules, namely numpy, without reliably crashing

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-11 Thread Ethan Furman
Ethan Furman added the comment: On 4/11/2021 3:51 PM, Jason R. Coombs wrote: > Jason R. Coombs added the comment: > > At least I and Ethan and Martin have expressed a desire for the default, preferred usage work well in a portable environment. Requiring `delete_on_close=False` violates

[issue43686] re.match appears to hang with certain combinations of pattern and string

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: Try something like https://pypi.org/project/pyre2/ or _maybe_ https://pypi.org/project/regex/ (I didn't think that one tried to do a breadth first approach though so maybe not) I'm marking this a duplicate of the age old issue around degenerate patterns

[issue1662581] the re module can perform poorly: O(2**n) versus O(n**2)

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: https://pypi.org/project/pyre2/ seems to be a maintained version of that for use on modern Python interpreters. -- ___ Python tracker

[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-04-11 Thread Julian Berman
Change by Julian Berman : -- nosy: +Julian ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22282] ipaddress module accepts octal formatted IPv4 addresses in IPv6 addresses

2021-04-11 Thread Julian Berman
Change by Julian Berman : -- nosy: +Julian ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43798] Add position metadata to alias AST type

2021-04-11 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > FYI, probably unavoidable, but this appears to have broken pytest > https://github.com/pytest-dev/pytest/issues/8539 What's the problem? alias objects *have* lineno argument: >>> print(ast.dump(ast.parse("from x import y"), include_attributes=True,

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-11 Thread Jason R. Coombs
Jason R. Coombs added the comment: At least I and Ethan and Martin have expressed a desire for the default, preferred usage work well in a portable environment. Requiring `delete_on_close=False` violates that expectation. How about something like this instead: - Add an `delete_when=None`,

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2021-04-11 Thread Evgeny
Evgeny added the comment: Dear all, how can we realistically move this forward? This issue is 9 years old by now. Everybody from the discussion agrees, this is an issue. There were several proposals made, all of them slightly different. 7 months ago I have implemented solution, pretty much

[issue43617] Missing definition in configure.ac causing autoreconf to create damaged configure script

2021-04-11 Thread Eli Schwartz
Eli Schwartz added the comment: Hmm, I've seen this accomplished elsewhere using m4_pattern_forbid, which would make autoreconf fail with the following message: ``` configure.ac:17: error: possibly undefined macro: AX_C_FLOAT_WORDS_BIGENDIAN If this token and others are legitimate,

[issue43682] Make static methods created by @staticmethod callable

2021-04-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset 553ee2781a37ac9d2068da3e1325a780ca79e21e by Victor Stinner in branch 'master': bpo-43682: Make staticmethod objects callable (GH-25117) https://github.com/python/cpython/commit/553ee2781a37ac9d2068da3e1325a780ca79e21e --

[issue43282] Add split install targets to install tests separately from lib

2021-04-11 Thread Eli Schwartz
Eli Schwartz added the comment: I started to look into this, but it seems like I'd need a bit of duplication to handle byte compiling the installed files in two different Makefile targets. The alternatives are templating, automake style, or GNU make'isms like the $(call) function, or

[issue43798] Add position metadata to alias AST type

2021-04-11 Thread Shantanu
Shantanu added the comment: FYI, probably unavoidable, but this appears to have broken pytest https://github.com/pytest-dev/pytest/issues/8539 -- nosy: +hauntsaninja ___ Python tracker

[issue43770] Rework C types initialization

2021-04-11 Thread STINNER Victor
STINNER Victor added the comment: New changeset 53114ffef1d4facf9aa5545e711abbbda66f672a by Victor Stinner in branch 'master': bpo-43770: Refactor PyType_Ready() function (GH-25336) https://github.com/python/cpython/commit/53114ffef1d4facf9aa5545e711abbbda66f672a --

[issue43809] Improve mismatching parentheses error

2021-04-11 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +24082 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25348 ___ Python tracker

[issue43809] Improve mismatching parentheses error

2021-04-11 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : Consider the following program: ( a + b + c ] ) The current error is: >>> ( a + b + c ] ) File "", line 1 ( a + b + c ] ) ^ SyntaxError: closing parenthesis ']' does not match opening parenthesis '(' Which is not bad, but the

[issue43574] Regression in overallocation for literal list initialization in v3.9+

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method.

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method.

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43785] Remove RLock from BZ2File

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I see you're already tracking __iter__ in https://bugs.python.org/issue43787, perfect! :) -- ___ Python tracker ___

[issue43785] Remove RLock from BZ2File

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm not worried about compatibility on this for 3.10. Nobody realistically expects to be able to have multiple readers from a single BZ2File stream. They don't for the gzip or lzma equivalents. That isn't even a normal thing to do on an actual file.

[issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring

2021-04-11 Thread Eryk Sun
Eryk Sun added the comment: > the name "address" and "addr" respectively which are misleading > because it is asking for ctypes.c_char_p or ctypes.c_wchar_p which > are C pointer types string_at() and wstring_at() take a c_void_p value. This can be initialized by an integer (i.e. an

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: looking around it appears you've proposed an independent implementation of this for the thir party brotli module? https://github.com/google/brotli/pull/856 that is what i mean about making this reusable :) --

[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I left some review comments on the PR. I like the algorithm being used. I don't really _like_ that this is a .h file acting as a C template to inject effectively the same static code into each module that wants to use it... Which I think is the

[issue42916] Support for DICOM image file format in imghdr module

2021-04-11 Thread Pierre-Alain Moret
Pierre-Alain Moret added the comment: The DICOM format is indeed very widely used in the medical field and for me it deserves to be added in stdlib. I do not see why it is more specific than rast format which is included. Moreover it should be easy to add because even if the complete format

[issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring

2021-04-11 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: > I'd favor updating them all to say "ptr", because changing the name of the > runtime parameter would risk breaking users' code. I also certainly agree with that. Moreover, the documentation and docstring uses the name "address" and "addr" respectively

[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-04-11 Thread Matej Cepl
Matej Cepl added the comment: > Did you upstream fixes for those packages? Of course we did. Upstream first! -- ___ Python tracker ___

[issue43808] Add .isfloat() method to str

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue43808] Add .isfloat() method to str

2021-04-11 Thread Eric V. Smith
Eric V. Smith added the comment: Wouldn't the next thing you do be to convert it to a float, so you'd call float() twice? I think you'd be better off just catching the exception yourself, and using the result of float(). I'm opposed to such a simple function being a member of str or in the

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2021-04-11 Thread Matthew Suozzo
Change by Matthew Suozzo : -- pull_requests: +24081 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25347 ___ Python tracker ___

[issue42737] PEP 563: drop annotations for complex assign targets

2021-04-11 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > I think I'd be okay if `foo[bar]: baz` and `foo.bar: baz` (etc.) didn't > generate any bytecode at all. Is that what you're proposing here? If so, and > assuming the code is reasonably straightforward, I'd say go ahead and make a > PR (and close the old

[issue39102] Increase Enum performance

2021-04-11 Thread Ethan Furman
Change by Ethan Furman : -- stage: patch review -> needs patch versions: +Python 3.10 -Python 3.9 ___ Python tracker ___ ___

[issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function"

2021-04-11 Thread Dmitry Marakasov
Dmitry Marakasov added the comment: > This issue is a bug in Cython, not in Python. I close it. This is correct, thanks! The problem is gone with git master version of cython. -- ___ Python tracker

[issue43430] Exception raised when attempting to create Enum via functional API

2021-04-11 Thread Ethan Furman
Ethan Furman added the comment: Looking at your example I see that you are using an enum as the `type` parameter -- the purpose of `type` is to provide a mixin data type, such as `int` or `str`, not another enum. What is your use-case? Typically, subclassing EnumMeta is not needed.

[issue43808] Add .isfloat() method to str

2021-04-11 Thread JimmyCarlos
New submission from JimmyCarlos : Hello Python Community! One feature I think would be helpful would be a method to see if a str can be safely converted into a float. Currently, this is not doable without a long regex or a try-except block, as numbers like "-3.52" contain non-numeric

[issue41661] os.path.relpath does not document ValueError on Windows with different drives

2021-04-11 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 7.0 -> 8.0 pull_requests: +24080 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25346 ___ Python tracker

[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-04-11 Thread miss-islington
miss-islington added the comment: New changeset 6ec2fb42f93660810952388e5c4018c197c17c8c by Miss Islington (bot) in branch '3.9': bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (GH-24818) https://github.com/python/cpython/commit/6ec2fb42f93660810952388e5c4018c197c17c8c

[issue43807] JSONDecodeError: Extra Data Raised on Long Valid JSON

2021-04-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: There is a block of NUL bytes at the end of the JSON data structure The output of "od -c pico-hard.json" ends with: 0046340s e c t i o n N o t e s " : [ ] 0046360, " t y p e O f S e c t i o n

[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-04-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +24079 pull_request: https://github.com/python/cpython/pull/25345 ___ Python tracker ___

[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-04-11 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 13.0 -> 14.0 pull_requests: +24078 pull_request: https://github.com/python/cpython/pull/25344 ___ Python tracker

[issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator

2021-04-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: New changeset b38601d49675d90e1ee6faa47f7adaeca992d02d by Ken Jin in branch 'master': bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (#24818) https://github.com/python/cpython/commit/b38601d49675d90e1ee6faa47f7adaeca992d02d --

[issue43807] JSONDecodeError: Extra Data Raised on Long Valid JSON

2021-04-11 Thread Unknown Retired Guy
New submission from Unknown Retired Guy : https://i.ibb.co/tYqBsQ8/pico-hard.png That JSONDecodeError: Extra Data is raised when the Valid JSON is too long or over than 25000 bytes, I don't know what caused this, can you fix it? The code and the traceback is in that picture/link above in

[issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly

2021-04-11 Thread Marko
Marko added the comment: Somewhat related issue43806 with asyncio.StreamReader -- ___ Python tracker ___ ___ Python-bugs-list

[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-04-11 Thread Marko
Marko added the comment: Somewhat related issue43806 with asyncio.StreamReader -- ___ Python tracker ___ ___ Python-bugs-list

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-04-11 Thread Marko
New submission from Marko : When using asyncio to read from pipe, if process on the other side of pipe crashes read operation hangs indefinitely. Example: import asyncio import contextlib import os import signal import time prx, ctx = os.pipe() read_transport = None read_stream = None

[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-04-11 Thread Marko
Marko added the comment: Possible duplicate of issue22393 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-04-11 Thread PEW's Corner
PEW's Corner added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly

2021-04-11 Thread Marko
Marko added the comment: I've created issue43805. I think it would be better to have universal solution. And not specific ones, like in issue9205. Haven't checked the PRs, though. -- nosy: +kormang ___ Python tracker

[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-04-11 Thread Marko
New submission from Marko : When child process dies unexpectedly Queue.get waits indefinitely. Here is example: import os import signal import multiprocessing def child_func(qa, qb): input = qa.get() print('Child received: ', input) os.kill(os.getpid(), signal.SIGTERM)

[issue43804] Add more info about building C/C++ Extensions on Windows using MSVC

2021-04-11 Thread Shreyan Avigyan
Change by Shreyan Avigyan : -- keywords: +patch pull_requests: +24077 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25343 ___ Python tracker ___

[issue43804] Add more info about building C/C++ Extensions on Windows using MSVC

2021-04-11 Thread Shreyan Avigyan
New submission from Shreyan Avigyan : In the context of Docs/extending/windows.rst, the command provided, for compiling the source code and linking the libraries to create a DLL, only works for Python 32-bit versions. But the documentation doesn't inform anything about that. The PR linked

[issue43002] Exception chaining accepts exception classes

2021-04-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +24076 pull_request: https://github.com/python/cpython/pull/25342 ___ Python tracker ___

[issue43002] Exception chaining accepts exception classes

2021-04-11 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24075 pull_request: https://github.com/python/cpython/pull/25341 ___ Python tracker

[issue43776] Popen with shell=True yield mangled repr output

2021-04-11 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32466] Fix missing test coverage for fractions.Fraction.__new__

2021-04-11 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Sergey! Agreed that this can be closed. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker