bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx()#4667
Merged
vstinner merged 1 commit intopython:masterfrom Dec 1, 2017
vstinner:path_config4
Merged
bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx()#4667vstinner merged 1 commit intopython:masterfrom vstinner:path_config4
vstinner merged 1 commit intopython:masterfrom
vstinner:path_config4
Conversation
Changes: * _PyPathConfig_Fini() cannot be called in Py_FinalizeEx(). Py_Initialize() and Py_Finalize() can be called multiple times, but it must not "forget" parameters set by Py_SetProgramName(), Py_SetPath() or Py_SetPythonHome(), whereas _PyPathConfig_Fini() clear all these parameters. * config_get_program_name() and calculate_program_full_path() now also decode paths using Py_DecodeLocale() to use the surrogateescape error handler, rather than decoding using mbstowcs() which is strict. * Change _Py_CheckPython3() prototype: () => (void) * Truncate a few lines which were too long
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this pull request
Dec 2, 2017
…python#4667)" This reverts commit ebac19d.
serhiy-storchaka
added a commit
that referenced
this pull request
Dec 2, 2017
… (#4681) * Revert "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)" This reverts commit af5a895. * Revert "bpo-32030: Fix config_get_program_name() on macOS (#4669)" This reverts commit e23c06e. * Revert "bpo-32030: Add Python/pathconfig.c (#4668)" This reverts commit 0ea395a. * Revert "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)" This reverts commit ebac19d. * Revert "bpo-32030: Fix Py_GetPath(): init program_name (#4665)" This reverts commit 9ac3d88.
vstinner
added a commit
that referenced
this pull request
Dec 4, 2017
…po-32030. (#4681)" (#4694) * Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)" This reverts commit 13badcb. Re-apply commits: * "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)" commit af5a895. * "bpo-32030: Fix config_get_program_name() on macOS (#4669)" commit e23c06e. * "bpo-32030: Add Python/pathconfig.c (#4668)" commit 0ea395a. * "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)" commit ebac19d. * "bpo-32030: Fix Py_GetPath(): init program_name (#4665)" commit 9ac3d88. * Fix compilation error on macOS
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Py_Initialize() and Py_Finalize() can be called multiple times, but
it must not "forget" parameters set by Py_SetProgramName(),
Py_SetPath() or Py_SetPythonHome(), whereas _PyPathConfig_Fini()
clear all these parameters.
also decode paths using Py_DecodeLocale() to use the
surrogateescape error handler, rather than decoding using
mbstowcs() which is strict.
https://bugs.python.org/issue32030