Skip to content

[GR-80815] Fix C API compatibility failures exposed by CPython tests. - #1278

Merged
graalvmbot merged 13 commits into
masterfrom
ssindela/requires-testcapi
Nov 3, 2026
Merged

graalvmbot merged 13 commits into
masterfrom
ssindela/requires-testcapi

Conversation

@graalvmbot

Copy link
Copy Markdown
Collaborator

No description provided.

PyUnicode_New(0, invalid_maxchar) incorrectly raised SystemError. Return the empty string before choosing the native character width, matching the size-zero fast path in CPython.
PyUnicode_FindChar passed invalid UCS4 values to chr(), leaving an exception pending and aborting the native fixture. Return -1 without an exception when the character exceeds the Unicode range.
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 3, 2026
Valid Py_ssize_t counts overflowed the int-based string nodes. Saturate them when entering PyUnicode_Split and PyUnicode_Replace, preserving unlimited negative counts.
htons() and ntohs() retained the old deprecation warning and silently
truncated integers above 65535, while CPython now raises OverflowError.
C-API unraisable exceptions without a traceback lost their call site, and
the default hook truncated qualified class names and printed __main__.
Custom-hook failures discarded the exception and wrote to host stderr.

Synthesize a current-frame traceback when needed, use qualified type
names, and route missing or failing hooks through the builtin default
reporter on sys.stderr. Keep this fallback independent of the mutable
sys.__unraisablehook__ attribute and ignore failures while reporting.
@graalvmbot
graalvmbot force-pushed the ssindela/requires-testcapi branch from 1709beb to bb0beb5 Compare November 3, 2026 15:01
@graalvmbot
graalvmbot merged commit 13f3504 into master Nov 3, 2026
41 of 45 checks passed
@graalvmbot
graalvmbot deleted the ssindela/requires-testcapi branch November 3, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants