]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_sp...
authorBrett Cannon <brett@python.org>
Sat, 18 Sep 2021 00:46:22 +0000 (17:46 -0700)
committerGitHub <noreply@github.com>
Sat, 18 Sep 2021 00:46:22 +0000 (17:46 -0700)
commite1bdecb6dc7ac33256d5fa875d45634512d2a90e
tree16ee13faa6339c9acd6846ccfeaacdc4d979189b
parent397dad4001cd402cf4843ab44963932ea81c2e73
[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)

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 209b7035f714dcc41df054b0b023e0b955d7e1a2)

Co-authored-by: Brett Cannon <brett@python.org>
Lib/test/test_zipimport.py
Lib/zipimport.py
Misc/NEWS.d/next/Library/2021-09-17-15-58-53.bpo-45183.Vv_vch.rst [new file with mode: 0644]
Python/importlib_zipimport.h