From 15ca0b99dc428d3d6b0fab999caa315019952624 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 15 May 2024 11:49:54 -0400 Subject: [PATCH 1/2] Use values of READ and WRITE from the gzip module These changed from integers to mode strings in Python 3.13, and we need to remain consistent with the standard library. Fixes #44. Reference: https://docs.python.org/3.13/library/gzip.html#gzip.GzipFile.mode --- src/zlib_ng/gzip_ng.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zlib_ng/gzip_ng.py b/src/zlib_ng/gzip_ng.py index 33db4be..24b5512 100644 --- a/src/zlib_ng/gzip_ng.py +++ b/src/zlib_ng/gzip_ng.py @@ -41,7 +41,7 @@ READ_BUFFER_SIZE = 512 * 1024 FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16 -READ, WRITE = 1, 2 +READ, WRITE = gzip.READ, gzip.WRITE BadGzipFile = gzip.BadGzipFile # type: ignore From 04ff4988070e4cdf06f0e54d393395f54107b2b0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 15 May 2024 11:56:32 -0400 Subject: [PATCH 2/2] Add changelog entry for READ/WRITE fix --- CHANGELOG.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 742b50f..5d2c128 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,11 @@ Changelog .. This document is user facing. Please word the changes in such a way .. that users understand how the changes affect the new version. +version 0.5.0-dev +----------------- ++ Fix a bug where READ and WRITE in zlib_ng.gzip_ng were inconsistent with the + values in gzip on Python 3.13 + version 0.4.3 ----------------- + Fix a bug where files larger than 4GB could not be decompressed.