From d4892129d50ef00474b756dd5a235ac8f4323520 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 19 Sep 2026 18:39:21 +0100 Subject: [PATCH 1/3] Soft deprecate `zlib.ZLIB_RUNTIME_VERSION` --- Doc/deprecations/soft-deprecations.rst | 4 ++++ Doc/library/zlib.rst | 15 ++++++++++----- Doc/whatsnew/3.16.rst | 6 ++++++ ...2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst | 2 ++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst diff --git a/Doc/deprecations/soft-deprecations.rst b/Doc/deprecations/soft-deprecations.rst index a270052788ef2a..320a6d0b1a123e 100644 --- a/Doc/deprecations/soft-deprecations.rst +++ b/Doc/deprecations/soft-deprecations.rst @@ -19,3 +19,7 @@ There are no plans to remove :term:`soft deprecated` APIs. (Contributed by Gregory P. Smith in :gh:`86519` and Hugo van Kemenade in :gh:`148100`.) + +* :const:`zlib.ZLIB_RUNTIME_VERSION` is now :term:`soft deprecated` + in favor of :const:`zlib.zlib_version`. + (Contributed by Stan Ulbrych in :gh:`117404`.) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst index 5035fa27fb6c1b..cce744a3011f2c 100644 --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -482,16 +482,21 @@ the following constants: is available as :const:`zlib_version`. -.. data:: ZLIB_RUNTIME_VERSION - zlib_version +.. data:: zlib_version The version string of the zlib library actually loaded by the interpreter. + .. versionadded:: next + + +.. data:: ZLIB_RUNTIME_VERSION + + An alias of :const:`zlib_version`. + .. versionadded:: 3.3 - The :const:`!ZLIB_RUNTIME_VERSION` constant. - .. versionadded:: next - The :const:`!zlib_version` alias. + .. soft-deprecated:: next + Use :const:`zlib_version` instead. .. data:: ZLIB_VERSION_INFO diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 7e02924babe952..751a8789046493 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -966,6 +966,12 @@ New deprecations open them one by one instead. (Contributed by Serhiy Storchaka in :gh:`152638`.) +* :mod:`zlib`: + + * :const:`zlib.ZLIB_RUNTIME_VERSION` is now :term:`soft deprecated` + in favor of :const:`zlib.zlib_version`. + (Contributed by Stan Ulbrych in :gh:`117404`.) + .. Add deprecations above alphabetically, not here at the end. .. include:: ../deprecations/pending-removal-in-3.17.rst diff --git a/Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst b/Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst new file mode 100644 index 00000000000000..39855fb981b33d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst @@ -0,0 +1,2 @@ +Soft deprecate :const:`zlib.ZLIB_RUNTIME_VERSION` in favor of +:const:`zlib.zlib_version`. From f154147614887d1708762f796e6b1f81ce93ad46 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 21 Sep 2026 18:09:52 +0100 Subject: [PATCH 2/3] Revert "Soft deprecate `zlib.ZLIB_RUNTIME_VERSION`" This reverts commit d4892129d50ef00474b756dd5a235ac8f4323520. --- Doc/deprecations/soft-deprecations.rst | 4 ---- Doc/library/zlib.rst | 15 +++++---------- Doc/whatsnew/3.16.rst | 6 ------ ...2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst | 2 -- 4 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst diff --git a/Doc/deprecations/soft-deprecations.rst b/Doc/deprecations/soft-deprecations.rst index 320a6d0b1a123e..a270052788ef2a 100644 --- a/Doc/deprecations/soft-deprecations.rst +++ b/Doc/deprecations/soft-deprecations.rst @@ -19,7 +19,3 @@ There are no plans to remove :term:`soft deprecated` APIs. (Contributed by Gregory P. Smith in :gh:`86519` and Hugo van Kemenade in :gh:`148100`.) - -* :const:`zlib.ZLIB_RUNTIME_VERSION` is now :term:`soft deprecated` - in favor of :const:`zlib.zlib_version`. - (Contributed by Stan Ulbrych in :gh:`117404`.) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst index cce744a3011f2c..5035fa27fb6c1b 100644 --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -482,21 +482,16 @@ the following constants: is available as :const:`zlib_version`. -.. data:: zlib_version - - The version string of the zlib library actually loaded by the interpreter. - - .. versionadded:: next - - .. data:: ZLIB_RUNTIME_VERSION + zlib_version - An alias of :const:`zlib_version`. + The version string of the zlib library actually loaded by the interpreter. .. versionadded:: 3.3 + The :const:`!ZLIB_RUNTIME_VERSION` constant. - .. soft-deprecated:: next - Use :const:`zlib_version` instead. + .. versionadded:: next + The :const:`!zlib_version` alias. .. data:: ZLIB_VERSION_INFO diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 751a8789046493..7e02924babe952 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -966,12 +966,6 @@ New deprecations open them one by one instead. (Contributed by Serhiy Storchaka in :gh:`152638`.) -* :mod:`zlib`: - - * :const:`zlib.ZLIB_RUNTIME_VERSION` is now :term:`soft deprecated` - in favor of :const:`zlib.zlib_version`. - (Contributed by Stan Ulbrych in :gh:`117404`.) - .. Add deprecations above alphabetically, not here at the end. .. include:: ../deprecations/pending-removal-in-3.17.rst diff --git a/Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst b/Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst deleted file mode 100644 index 39855fb981b33d..00000000000000 --- a/Misc/NEWS.d/next/Library/2026-09-19-18-38-10.gh-issue-117404.sDzL9k.rst +++ /dev/null @@ -1,2 +0,0 @@ -Soft deprecate :const:`zlib.ZLIB_RUNTIME_VERSION` in favor of -:const:`zlib.zlib_version`. From 987d47848388f3f86976ca6d2e360ffde97564e8 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 21 Sep 2026 18:12:28 +0100 Subject: [PATCH 3/3] Document preference for `zlib_version` instead. --- Doc/library/zlib.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst index 5035fa27fb6c1b..99957a7ca268c2 100644 --- a/Doc/library/zlib.rst +++ b/Doc/library/zlib.rst @@ -487,11 +487,14 @@ the following constants: The version string of the zlib library actually loaded by the interpreter. + Prefer :const:`!zlib_version` over its :const:`!ZLIB_RUNTIME_VERSION` alias. + .. versionadded:: 3.3 The :const:`!ZLIB_RUNTIME_VERSION` constant. .. versionadded:: next - The :const:`!zlib_version` alias. + The :const:`!zlib_version` constant; :const:`!ZLIB_RUNTIME_VERSION` is now + an alias for it. .. data:: ZLIB_VERSION_INFO