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

Merged
brettcannon merged 2 commits intopython:3.10from
brettcannon:backport-209b703-3.10
Sep 18, 2021

Conversation

@brettcannon
Copy link
Copy Markdown
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
Copy Markdown

@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