[issue34247] PYTHONOPTIMZE ignored in 3.7.0 when using custom launcher

Nick Coghlan report at bugs.python.org
Fri Jul 27 23:56:39 EDT 2018


Nick Coghlan <ncoghlan at gmail.com> added the comment:

Comparing to Python 3.6, we can see that the code to update the C global flags from the environment variables used to live directly in _PyInitializeEx_Private: https://github.com/python/cpython/blob/9d85856044a2c7d681ea38b5ff99af375b228a0f/Python/pylifecycle.c#L305

In Python 3.7 that section (https://github.com/python/cpython/blob/3.7/Python/pylifecycle.c#L913 ) currently calls _PyCoreConfig_Read instead, which *only* updates the config struct - it doesn't update the C level global variables.

By contrast, Py_Main eventually calls https://github.com/python/cpython/blob/7cbde0e09daba4259565738e48f141851287fe29/Modules/main.c#L1394 which handles writing the state from the config struct back to the global variables.

----------

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


More information about the Python-bugs-list mailing list