Skip to content

Commit

Permalink
Merge pull request #12363 from meeseeksmachine/auto-backport-of-pr-12…
Browse files Browse the repository at this point in the history
…358-on-7.x

Backport PR #12358 on branch 7.x (Fix retaring process for twine.)
  • Loading branch information
Carreau committed Jun 3, 2020
2 parents 1ea8230 + a7ca2e7 commit 046f1f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/retar.py
Expand Up @@ -47,14 +47,18 @@
m2.type = m.type
m2.linkname = m.linkname
if m.isdir():
new.addfile(m2)
else:
data = old.extractfile(m)
new.addfile(m2, data)
else:
new.addfile(m2)
new.close()
old.close()

buf.seek(0)
with open(sys.argv[1], "wb") as f:
with gzip.GzipFile('', "wb", fileobj=f, mtime=timestamp) as gzf:
gzf.write(buf.read())

# checks the archive is valid.
archive = tarfile.open(sys.argv[1])
names = archive.getnames()

0 comments on commit 046f1f6

Please sign in to comment.