summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py11
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):
"""