remove the path of the tarfile

This commit is contained in:
Kay0u 2020-04-28 21:05:36 +02:00
parent 7de8417fb2
commit 5901cb9993
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156

View file

@ -1988,7 +1988,10 @@ class TarBackupMethod(BackupMethod):
def copy(self, file, target):
tar = tarfile.open(self._archive_file, "r:gz")
tar.extract(file, path=target)
file_to_extract = tar.getmember(file)
# Remove the path
file_to_extract.name = os.path.basename(file_to_extract.name)
tar.extract(file_to_extract, path=target)
tar.close()