Merge pull request #5856 from ThomasWaldmann/tar-roundtrip-master

import-tar: fix empty user/group name in TarInfo, fixes #5853
This commit is contained in:
TW 2021-06-17 17:21:33 +02:00 committed by GitHub
commit a9aceb5e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1410,7 +1410,7 @@ class TarfileObjectProcessors:
@contextmanager
def create_helper(self, tarinfo, status=None, type=None):
item = Item(path=make_path_safe(tarinfo.name), mode=tarinfo.mode | type,
uid=tarinfo.uid, gid=tarinfo.gid, user=tarinfo.uname, group=tarinfo.gname,
uid=tarinfo.uid, gid=tarinfo.gid, user=tarinfo.uname or None, group=tarinfo.gname or None,
mtime=tarinfo.mtime * 1000**3)
yield item, status
# if we get here, "with"-block worked ok without error/exception, the item was processed ok...