-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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"
:
https://github.com/zlib-ng/zlib-ng/blob/f3211aba349a1d4781d0d41cb00d29fb8325af06/zlib.h.in#L61
And test.test_zlib.CompressObjectTestCase.test_flushes
fails to parse it a sequence of dot-separated integers:
Line 476 in 11d88a1
ver = tuple(int(v) for v in zlib.ZLIB_RUNTIME_VERSION.split('.')) |
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
v = zlib.ZLIB_RUNTIME_VERSION.split('-', 1)[0].split('.') | |
if len(v) < 4: | |
v.append('0') | |
elif not v[-1].isnumeric(): | |
v[-1] = '0' | |
v = tuple(map(int, v)) |
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
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error