Closed
Description
Bug report
Bug description:
Hello. Fedora is switching from zlib to zlib-ng. https://fedoraproject.org/wiki/Changes/ZlibNGTransition
zlib-ng defines ZLIB_VERSION
as "1.3.0.zlib-ng"
:
And test.test_zlib.CompressObjectTestCase.test_flushes
fails to parse it a sequence of dot-separated integers:
Line 476 in 11d88a1
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-3.12.0/Lib/test/test_zlib.py", line 477, in test_flushes
ver = tuple(int(v) for v in zlib.ZLIB_RUNTIME_VERSION.split('.'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.12.0/Lib/test/test_zlib.py", line 477, in <genexpr>
ver = tuple(int(v) for v in zlib.ZLIB_RUNTIME_VERSION.split('.'))
^^^^^^
ValueError: invalid literal for int() with base 10: 'zlib-ng'
Another test in this file already handles this differently via 4c7108a:
Lines 798 to 804 in 11d88a1
This could be made a function, so both the tests that need to compare the version could re-use it.
CPython versions tested on:
3.12, 3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-112769: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix #112771
- [3.12] gh-112769: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) #112773
- [3.11] gh-112769: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) #112774
- [3.10] gh-112769: test_zlib: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) #119565
- [3.9] gh-112769: test_zlib: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) #119566
- [3.8] gh-112769: test_zlib: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) #119567