-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-91351: Fix some bugs in importlib handling of re-entrant imports #94504
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
Merged
brettcannon
merged 35 commits into
python:main
from
PrivateStorageio:91351-importlib-reentrancy
Jan 21, 2023
Merged
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
2a4d4f3
Add some implementation documentation
exarkun c9e33c7
Move _blocking_on management into a context manager
exarkun c5912bf
Support re-entrant imports in _BlockingOnManager
exarkun 27ae2f0
Apply formatting and comment changes from review
exarkun 1fcc78b
Merge remote-tracking branch 'origin/main' into 91351-importlib-reent…
exarkun 5fd15d8
Rename _BlockingOnManager.tid as suggested by review
exarkun 7a24f2c
flip the first two arguments to _has_deadlock as suggested by review
exarkun 08892b4
Mark up parameters following PEP 257 as suggested by review
exarkun 59b53c0
rename the `_blocking_on` parameter as suggested by review
exarkun 20007c5
further document motivation for `blocking_on` parameter as suggested …
exarkun bad1d3c
Rename more _has_deadlocked parameters as suggested by review
exarkun 2821fcf
Treat None and [] the same for this case as suggested by review
exarkun 95c73cb
update old comment to refer to new names as suggested by review
exarkun 49ff9dd
Make _ModuleLock.count a list of True as suggested by review
exarkun cd174a8
Adjust the check for a module lock being released as suggest by review
exarkun 719b181
Finish the _BlockingOnManager.tid renaming
exarkun 6e809cd
Fix renaming of `_blocking_on` parameter to `_has_deadlocked`
exarkun 74cbccd
Apply review suggestion
exarkun c579533
Apply review suggestion
exarkun decb70b
Apply review suggestion
exarkun 3c91cc3
Apply review suggestion
exarkun e032ae2
Apply review suggestion
exarkun dba393a
Apply review suggestion
exarkun 25d554b
Apply review suggestion
exarkun 44157a9
Apply review suggestion
exarkun f99ed46
Apply review suggestion
exarkun b6d21f8
Apply review suggestion
exarkun 5643442
Apply review suggestion
exarkun 92036a8
Apply review suggestion
exarkun bf14ce2
Apply review suggestion
exarkun 1cc6033
Apply review suggestion
exarkun ab40737
Apply review suggestion
exarkun 36082eb
news blurb
exarkun 55fc599
Merge branch 'main' into 91351-importlib-reentrancy
exarkun b35f0a8
Apply suggestions from code review
exarkun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
5 changes: 5 additions & 0 deletions
5
Misc/NEWS.d/next/Core and Builtins/2023-01-06-09-22-21.gh-issue-91351.iq2vZ_.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Fix a case where re-entrant imports could corrupt the import deadlock | ||
detection code and cause a :exc:`KeyError` to be raised out of | ||
:mod:`importlib/_bootstrap`. In addition to the straightforward cases, this | ||
could also happen when garbage collection leads to a warning being emitted -- | ||
as happens when it collects an open socket or file) |
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.
Uh oh!
There was an error while loading. Please reload this page.