From 6bc61b711bb0129ee02ac463fbd8fb09fdea587d Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Wed, 18 Jun 2025 01:12:50 +0800 Subject: [PATCH 1/3] Remove unneeded `zlib` dependency for testing `zipfile.crc32` is internally `zlib.crc32` and fallbacks to `binacsii.crc32` when `zlib.crc32` is not available. Both of them do the same task. `create_zipfile_with_extra_data` only calls `crc32` and does not actually require the decompression method provided by `zlib`. Use `zipfile.crc32` rather than `zlib.crc32` to allow the test to run on platforms without `zlib` support. --- Lib/test/test_zipfile/test_core.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index c0f3efaf0921da..4f20209927e7b3 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -4089,8 +4089,7 @@ def create_zipfile_with_extra_data(self, filename, extra_data_name): tag_for_unicode_path = b'\x75\x70' version_of_unicode_path = b'\x01' - import zlib - filename_crc = struct.pack(' Date: Sun, 21 Jun 2026 17:28:07 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst diff --git a/Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst b/Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst new file mode 100644 index 00000000000000..e71bfb2b1342bc --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst @@ -0,0 +1 @@ +Remove unneeded ``zlib`` dependency in some ``zipfile`` tests. From aa214763c7aecfa33274701d9c18b2a019765b42 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Mon, 22 Jun 2026 08:36:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Revert=20"=F0=9F=93=9C=F0=9F=A4=96=20Added?= =?UTF-8?q?=20by=20blurb=5Fit."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e1f43deaf0ab2d91b0226f6402af9ea946876051. --- .../next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst diff --git a/Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst b/Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst deleted file mode 100644 index e71bfb2b1342bc..00000000000000 --- a/Misc/NEWS.d/next/Tests/2026-06-21-17-28-00.gh-issue-151866.i3ZXyd.rst +++ /dev/null @@ -1 +0,0 @@ -Remove unneeded ``zlib`` dependency in some ``zipfile`` tests.