bpo-32030: Fix _Py_InitializeEx_Private() by vstinner · Pull Request #4649 · python/cpython (original) (raw)
While testing ptest.c attached to https://bugs.python.org/issue20891 I found a regression that I introduced during https://bugs.python.org/issue32030 refactoring. When Python is embedded, calling Py_Initialize() doesn't read PYTHONPATH nor PYTHONHOME anymore. This change fixes it.
I'm not sure if Py_Initialize() is supposed to read PYTHON* environment variables. Usually in case of doubt, I look at Python version N-1, so Python 3.6 in this case. Python 3.6 does read PYTHONPATH and PYTHONHOME in Py_Initialize() (except if Py_IgnoreEnvironmentFlag is non-zero).