mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Flush bz2 data even if nothing had been written so far. Fixes #1013882.
Will backport to 2.3.
This commit is contained in:
parent
70aa1f2095
commit
c234a52458
2 changed files with 9 additions and 3 deletions
|
@ -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":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue