bpo-32030: Add _PyMainInterpreterConfig_ReadEnv() by vstinner · Pull Request #4542 · python/cpython (original) (raw)
@ncoghlan: Previously, I added _Py_GetPythonHomeWithConfig() to be able to iterate slowly on the code. With this change, I was able to remove _Py_GetPythonHomeWithConfig(). Py_GetPath() now also uses internally _PyMainInterpreterConfig to get environment variables. This change is the implementation of what I described you by email.
This PR is only a small enhancement of the current code. You can still expect API changes. I tried to add program_name to _PyMainInterpreterConfig, but then I was stuck since _PyMainInterpreterConfig_ReadEnv() doesn't have access to argc and argv, whereas the code requires argv[0] to initialize program_name.
I have to think about it to see how program_name can be initialized properly.