diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2023-02-20 23:21:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-20 23:21:48 (GMT) |
commit | 7bb41d9d5d2f0be30fd367fd085bb307db1a1ca3 (patch) | |
tree | d45736c1f32fb11725ba59b22c8aeef3ffafce5c /Lib/zipfile.py | |
parent | 95f4e2ca03efbe020ae590108c022219008bbaf3 (diff) | |
download | cpython-7bb41d9d5d2f0be30fd367fd085bb307db1a1ca3.zip cpython-7bb41d9d5d2f0be30fd367fd085bb307db1a1ca3.tar.gz cpython-7bb41d9d5d2f0be30fd367fd085bb307db1a1ca3.tar.bz2 |
[3.10] gh-101566: Sync with zipp 3.14. (GH-102018). (GH-102091)
(cherry picked from commit 36854bbb240e417c0df6f0014924fcc899388186)
Includes the bugfix only.
Automerge-Triggered-By: GH:jaraco
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r-- | Lib/zipfile.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py index dc4eb38..23e4ee4 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -2197,6 +2197,17 @@ class CompleteDirs(ZipFile): dir_match = name not in names and dirname in names return dirname if dir_match else name + def getinfo(self, name): + """ + Supplement getinfo for implied dirs. + """ + try: + return super().getinfo(name) + except KeyError: + if not name.endswith('/') or name not in self._name_set(): + raise + return ZipInfo(filename=name) + @classmethod def make(cls, source): """ |