Skip to content

Commit 83bf44e

Browse files
committed
Fix lookup
1 parent 99c2eaa commit 83bf44e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/tarfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,9 @@ def getmember(self, name):
21742174
than once in the archive, its last occurrence is assumed to be the
21752175
most up-to-date version.
21762176
"""
2177-
tarinfo = self._getmember(name.rstrip('/'))
2177+
tarinfo = self._getmember(name)
2178+
if tarinfo is None and name.endswith('/'):
2179+
tarinfo = self._getmember(name.rstrip('/'))
21782180
if tarinfo is None:
21792181
raise KeyError("filename %r not found" % name)
21802182
return tarinfo

0 commit comments

Comments
 (0)