Backport 51432:

Fix bug #1543303, tarfile adds padding that breaks gunzip.
Patch # 1543897.  (remove the padding)
This commit is contained in:
Neal Norwitz 2006-08-21 18:43:51 +00:00
parent db232dc86a
commit 7443b80549
3 changed files with 23 additions and 3 deletions

View file

@ -411,9 +411,6 @@ class _Stream:
self.buf += self.cmp.flush()
if self.mode == "w" and self.buf:
blocks, remainder = divmod(len(self.buf), self.bufsize)
if remainder > 0:
self.buf += NUL * (self.bufsize - remainder)
self.fileobj.write(self.buf)
self.buf = ""
if self.comptype == "gz":