diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2004-01-02 15:44:29 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2004-01-02 15:44:29 (GMT) |
commit | 6e4f7a82da178c7c69dc8cbe65284bf7d1bb5a61 (patch) | |
tree | b5b1a9de13a14f9aaa38e12eea5d6c77dff6a545 /Lib | |
parent | b914ef0a33be195b4b9a5439e8dc6727e1c2862c (diff) | |
download | cpython-6e4f7a82da178c7c69dc8cbe65284bf7d1bb5a61.zip cpython-6e4f7a82da178c7c69dc8cbe65284bf7d1bb5a61.tar.gz cpython-6e4f7a82da178c7c69dc8cbe65284bf7d1bb5a61.tar.bz2 |
[Bug #812325 ] tarfile.close() can write out more bytes to the output
than are specified by the buffer size. The patch calls .__write()
to ensure that any full blocks are written out.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/tarfile.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 26f9c7f..6f44146 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -353,6 +353,7 @@ class _Stream: if self.mode == "w" and self.buf: if self.type != "tar": self.buf += self.cmp.flush() + self.__write("") # Write remaining blocks to output self.fileobj.write(self.buf) self.buf = "" if self.type == "gz": |