From: Martin v. Löwis Date: Sun, 22 Aug 2004 21:30:04 +0000 (+0000) Subject: Flush bz2 data even if nothing had been written so far. Fixes #1013882 X-Git-Tag: v2.3.5c1~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7eacf7f48c7d7f2e0b72615c4430c3fbfbd57acd;p=thirdparty%2FPython%2Fcpython.git Flush bz2 data even if nothing had been written so far. Fixes #1013882 --- diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 45fe03c043bf..327ba365e605 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -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": diff --git a/Misc/NEWS b/Misc/NEWS index 502baa88c757..c274000af823 100644 --- 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.