[issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval

Arcadiy Ivanov report at bugs.python.org
Fri Jul 10 16:59:10 EDT 2020


Arcadiy Ivanov <arcadiy at ivanov.biz> added the comment:

> If sys.modules['_ast'] is cleared and then _ast is imported again, _PyState_AddModule() is called to store the new _ast module instance which calls astmodule_clear() on the old module instance.

I'm confused about this. In the repro below the sys.modules.clear() is indeed cleared, but references to all modules are retained. 

Where is the garbage collection/module re-initialization coming from? All of the references are live.

----------

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


More information about the Python-bugs-list mailing list