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 eric.snow, vstinner
Date 2019-12-06.16:01:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1575648114.92.0.973776231176.issue38858@roundup.psfhosted.org>
In-reply-to
Content
Py_NewInterpreter() (new_interpreter() in practice) and Py_InitializeEx() now share almost all their code.

Py_EndInterpreter() shares almost all its code with Py_Finalizer(). It's not perfect, but it's way better than previously.

Py_NewInterpreter() now isolates more things from the main interpreter. For example, builtins and sys modules no longer copy the module dictionary of the main interpreter, but create their own dictionary from scratch.

See each commit for the details.

Py_Finalizer() could share more code with Py_EndInterpreter(), but each Py_Finalizer() change is really tricky and require to pay a lot attention. The Python finalization is really fragile. I started to take notes on this fragile code:
https://pythondev.readthedocs.io/finalization.html

I consider that the initial issue is fixed, so I close the issue.
History
Date User Action Args
2019-12-06 16:01:55vstinnersetrecipients: + vstinner, eric.snow
2019-12-06 16:01:54vstinnersetmessageid: <1575648114.92.0.973776231176.issue38858@roundup.psfhosted.org>
2019-12-06 16:01:54vstinnerlinkissue38858 messages
2019-12-06 16:01:54vstinnercreate