Skip to content

[3.10] bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435) #28438

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
merged 2 commits into from
Sep 18, 2021

Conversation

brettcannon
Copy link
Member

@brettcannon brettcannon commented Sep 18, 2021

This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).
(cherry picked from commit 209b703)

Co-authored-by: Brett Cannon brett@python.org

https://bugs.python.org/issue45183

…importer.find_spec() when the zip file is missing and the internal cache has been reset (pythonGH-28435)

This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).
(cherry picked from commit 209b703)

Co-authored-by: Brett Cannon <brett@python.org>
@brettcannon brettcannon merged commit e1bdecb into python:3.10 Sep 18, 2021
@brettcannon brettcannon deleted the backport-209b703-3.10 branch September 18, 2021 00:46
@bedevere-bot
Copy link

@brettcannon: Please replace # with GH- in the commit message next time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants