Skip to content

Commit d126b21

Browse files
committed
Allow missing getpwuid/getrpgid in tarfile
1 parent 5e0b380 commit d126b21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/lib-python/3/tarfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,12 +2119,14 @@ def gettarinfo(self, name=None, arcname=None, fileobj=None):
21192119
if pwd:
21202120
try:
21212121
tarinfo.uname = pwd.getpwuid(tarinfo.uid)[0]
2122-
except KeyError:
2122+
# GraalPy change: catch io.UnsupportedOperation to allow this to fail on java posix backend
2123+
except (KeyError, io.UnsupportedOperation):
21232124
pass
21242125
if grp:
21252126
try:
21262127
tarinfo.gname = grp.getgrgid(tarinfo.gid)[0]
2127-
except KeyError:
2128+
# GraalPy change: catch io.UnsupportedOperation to allow this to fail on java posix backend
2129+
except (KeyError, io.UnsupportedOperation):
21282130
pass
21292131

21302132
if type in (CHRTYPE, BLKTYPE):

0 commit comments

Comments
 (0)