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) #28437

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

Closed

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Sep 17, 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 [email protected]

https://bugs.python.org/issue45183

Automerge-Triggered-By: GH:brettcannon

…r.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 <[email protected]>
@miss-islington
Copy link
Contributor Author

@brettcannon: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@brettcannon: Status check is done, and it's a success ✅ .

@brettcannon
Copy link
Member

I will have to do the backport manually due to the need to regenerate zipimporter.h.

@miss-islington
Copy link
Contributor Author

@miss-islington: Status check is done, and it's a failure ❌ .

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

Successfully merging this pull request may close these issues.

4 participants