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 Jim Fasarakis-Hilliard, amaury.forgeotdarc, corona10, eric.snow, isoschiz, koubaa, kylotan, lukasz.langa, miss-islington, pconnell, phsilva, python-dev, santoso.wijaya, shihai1991, tlesher, vstinner, ysj.ray
Date 2020-08-12.21:56:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1597269411.44.0.0167862258394.issue1635741@roundup.psfhosted.org>
In-reply-to
Content
> Q: How to solve the problem?

Making sure that the "total reference count" is zero after Py_Finalize() is a long term project which requires to solve many subproblems:

* Convert static types to heap types: bpo-40077
* Somehow related, convert extension modules to multiphase initialization (PEP 489): this issue
* Identify remaining global variables and either clear them explicitly, or move them to a structure which is cleared at exit

To convert extension modules to multiphase init, one practical problem is that the PEP 573 doesn't cover slots and a few other corner cases. The PEP 573 should be extended:
https://mail.python.org/archives/list/capi-sig@python.org/thread/6CGIIZVMJRYHWZDJLNWCLPSYYAVRRVCC/

There are likely a bunch of other misc corner cases which should be fixed as well.
History
Date User Action Args
2020-08-12 21:56:51vstinnersetrecipients: + vstinner, amaury.forgeotdarc, kylotan, tlesher, phsilva, ysj.ray, santoso.wijaya, lukasz.langa, python-dev, eric.snow, pconnell, isoschiz, Jim Fasarakis-Hilliard, corona10, miss-islington, shihai1991, koubaa
2020-08-12 21:56:51vstinnersetmessageid: <1597269411.44.0.0167862258394.issue1635741@roundup.psfhosted.org>
2020-08-12 21:56:51vstinnerlinkissue1635741 messages
2020-08-12 21:56:51vstinnercreate