This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients corona10, pablogsal, serhiy.storchaka, shihai1991, tim.peters, vstinner
Date 2020-04-23.15:33:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587656036.28.0.696815408582.issue40217@roundup.psfhosted.org>
In-reply-to
Content
There are limited options to fix this issue:

(A) Revert commit 364f0b0f19cc3f0d5e63f571ec9163cf41c62958

It would reintroduced bpo-35810 bug. Moreover, C extension modules which have been modified to call Py_DECREF(Py_TYPE(self)) in tp_dealloc which suddenly crash.

I don't think that anyone wants this option.


(B) Require all C extension modules authors to modify their tp_traverse function.

It requires to communicate well that all C extension modules which use PyType_FromSpec() need to modify their tp_traverse method to add code specific to Python 3.8 or newer.

Serhiy and me are against this option.


(C) Modify gcmodule.c to traverse the type.

This option is not trivial since *subtype* are already traversed. Moreover, Pablo and Tim are strongly against this option.


(D) Modify PyType_FromSpec() to hook into tp_traverse and transparently visit the type, as already done for subtypes.

Option chosen by PR 19414.

Honestly, I'm unhappy that we have to hook into tp_traverse, but this option sounds like the least bad option to me.

Developers don't have to modify their C extensions code, the bug is fixed.
History
Date User Action Args
2020-04-23 15:33:56vstinnersetrecipients: + vstinner, tim.peters, serhiy.storchaka, corona10, pablogsal, shihai1991
2020-04-23 15:33:56vstinnersetmessageid: <1587656036.28.0.696815408582.issue40217@roundup.psfhosted.org>
2020-04-23 15:33:56vstinnerlinkissue40217 messages
2020-04-23 15:33:56vstinnercreate