[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-19 Thread Christian Tismer-Sperling
On 26.04.21 23:55, Irit Katriel via Python-Dev wrote: > > Re https://bugs.python.org/issue40608 . > > I think it will be an act of kindness to > deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10 and tell people to > use Py_TRASHCAN_BEGIN/END instead. > > TL;DR:

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-19 Thread Duncan Grisby
On Tue, 2021-08-17 at 12:14 +0100, Irit Katriel wrote: > > On Tue, Aug 17, 2021 at 12:05 PM Duncan Grisby > wrote: > > I don't know if it is pertinent to this at all, but I > > raised https://bugs.python.org/issue9 in which the faulthandler > > module can lead to a segfault inside

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-19 Thread Duncan Grisby
On Thu, 2021-08-19 at 11:41 +0100, Irit Katriel wrote: > Well, in order to verify that we fixed the problem you reported we > need to be able to test the fix and see that the problem is gone.  > Right now we have two theories of what the cause could be, because > there are two known bugs in that

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-19 Thread Irit Katriel via Python-Dev
On Thu, Aug 19, 2021 at 11:28 AM Duncan Grisby > Thanks. Victor Stinner has now commented on the defect I raised to say > that it is actually a bug in the traceback module, in that it should not be > using Py_DECREF at all inside a signal handler. The fact that it leads to > use of the old

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-19 Thread Łukasz Langa
> On 18 Aug 2021, at 11:47, Irit Katriel wrote: > > It remains the decide how to backport the compiler warning to older versions, > and to which versions. 3.8 is when the macros broke. Since they cause segfaults, I'd say that's a pretty good reason to backport the warnings. While 3.8 in

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-18 Thread Irit Katriel via Python-Dev
Thanks, I've updated the PR. https://github.com/python/cpython/pull/27693 I added migration instructions to the news file (which Pablo can copy into what's new once it's committed). Also added a Py_DEPRECATED(3.11) typedef which is used in the macro. It remains the decide how to backport the

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Duncan Grisby
I don't know if it is pertinent to this at all, but I raised https://bugs.python.org/issue9 in which the faulthandler module can lead to a segfault inside Py_TRASHCAN_SAFE_BEGIN. Would that be avoided if frameobject.c was changed to use Py_TRASHCAN_BEGIN / END? Duncan. On Tue, 2021-08-17 at

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Victor Stinner
See also: * https://bugs.python.org/issue44881 "Consider integration of PyObject_GC_UnTrack() with the trashcan C API". * https://bugs.python.org/issue44897 "Integrate trashcan mechanism into _Py_Dealloc" The issue44897 would make all these macros useless ;-) Victor

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Victor Stinner
If the macro is deprecated, please provide an detailed explanation how to port existing C code to the new C API, in What's New In Python 3.X (version where the macro is deprecated, Python 3.11 if I understood correctly). Also, is there a way to write a single code base working on Python

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Petr Viktorin
On 17. 08. 21 12:00, Łukasz Langa wrote: Hi everybody, I'd like to revive this thread as I feel like we have to do something here but some consensus is needed first. To recap, the current state of things is as follows: - *in March 2000* (d724b23420f) Christian Tismer contributed the

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Irit Katriel via Python-Dev
On Tue, Aug 17, 2021 at 12:05 PM Duncan Grisby wrote: > I don't know if it is pertinent to this at all, but I raised > https://bugs.python.org/issue9 in which the faulthandler module can > lead to a segfault inside Py_TRASHCAN_SAFE_BEGIN. Would that be avoided if > frameobject.c was changed

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Antoine Pitrou
On Tue, 17 Aug 2021 12:00:11 +0200 Łukasz Langa wrote: > > Now, there are a couple of things we can do here: > Option 1: Finish GH-12607 to fix the old macros, keeping in mind this will > restore compatibility lost with Python 3.8 - 3.10 only for users of 3.11+ > Option 2: Review and merge

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Łukasz Langa
Hi everybody, I'd like to revive this thread as I feel like we have to do something here but some consensus is needed first. To recap, the current state of things is as follows: - in March 2000 (d724b23420f) Christian Tismer contributed the "trashcan" patch that added Py_TRASHCAN_SAFE_BEGIN and