[3.11] gh-101566: Sync with zipp 3.14. (GH-102018). (GH-102090)

(cherry picked from commit 36854bbb24)

Backport of bugfix only.

Automerge-Triggered-By: GH:jaraco
This commit is contained in:
Jason R. Coombs 2023-02-20 18:22:03 -05:00 committed by GitHub
parent 62c0327487
commit d15e9589f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View file

@ -2250,6 +2250,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):
"""