diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-06-19 17:42:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 17:42:23 (GMT) |
commit | 225cc4c043aca472f0c7c78bed1a7524fae5c278 (patch) | |
tree | e0c6b01b347b088988df12206e432ebf0a89aadd /Lib/gzip.py | |
parent | 5e524ef34687899ed09b5a4c56568346e20f789e (diff) | |
download | cpython-225cc4c043aca472f0c7c78bed1a7524fae5c278.zip cpython-225cc4c043aca472f0c7c78bed1a7524fae5c278.tar.gz cpython-225cc4c043aca472f0c7c78bed1a7524fae5c278.tar.bz2 |
[3.12] GH-105808: Fix a regression introduced in GH-101251 (GH-105910) (#105920)
GH-105808: Fix a regression introduced in GH-101251 (GH-105910)
Fix a regression introduced in pythonGH-101251, causing GzipFile.flush() to
not flush the compressor (nor pass along the zip_mode argument).
(cherry picked from commit 1858db7cbdbf41aa600c954c15224307bf81a258)
Co-authored-by: T. Wouters <thomas@python.org>
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r-- | Lib/gzip.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index 8796c8d..cf8b675 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -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): |