Repository navigation
[GR-80815] Fix C API compatibility failures exposed by CPython tests. - #1278
Merged
Merged
Conversation
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.
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
force-pushed
the
ssindela/requires-testcapi
branch
from
November 3, 2026 15:01
1709beb to
bb0beb5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.