GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.13] gh-159015: Fix test_math import on musl by agners · Pull Request #159016 · python/cpython

Conversation

@agners

@agners agners commented Oct 8, 2026

Copy link
Copy Markdown

The 3.13 backport of gh-152563 (#155753) changed the skip condition of test_fma_zero_result to support.linked_to_musl() < (1, 2, 6). That works on main/3.14, where linked_to_musl() returns the musl version tuple (gh-90548). On 3.13 it still returns a bool, so on musl the condition raises TypeError while the class is being defined. test_math then fails to import, and test_cmath (which imports from it) fails too. This breaks --enable-optimizations builds of 3.13.16 on Alpine.

This PR restores the previous condition, so the test is skipped on musl again, as it was before 3.13.16. It's a 3.13-only fix; main and 3.14 are not affected.

cc @vstinner

  • Issue: 3.13.16: test_math fails to import on musl (linked_to_musl() returns bool, compared to tuple) #159015

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@agners @claude
[3.13] pythongh-159015: Fix test_math import on musl
c4e26d3
The 3.13 backport of pythongh-152563 compares the return value of
support.linked_to_musl() with a version tuple, but on 3.13 the helper
still returns a bool. On musl this raises TypeError at class definition
time, so test_math and test_cmath fail to import. Restore the previous
skip condition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@agners agners mentioned this pull request Oct 8, 2026
3.13.16: test_math fails to import on musl (linked_to_musl() returns bool, compared to tuple) #159015
Closed
@python-cla-bot

python-cla-bot Bot commented Oct 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting review tests Tests in the Lib/test dir labels Oct 8, 2026
vstinner
vstinner approved these changes Oct 8, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The issue #159015 prevents building Python with PGO on Alpine Linux, it's quite bad. IMO the issue is important enough to justify merging it in the 3.13 security-only branch.

@Yhg1s: Would you be ok to include this fix?

Currently, test_math fails this way on Alpine Linux:

~/python/3.13 # ./python -m test -v test_math 
...
test test_math crashed -- Traceback (most recent call last):
...
TypeError: '<' not supported between instances of 'bool' and 'tuple'

The only Alpine buildbot that we have didn't catch this major regression because it only runs on Python 3.14 and newer:

        cpw(
            name="ware-alpine",
            tags=['linux', 'unix', 'alpine', 'docker', 'amd64', 'x86-64', 'musl'],
            branches=BRANCHES.only_since(3, 14),
            parallel_tests=6,
        ),

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Oct 8, 2026
@Yhg1s
Yhg1s merged commit 2aa06a7 into python:3.13 Oct 25, 2026
45 of 46 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 25, 2026
agners added a commit to home-assistant/docker-base that referenced this pull request Oct 26, 2026
@agners @claude
Drop test_math musl patch for Python 3.13
2c3aeee
The fix has been merged upstream (python/cpython#159016) and is part of
Python 3.13.18.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sairon pushed a commit to home-assistant/docker-base that referenced this pull request Oct 26, 2026
@renovate @agners @claude
Update Python in base-python to 3.14.10/3.13.18/3.12.16 (#410)
669afcb
* Update Python in base-python to 3.14.10/3.13.18/3.12.16

* https://docs.python.org/release/3.14.10/whatsnew/changelog.html
* https://docs.python.org/release/3.13.18/whatsnew/changelog.html
* https://docs.python.org/release/3.12.16/whatsnew/changelog.html

* Drop test_math musl patch for Python 3.13

The fix has been merged upstream (python/cpython#159016) and is part of
Python 3.13.18.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Stefan Agner <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@agners @vstinner @Yhg1s
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.