summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2004-01-02 15:44:29 +0000
committerAndrew M. Kuchling <amk@amk.ca>2004-01-02 15:44:29 +0000
commit41ec07f5208e58c02c1d430cef90296a43f9bdec (patch)
treef5787ba8af12a1ae65a5389f3304852e73781d83 /Lib
parent301bc367b2650e3a90dc092cb62a8eb3e831247e (diff)
downloadcpython-41ec07f5208e58c02c1d430cef90296a43f9bdec.tar.gz
[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.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 26f9c7f6ac..6f44146920 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":