bpo-38234: Fix _PyConfig_InitPathConfig()#16335
Merged
vstinner merged 3 commits intopython:masterfrom Sep 23, 2019
vstinner:pathconfig_fix2
Merged
bpo-38234: Fix _PyConfig_InitPathConfig()#16335vstinner merged 3 commits intopython:masterfrom vstinner:pathconfig_fix2
vstinner merged 3 commits intopython:masterfrom
vstinner:pathconfig_fix2
Conversation
* _PyConfig_InitPathConfig() now starts by copying the global path configuration, and then override values set in PyConfig. * _PyPathConfig_Calculate() implementations no longer override _PyPathConfig fields which are already computed. For example, if _PyPathConfig.prefix is not NULL, leave it unchanged. * If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't _PyPathConfig_Calculate() anymore. * _PyPathConfig_Calculate() now only uses PyConfig to initialize PyCalculatePath structure. * pathconfig_calculate(): remove useless temporary "_PyPathConfig new_config" variable. * calculate_module_search_path(): remove hack to workaround memory allocation failure, call Py_FatalError() instead. * Fix get_program_full_path(): handle memory allocation failure.
zooba
reviewed
Sep 23, 2019
Member
Author
_PyConfig_InitPathConfig() doesn't call _PyPathConfig_Calculate() anymore. |
Contributor
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Contributor
|
Sorry @vstinner, I had trouble checking out the |
|
GH-16336 is a backport of this pull request to the 3.8 branch. |
vstinner
added a commit
that referenced
this pull request
Sep 23, 2019
* _PyConfig_InitPathConfig() now starts by copying the global path configuration, and then override values set in PyConfig. * _PyPathConfig_Calculate() implementations no longer override _PyPathConfig fields which are already computed. For example, if _PyPathConfig.prefix is not NULL, leave it unchanged. * If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't call _PyPathConfig_Calculate() anymore. * _PyPathConfig_Calculate() no longer uses PyConfig, except to initialize PyCalculatePath structure. * pathconfig_calculate(): remove useless temporary "_PyPathConfig new_config" variable. * calculate_module_search_path(): remove hack to workaround memory allocation failure, call Py_FatalError() instead. * Fix get_program_full_path(): handle memory allocation failure. (cherry picked from commit 9c42f8c)
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.
configuration, and then override values set in PyConfig.
_PyPathConfig fields which are already computed. For example,
if _PyPathConfig.prefix is not NULL, leave it unchanged.
_PyPathConfig_Calculate() anymore.
PyCalculatePath structure.
"_PyPathConfig new_config" variable.
allocation failure, call Py_FatalError() instead.
https://bugs.python.org/issue38234