From f6b9d64550cbe07eb39621ed448a1768a26a08c8 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:00:29 +0000 Subject: [PATCH 1/6] Modify ZLIBNG_VERSION condition for Windows Update condition for ZLIBNG_VERSION availability. --- stdlib/zlib.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/zlib.pyi b/stdlib/zlib.pyi index 4e410fdd18ad..d5998cab90fe 100644 --- a/stdlib/zlib.pyi +++ b/stdlib/zlib.pyi @@ -26,8 +26,8 @@ Z_RLE: Final = 3 Z_SYNC_FLUSH: Final = 2 Z_TREES: Final = 6 -if sys.version_info >= (3, 14) and sys.platform == "win32": - # Available when zlib was built with zlib-ng, usually only on Windows +if sys.version_info >= (3, 14): + # Available when zlib was built with zlib-ng ZLIBNG_VERSION: Final[str] class error(Exception): ... From e1ebbd2cbcbe93e118d2145bb35fa0901dd99a75 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:10:39 +0000 Subject: [PATCH 2/6] Commit --- stdlib/zlib.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/zlib.pyi b/stdlib/zlib.pyi index d5998cab90fe..855f5cf36fd4 100644 --- a/stdlib/zlib.pyi +++ b/stdlib/zlib.pyi @@ -28,7 +28,7 @@ Z_TREES: Final = 6 if sys.version_info >= (3, 14): # Available when zlib was built with zlib-ng - ZLIBNG_VERSION: Final[str] + ZLIBNG_VERSION: Final[str] # type: ignore[attr-defined] class error(Exception): ... From 8dd58d36534fcc83a5bd91838be30b3867043fe6 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:17:43 +0000 Subject: [PATCH 3/6] Commit --- stdlib/@tests/stubtest_allowlists/common.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index b697bbb6dee4..96ca3994e431 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -170,6 +170,9 @@ sys.ps1 # Available in interactive mode sys.ps2 # Available in interactive mode sys.tracebacklimit # Must be set first +# This depends on how Python was built +zlib.ZLIBNG_VERSION + # ========================================================== # Other allowlist entries that cannot or should not be fixed From f47933cae4ba20b9f142e0d65cf210778f9ecfde Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 30 Oct 2025 11:25:00 +0000 Subject: [PATCH 4/6] Fix allowlist --- stdlib/@tests/stubtest_allowlists/common.txt | 3 --- stdlib/@tests/stubtest_allowlists/py314.txt | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 96ca3994e431..b697bbb6dee4 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -170,9 +170,6 @@ sys.ps1 # Available in interactive mode sys.ps2 # Available in interactive mode sys.tracebacklimit # Must be set first -# This depends on how Python was built -zlib.ZLIBNG_VERSION - # ========================================================== # Other allowlist entries that cannot or should not be fixed diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 0fcdcbb84d97..b8af7d2e6071 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -159,6 +159,10 @@ multiprocessing.managers._BaseSetProxy.pop (_?hashlib.(openssl_)?shake_128)? (_?hashlib.(openssl_)?shake_256)? +# These depend on how Python was built and may not always be available +zlib.ZLIBNG_VERSION +compression.zlib.ZLIBNG_VERSION + # ============================================================= # Allowlist entries that cannot or should not be fixed; >= 3.13 From f77f93ba537c5a5fd8bc6aff5eb46d35dc6bd89c Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 30 Oct 2025 11:26:00 +0000 Subject: [PATCH 5/6] Review --- stdlib/@tests/stubtest_allowlists/common.txt | 3 +++ stdlib/@tests/stubtest_allowlists/py314.txt | 4 ---- stdlib/zlib.pyi | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index b697bbb6dee4..55642b8df089 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -170,6 +170,9 @@ sys.ps1 # Available in interactive mode sys.ps2 # Available in interactive mode sys.tracebacklimit # Must be set first +# This is only present if Python was built with zlib-ng. +(zlib\.ZLIBNG_VERSION)? + # ========================================================== # Other allowlist entries that cannot or should not be fixed diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index b8af7d2e6071..0fcdcbb84d97 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -159,10 +159,6 @@ multiprocessing.managers._BaseSetProxy.pop (_?hashlib.(openssl_)?shake_128)? (_?hashlib.(openssl_)?shake_256)? -# These depend on how Python was built and may not always be available -zlib.ZLIBNG_VERSION -compression.zlib.ZLIBNG_VERSION - # ============================================================= # Allowlist entries that cannot or should not be fixed; >= 3.13 diff --git a/stdlib/zlib.pyi b/stdlib/zlib.pyi index 855f5cf36fd4..d5998cab90fe 100644 --- a/stdlib/zlib.pyi +++ b/stdlib/zlib.pyi @@ -28,7 +28,7 @@ Z_TREES: Final = 6 if sys.version_info >= (3, 14): # Available when zlib was built with zlib-ng - ZLIBNG_VERSION: Final[str] # type: ignore[attr-defined] + ZLIBNG_VERSION: Final[str] class error(Exception): ... From 72b39c33524a1f28669e7a96d1a3ad33dfd4e625 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 30 Oct 2025 11:28:28 +0000 Subject: [PATCH 6/6] compression too --- stdlib/@tests/stubtest_allowlists/common.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 55642b8df089..1e50be185b03 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -172,6 +172,7 @@ sys.tracebacklimit # Must be set first # This is only present if Python was built with zlib-ng. (zlib\.ZLIBNG_VERSION)? +(compression\.zlib\.ZLIBNG_VERSION)? # ==========================================================