FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-32030: Fix _Py_InitializeEx_Private() by vstinner · Pull Request #4649 · python/cpython · GitHub

/ cpython Public

bpo-32030: Fix _Py_InitializeEx_Private() - #4649

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:config_readenv
Nov 30, 2017
Merged

bpo-32030: Fix _Py_InitializeEx_Private()#4649
vstinner merged 1 commit into
python:masterfrom
vstinner:config_readenv

Conversation

vstinner commented Nov 30, 2017
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

_Py_InitializeEx_Private() now calls
_PyMainInterpreterConfig_ReadEnv() to read environment variables
PYTHONHOME and PYTHONPATH, and set the program name.

https://bugs.python.org/issue32030

_Py_InitializeEx_Private() now calls
_PyMainInterpreterConfig_ReadEnv() to read environment variables
PYTHONHOME and PYTHONPATH, and set the program name.

Copy link
Copy Markdown
Member Author

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).

vstinner merged commit bc8ac6b into python:master Nov 30, 2017
vstinner deleted the config_readenv branch November 30, 2017 17:03

Copy link
Copy Markdown
Member Author

I had to push this fix quickly to be able to write an unit test for my https://bugs.python.org/issue20891 fix: the PR #4650.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL