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, erlendaasland, serhiy.storchaka, vstinner
Date 2021-12-07.17:27:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Depending on how the stdlib file was loaded (in the main interpreter and in the subinterpreter), __code__.co_freevars[0] may or may not be an interned string.

When the bug occurs, I see that the Python stdlib file is loaded twice: the main interpreter builds a code object, and then subinterpreter builds its own code object: same content, but different Python object (at different memory addresses so inequal pointers!).

I modified reproducer.c to add "Py_VerboseFlag = 1;" before the Py_Initialize() call. Truncated output:
# code object from /opt/py310/lib/python3.10/
# code object from /opt/py310/lib/python3.10/
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
RuntimeError: super(): __class__ cell not found
Date User Action Args
2021-12-07 17:27:51vstinnersetrecipients: + vstinner, serhiy.storchaka, corona10, erlendaasland
2021-12-07 17:27:51vstinnersetmessageid: <>
2021-12-07 17:27:51vstinnerlinkissue46006 messages
2021-12-07 17:27:51vstinnercreate