mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-105808: Fix a regression introduced in GH-101251 (#105910)
Fix a regression introduced in pythonGH-101251, causing GzipFile.flush() to not flush the compressor (nor pass along the zip_mode argument).
This commit is contained in:
parent
7a56a4148c
commit
1858db7cbd
3 changed files with 52 additions and 1 deletions
|
@ -370,8 +370,9 @@ class GzipFile(_compression.BaseStream):
|
|||
def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH):
|
||||
self._check_not_closed()
|
||||
if self.mode == WRITE:
|
||||
# Ensure the compressor's buffer is flushed
|
||||
self._buffer.flush()
|
||||
# Ensure the compressor's buffer is flushed
|
||||
self.fileobj.write(self.compress.flush(zlib_mode))
|
||||
self.fileobj.flush()
|
||||
|
||||
def fileno(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue