]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Flush bz2 data even if nothing had been written so far. Fixes #1013882
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 22 Aug 2004 21:30:04 +0000 (21:30 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 22 Aug 2004 21:30:04 +0000 (21:30 +0000)
Lib/tarfile.py
Misc/NEWS

index 45fe03c043bf32afaac750df97e94d50c60a60c7..327ba365e60553c5ee36bb5f35242422b6f84946 100644 (file)
@@ -350,9 +350,9 @@ class _Stream:
         if self.closed:
             return
 
+        if self.mode == "w" and self.type != "tar":
+            self.buf += self.cmp.flush()
         if self.mode == "w" and self.buf:
-            if self.type != "tar":
-                self.buf += self.cmp.flush()
             self.fileobj.write(self.buf)
             self.buf = ""
             if self.type == "gz":
index 502baa88c7571d7a5b68dfc72f3f8287e1717ef1..c274000af82300f745575d50004571b1c29688db 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -49,6 +49,8 @@ Extension modules
 Library
 -------
 
+- Bug #1013882: Flush bz2 data even if nothing had been written so far.
+
 - Patch #997284: Allow pydoc to work with XP Themes (.manifest file)
 
 - Patch #808719: Ignore locale's encoding in IDLE if it is an empty string.