-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-33128 Fix duplicated call to importlib._install_external_importers #6273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Python/pylifecycle.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to stay - the bug is that initimport is trying to install the external importers that rely on sys.path (et al) already being configured properly.
test.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect you didn't mean to check this in :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woooops! 🙃
|
@ncoghlan I have removed the call from |
ncoghlan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good to me now. The last item we need is a NEWS entry, as described in https://devguide.python.org/committing/#what-s-new-and-news-entries, which can be created using the blurb tool at https://pypi.org/project/blurb/
Alternatively, just comment below and I can add a suitable blurb entry for you (that may take a bit longer, though)
|
@ncoghlan I have added the News entry. Thanks for reviewing! |
|
Thanks @pablogsal for the PR, and @ncoghlan for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-6592 is a backport of this pull request to the 3.7 branch. |
pythonGH-6273) External importers were being added in both phases of the import system initialisation. They're only supposed to be added in the second phase, after the import machinery has been appropriately configured. (cherry picked from commit 0977091) Co-authored-by: Pablo Galindo <[email protected]>
GH-6273) External importers were being added in both phases of the import system initialisation. They're only supposed to be added in the second phase, after the import machinery has been appropriately configured. (cherry picked from commit 0977091) Co-authored-by: Pablo Galindo <[email protected]>
https://bugs.python.org/issue33128
It seems that in 1abcf67
_Py_InitializeEx_Privatecalls_Py_InitializeCoreand_Py_InitializeMainInterpreter. The first one calls at the endinitimportthat in turns callsimportlib._install_external_importersthat sets thePathFinderinsys.meta_path. Then,_Py_InitializeMainInterpretercallsinitexternalimportthat in turns calls againimportlib._install_external_importersand therefore we end with twoPathFindersinsys.meta_path.This PR eliminates duplicated calls to
importlib._install_external_importers.