fix archive module can not compress a single file in a tar file (#45117)
fixes #44968pull/4420/head
parent
87a9ada188
commit
95718f7e12
|
@ -426,7 +426,10 @@ def main():
|
|||
arcfile.write(path, path[len(arcroot):])
|
||||
arcfile.close()
|
||||
state = 'archive' # because all zip files are archives
|
||||
|
||||
elif format == 'tar':
|
||||
arcfile = tarfile.open(dest, 'w')
|
||||
arcfile.add(path)
|
||||
arcfile.close()
|
||||
else:
|
||||
f_in = open(path, 'rb')
|
||||
|
||||
|
|
Loading…
Reference in New Issue