[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

Paulo Henrique Silva report at bugs.python.org
Tue Mar 24 21:46:40 EDT 2020


Paulo Henrique Silva <ph.silva at gmail.com> added the comment:

Updating on my findings on msg364833.

It looks like encodings module is not being destoyed at all and keeping all the encoding refs alive. Looks like some cycle but I am not sure yet how to solve it.

To validate this, I:
 - removed codec_search_cach of PyInterpreterState.
 - Py_DECREFd(encodings) after loading it on codecs.c.

Before: 4376 refs left (37fcbb65d4)
After :  352 refs left (-92%)

I've updated the changes at https://github.com/python/cpython/compare/master...phsilva:remove-codec-caches (not a proposed patch, just to validate the idea)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________


More information about the Python-bugs-list mailing list