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'
This could be made a function, so both the tests that need to compare the version could re-use it.
Bug report
Bug description:
Hello. Fedora is switching from zlib to zlib-ng. https://fedoraproject.org/wiki/Changes/ZlibNGTransition
zlib-ng defines
ZLIB_VERSIONas"1.3.0.zlib-ng":https://github.com/zlib-ng/zlib-ng/blob/f3211aba349a1d4781d0d41cb00d29fb8325af06/zlib.h.in#L61
And
test.test_zlib.CompressObjectTestCase.test_flushesfails to parse it a sequence of dot-separated integers:cpython/Lib/test/test_zlib.py
Line 476 in 11d88a1
Another test in this file already handles this differently via 4c7108a:
cpython/Lib/test/test_zlib.py
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