Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test.test_zlib.CompressObjectTestCase.test_flushes fails to parse ZLIB_VERSION with zlib-ng #112769

Closed
Labels
testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error
@hroncok

Description

@hroncok

Bug report

Bug description:

Hello. Fedora is switching from zlib to zlib-ng.https://fedoraproject.org/wiki/Changes/ZlibNGTransition

zlib-ng definesZLIB_VERSION as"1.3.0.zlib-ng":

https://github.com/zlib-ng/zlib-ng/blob/f3211aba349a1d4781d0d41cb00d29fb8325af06/zlib.h.in#L61

Andtest.test_zlib.CompressObjectTestCase.test_flushes fails to parse it a sequence of dot-separated integers:

ver=tuple(int(v)forvinzlib.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 via4c7108a:

v=zlib.ZLIB_RUNTIME_VERSION.split('-',1)[0].split('.')
iflen(v)<4:
v.append('0')
elifnotv[-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp