[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-09 Thread Kumar Aditya
Change by Kumar Aditya : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46881] Statically allocate and initialize the latin1 characters.

2022-03-09 Thread Kumar Aditya
Change by Kumar Aditya : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance ___ Python tracker ___

[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2022-03-09 Thread Larry Hastings
Larry Hastings added the comment: Graham: I'm happy to help. I can write a more elaborate explanation of what's happening, or answer questions, whatever you like. I'm a fan of wrapt so I'd certainly like to see this issue resolved. And, seeing as you're the author and maintainer of wrapt,

[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2022-03-09 Thread Graham Dumpleton
Graham Dumpleton added the comment: I don't know about the comment "he has far more experience than I do with this sort of object proxying wizardry". I read what you said and my brain melted. I am getting too old for this and trying to understand how anything works anymore takes me ages.

[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2022-03-09 Thread Larry Hastings
Larry Hastings added the comment: (It's also possible your workaround where wrapt explicitly defines an "__annotations__" getset on every child of ObjectProxy is the right fix. I don't know; I don't know the fine points of attribute access, like when does it access getsets on the type, vs

[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2022-03-09 Thread Larry Hastings
Larry Hastings added the comment: This isn't a CPython bug. It's a change in CPython behavior that wrapt needs to accommodate. In particular, it isn't 'causing a regression for C subclasses of heap types when the parent class has an "__annotations__" descriptor', nor do child classes have

[issue36709] Asyncio SSL keep-alive connections raise errors after loop close.

2022-03-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue45033] Calls to PyErr_PrintEx in destructors cause calling async functions to incorrectly return None

2022-03-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: 'catch (boost::python::error_already_set e)' is equal to `except BaseException as e:` In Python, blind catching base exception is dangerous, the code should re-raise it usually. The same is true for boost::python usage. > how would it tell the difference

[issue33886] SSL on aiomysql hangs on reconnection

2022-03-09 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue30740] SSLError when cancelling an SSL connection

2022-03-09 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Eric V. Smith
Eric V. Smith added the comment: This appears to be due to dataclasses needing to create a new class in order to set __slots__. I'll look at it, but I doubt there's anything that can be done. attrs has the same issue: File "x/.local/lib/python3.8/site-packages/attr/_make.py", line 889,

[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Guido Imperiale
Change by Guido Imperiale : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Guido Imperiale
Change by Guido Imperiale : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Guido Imperiale
New submission from Guido Imperiale : Related to #46382 A class decorated with dataclass(slots=True) can't pass any parameters to the __init_subclass__ method of its parent class. from dataclasses import dataclass class A: __slots__ = () def __init_subclass__(cls, msg):

[issue24132] Direct sub-classing of pathlib.Path

2022-03-09 Thread Barney Gale
Barney Gale added the comment: If/when GH-31691 lands, I think this bug can be resolved: the original repro case will no longer raise AttributeError, and subclasses will be able to customize behaviour without needing to define further "flavour" or "accessor" subclasses. --

[issue46785] On Windows, os.stat() can fail if called while another process is creating or deleting the file

2022-03-09 Thread Itai Steinherz
Itai Steinherz added the comment: I'd like to work on this, however I'm not sure how this could be unit-tested. Any ideas? -- nosy: +itaisteinherz ___ Python tracker ___

[issue46881] Statically allocate and initialize the latin1 characters.

2022-03-09 Thread miss-islington
miss-islington added the comment: New changeset 8714b6fa27271035dd6dd3514e283f92d669321d by Kumar Aditya in branch 'main': bpo-46881: Statically allocate and initialize the latin1 characters. (GH-31616) https://github.com/python/cpython/commit/8714b6fa27271035dd6dd3514e283f92d669321d

[issue46967] Type union for except

2022-03-09 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think that `except A|B` looks better than `except (A, B)`, so I am against this proposal. Exception matching is its own special thing (e.g. it doesn't honor virtual subclasses) and we shouldn't hyper-generalize. --

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Alex Waygood
Alex Waygood added the comment: I agree with Jelle — a valid protocol cannot inherit from a concrete type, and the whole point of NamedTuple is that it creates a tuple subclass (and tuple is obviously a concrete type). -- ___ Python tracker

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: A NamedTuple that is also a Protocol doesn't make sense to me, since a NamedTuple is a concrete (nominal) type and a Protocol cannot inherit from a concrete type. If you want something like that to happen, it's better to open an issue on

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Julius Park
Julius Park added the comment: What about Protocol? It is possible to create a dataclass that is a protocol, so it would be nicer from a symmetry perspective to allow it on both dataclasses and NamedTuples. -- ___ Python tracker

[issue46969] `pip install wrapt` fails on ast.py in Python 3.11.0a6

2022-03-09 Thread Dutcho
New submission from Dutcho : ... or perhaps this is caused by *wrapt 1.13.3*? ''' (venv) >pip install wrapt Collecting wrapt Using cached wrapt-1.13.3.tar.gz (48 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run

[issue46967] Type union for except

2022-03-09 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45924] Incorrect traceback when future's exception is raised multiple times

2022-03-09 Thread Irit Katriel
Irit Katriel added the comment: Closed issue46954 as a duplicate of this. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46954] Awaiting multiple times on same task increases memory usage unboundedly

2022-03-09 Thread Irit Katriel
Irit Katriel added the comment: This is a duplicate of bpo-45924. The traceback accumulates another frame every time the exception is raised. To see that, change main in your script to async def main(): task = asyncio.create_task(task_that_raise()) while True: try:

[issue46943] fix[imaplib]: call Exception with string instance

2022-03-09 Thread Irit Katriel
Change by Irit Katriel : -- versions: -Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46967] Type union for except

2022-03-09 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: This would be nice but I'm not sure it's worth the hassle in terms of documentation, tooling support, etc. There is an existing issue (that I can't find right now) that makes the `except` machinery use `__instancecheck__`, instead of looking only at real

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Carl Meyer
Carl Meyer added the comment: > have you considered watching dict keys rather than whole dicts? Just realized that I misunderstood this suggestion; you don't mean per-key watching necessarily, you just mean _not_ notifying on dict values changes. Now I understand better how that connects to

[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-09 Thread Oleksandr Pavlyk
Change by Oleksandr Pavlyk : -- keywords: +patch pull_requests: +29893 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31789 ___ Python tracker

[issue46967] Type union for except

2022-03-09 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood, Jelle Zijlstra, gvanrossum, iritkatriel ___ Python tracker ___ ___ Python-bugs-list

[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-09 Thread Oleksandr Pavlyk
New submission from Oleksandr Pavlyk : The following snippet illustrates request by an extension to use AMX registers: ``` // no increase sigaltstack size fix will not wark till we fix python void enable_amx_no_fix() { unsigned long bitmask; long rc; rc = syscall(SYS_arch_prctl,

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Carl Meyer
Carl Meyer added the comment: Hi Dennis, thanks for the questions! > A curiosity: have you considered watching dict keys rather than whole dicts? There's a bit of discussion of this above. A core requirement is to avoid any memory overhead and minimize CPU overhead on unwatched dicts.

[issue46965] Enable informing callee it's awaited via vector call flag

2022-03-09 Thread Vladimir Matveev
Change by Vladimir Matveev : -- nosy: +v2m ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46967] Type union for except

2022-03-09 Thread Henry Schreiner
New submission from Henry Schreiner : In 3.10 via PEP 604, there was an attempt to use the new union of types where runtime types were previously expected to be a tuple. `isinstance(x, (A, B))` can be written `isinstance(x, A | B)`. Unfortunately, there still is a case were a tuple of types

[issue45138] [sqlite3] expand bound values in traced statements when possible

2022-03-09 Thread miss-islington
miss-islington added the comment: New changeset e801e88744f34508aa338f9f7f3f3baee012f813 by Erlend Egeberg Aasland in branch 'main': bpo-45138: Revert GH-28240: Expand traced SQL statements (GH-31788) https://github.com/python/cpython/commit/e801e88744f34508aa338f9f7f3f3baee012f813

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45138] [sqlite3] expand bound values in traced statements when possible

2022-03-09 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +29892 pull_request: https://github.com/python/cpython/pull/31788 ___ Python tracker ___

[issue46965] Enable informing callee it's awaited via vector call flag

2022-03-09 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46966] c_void_p array is a footgun on I32LP64 systems

2022-03-09 Thread JP Sugarbroad
JP Sugarbroad added the comment: That matches our expectation. A subclass works - perhaps `c_void_p` could be deprecated in favor of a built-in subclass for generic opaque pointers as well? Glad you agree that a warning would be useful here. --

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Dennis Sweeney
Dennis Sweeney added the comment: A curiosity: have you considered watching dict keys rather than whole dicts? That way, changing global values would not have to de-optimize, only adding new global keys would. Indexing into dict values array wouldn't be as efficient as embedding direct

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Carl Meyer
Carl Meyer added the comment: Draft PR is up for consideration. Perf data in https://gist.github.com/carljm/987a7032ed851a5fe145524128bdb67a Overall it seems like the base implementation is perf neutral -- maybe a slight impact on the pickle benchmarks? With all module global dicts

[issue46896] add support for watching writes to selected dictionaries

2022-03-09 Thread Carl Meyer
Change by Carl Meyer : -- keywords: +patch pull_requests: +29891 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31787 ___ Python tracker ___

[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two ways of supporting an open file descriptor to a directory: 1. Accept a file descriptor as the dir argument. 2. Add a new parameter dir_fd; dir will then be a path relative to dir_fd. The original proposition is option 2. PR 31785 implements

[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29890 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31785 ___ Python tracker

[issue40059] Provide a toml module in the standard library

2022-03-09 Thread miss-islington
miss-islington added the comment: New changeset 23dcea5de736b367c0244042aaca10971538b2b4 by Dominic Davis-Foster in branch 'main': bpo-40059: Fix installation of tomllib (GH-31784) https://github.com/python/cpython/commit/23dcea5de736b367c0244042aaca10971538b2b4 -- nosy:

[issue40059] Provide a toml module in the standard library

2022-03-09 Thread Dominic Davis-Foster
Change by Dominic Davis-Foster : -- nosy: +domdfcoding nosy_count: 18.0 -> 19.0 pull_requests: +29889 pull_request: https://github.com/python/cpython/pull/31784 ___ Python tracker

[issue40059] Provide a toml module in the standard library

2022-03-09 Thread Dominic Davis-Foster
Dominic Davis-Foster added the comment: When building Python from source (as of the latest GitHub commit) the tomllib directory doesn't actually get copied over to the install prefix. It looks like an entry's needed in Makefile.pre.in under LIBSUBDIRS, along the lines of

[issue46245] Add support for dir_fd in shutil.rmtree()

2022-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46245] Add support for dir_fd in shutil.rmtree()

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 02fbaf4887deaf0207a5805d3736e0124a694c14 by Serhiy Storchaka in branch 'main': bpo-46245: Add optional parameter dir_fd in shutil.rmtree() (GH-30365) https://github.com/python/cpython/commit/02fbaf4887deaf0207a5805d3736e0124a694c14

[issue39951] Ignore specific errors when closing ssl connections

2022-03-09 Thread Christian Heimes
Christian Heimes added the comment: The bug should be fixed in 3.9 and 3.10 maintenance branches, too. -- assignee: christian.heimes -> stage: -> backport needed versions: +Python 3.10, Python 3.9 ___ Python tracker

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2022-03-09 Thread Kumar Aditya
Kumar Aditya added the comment: @asvetlov Anything left to do here or can this be closed ? -- nosy: +kumaraditya303 ___ Python tracker ___

[issue45138] [sqlite3] expand bound values in traced statements when possible

2022-03-09 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +29888 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31783 ___ Python tracker ___

[issue30740] SSLError when cancelling an SSL connection

2022-03-09 Thread Kumar Aditya
Kumar Aditya added the comment: This is fixed on main branch with bpo-44011 and does not raises exception. This can be closed now @asvetlov. -- nosy: +asvetlov, kumaraditya303 versions: +Python 3.11 -Python 3.6 ___ Python tracker

[issue33886] SSL on aiomysql hangs on reconnection

2022-03-09 Thread Kumar Aditya
Kumar Aditya added the comment: The main branch has rewritten ssl implementation with bpo-44011. This is outdated now and does not has a reproducer. This can be closed @asvetlov. -- nosy: +kumaraditya303 ___ Python tracker

[issue39951] Ignore specific errors when closing ssl connections

2022-03-09 Thread Kumar Aditya
Kumar Aditya added the comment: @asvetlov This has been fixed on main branch with bpo-44011. This can be closed now. -- nosy: +kumaraditya303 versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 ___ Python tracker

[issue45138] [sqlite3] expand bound values in traced statements when possible

2022-03-09 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Ah, one of my very first contributions, bpo-40318, comes back to haunt me: In bpo-40318, we migrated from the old SQLite trace API (sqlite3_trace) to SQLite trace v2 API (sqlite3_trace_v2). GH-19581, which introduced this change, introduced a bug: the

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Alex Waygood
Alex Waygood added the comment: +1 for the more minimal changeset proposed in PR 31781. I've never felt a need for NamedTuple multiple inheritance other than with Generic, so wouldn't be opposed to restricting it only to Generic. -- ___ Python

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 31781 is a simple PR which enables multiple inheritance with NamedTuple. As a side effect, it adds support of generic NamedTuple. I am not sure that all details work as expected. It is easy to limit multiple inheritance only for Generic if needed.

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29887 pull_request: https://github.com/python/cpython/pull/31781 ___ Python tracker ___

[issue46966] c_void_p array is a footgun on I32LP64 systems

2022-03-09 Thread Eryk Sun
Eryk Sun added the comment: > I'm not sure what can be done here (maybe a truncation warning?) For a function pointer, the default argument conversion for Python integers is the platform int type. Ideally, Python integer arguments would be converted to a type that matches the platform word

[issue31370] Remove support for threads-less builds

2022-03-09 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46964] The global config should not be stored on each interpreter

2022-03-09 Thread STINNER Victor
STINNER Victor added the comment: > Doing so unnecessarily adds extra complexity (and, when multiple interpreters > are used, extra CPU usage and extra memory usage). Right, PyConfig allocates memory per interpeter. But IMO it's an acceptable trade-off. I don't see the benefits of sharing

[issue46953] use FASTCALL for __import__ builtin

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the advantage of not touching a stable code? It was never a performance critical part of the code. This is why it avoided multiple previous optimizations. It is still use PyArg_ParseTupleAndKeywords(). Of course now, when optimization is provided

[issue45138] [sqlite3] expand bound values in traced statements when possible

2022-03-09 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Reopening bco. broken buildbots. -- status: closed -> open ___ Python tracker ___ ___