diff options
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 6bdbf36..2560562 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -2366,17 +2366,11 @@ class TarFile(object): try: g = grp.getgrnam(tarinfo.gname)[2] except KeyError: - try: - g = grp.getgrgid(tarinfo.gid)[2] - except KeyError: - g = os.getgid() + g = tarinfo.gid try: u = pwd.getpwnam(tarinfo.uname)[2] except KeyError: - try: - u = pwd.getpwuid(tarinfo.uid)[2] - except KeyError: - u = os.getuid() + u = tarinfo.uid try: if tarinfo.issym() and hasattr(os, "lchown"): os.lchown(targetpath, u, g) |