Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-112769: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix #112771

Merged
merged 1 commit into from Dec 5, 2023

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Dec 5, 2023

zlib-ng defines the version as "1.3.0.zlib-ng".

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

test.test_zlib.CompressObjectTestCase.test_flushes blew up with:

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 reuses logic from another test.

Fixes #112769

…th non-int suffix

zlib-ng defines the version as "1.3.0.zlib-ng".

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

test.test_zlib.CompressObjectTestCase.test_flushes blew up with:

    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 reuses logic from another test.

Fixes python#112769
@serhiy-storchaka serhiy-storchaka added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Dec 5, 2023
@serhiy-storchaka serhiy-storchaka merged commit d384813 into python:main Dec 5, 2023
35 checks passed
@miss-islington-app
Copy link

Thanks @hroncok for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-app
Copy link

bedevere-app bot commented Dec 5, 2023

GH-112773 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 5, 2023
…th non-int suffix (pythonGH-112771)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 5, 2023
@bedevere-app
Copy link

bedevere-app bot commented Dec 5, 2023

GH-112774 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 5, 2023
…th non-int suffix (pythonGH-112771)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 5, 2023
@hroncok hroncok deleted the zlib-ng-version branch December 5, 2023 19:40
@hroncok
Copy link
Contributor Author

hroncok commented Dec 5, 2023

Thanks @serhiy-storchaka

serhiy-storchaka pushed a commit that referenced this pull request Dec 5, 2023
…ith non-int suffix (GH-112771) (GH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
serhiy-storchaka pushed a commit that referenced this pull request Dec 5, 2023
…ith non-int suffix (GH-112771) (GH-112773)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
befeleme pushed a commit to fedora-python/cpython that referenced this pull request Jan 25, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
befeleme pushed a commit to fedora-python/cpython that referenced this pull request Jan 25, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
befeleme pushed a commit to fedora-python/cpython that referenced this pull request Jan 25, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
befeleme pushed a commit to fedora-python/cpython that referenced this pull request Jan 25, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
befeleme pushed a commit to fedora-python/cpython that referenced this pull request Jan 25, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…th non-int suffix (pythonGH-112771)

zlib-ng defines the version as "1.3.0.zlib-ng".
stratakis pushed a commit to stratakis/cpython that referenced this pull request Feb 27, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
hroncok added a commit to fedora-python/cpython that referenced this pull request Mar 7, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 11, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 11, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
hrnciar pushed a commit to fedora-python/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 20, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
stratakis pushed a commit to stratakis/cpython that referenced this pull request Mar 25, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
hroncok added a commit to fedora-python/cpython that referenced this pull request Mar 26, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
mcepl pushed a commit to openSUSE-Python/cpython that referenced this pull request Apr 2, 2024
…SION with non-int suffix (pythonGH-112771) (pythonGH-112774)

zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test.test_zlib.CompressObjectTestCase.test_flushes fails to parse ZLIB_VERSION with zlib-ng
2 participants