Skip to content

gh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled#152871

Merged
sobolevn merged 1 commit into
python:mainfrom
weixlu:decimal
Jul 3, 2026
Merged

gh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled#152871
sobolevn merged 1 commit into
python:mainfrom
weixlu:decimal

Conversation

@weixlu

@weixlu weixlu commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

As mentioned in #152870, there is compilation error about EXTRA_FUNCTIONALITY

Root cause

The Context.apply() wrapper (guarded by #ifdef EXTRA_FUNCTIONALITY) still calls _decimal_Context__apply() using its pre-Argument-Clinic signature. But since #73487 , the generated _decimal_Context__apply() is now a METH_FASTCALL wrapper with the signature (context, cls, args, nargs, kwnames), so the old call no longer compiles.

PR #142441 previously touched this line, but it fixed a typo, rather than the signature mismatch issue.

Test

After the fix, it builds correctly and the full test_decimal suite (including the C-only tests) passes.

@python-cla-bot

This comment was marked as resolved.

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we test this under @requires_extra_functionality?

@skirpichev skirpichev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, please add a simple test.

@weixlu

weixlu commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Sure, I have added a simple precision test.

  • It pass on EXTRA_FUNCTIONALITY build
  • It skip on regular build with message test requires build with -DEXTRA_FUNCTIONALITY

@skirpichev skirpichev self-requested a review July 3, 2026 03:08
@sobolevn sobolevn added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 3, 2026
@sobolevn sobolevn merged commit c473953 into python:main Jul 3, 2026
60 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @weixlu for the PR, and @sobolevn for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 3, 2026

Copy link
Copy Markdown

GH-152937 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 3, 2026
sobolevn pushed a commit that referenced this pull request Jul 3, 2026
…LITY enabled (GH-152871) (#152937)

gh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled (GH-152871)
(cherry picked from commit c473953)

Co-authored-by: Xiaowei Lu <weixlu420302@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants