Repository navigation
gh-159182: Preserve empty ranges in os.closerange - #159183
Open
youknowdot wants to merge 1 commit into
Open
youknowdot wants to merge 1 commit into
youknowdot wants to merge 1 commit into
Conversation
Member
|
We cnanot review unless the CI is signed. |
Member
|
@youknowone is it one of your accounts? |
youknowdot
force-pushed
the
gh-159182-closerange-empty
branch
from
October 12, 2026 00:26
b58cca4 to
2b9c948
Compare
Contributor
|
@picnixz hi, yes it is. this is mine. should i check policy about this? |
youknowdot
marked this pull request as ready for review
October 12, 2026 00:29
Member
|
yes every commits must be associated with an account that signed the CLA |
msullivan
reviewed
Oct 12, 2026
msullivan
left a comment
Contributor
There was a problem hiding this comment.
This looks right to me.
youknowdot
added a commit
to youknowdot/RustPython
that referenced
this pull request
Oct 16, 2026
Keep every RustPython closerange regression active. Exclude only the three documented negative or zero-upper-bound cases on CPython 3.15.0 final Linux builds with HAVE_CLOSE_RANGE, pending python/cpython#159183 for issue #159182. Positive empty, reversed and one-descriptor reference cases remain active; later versions run all cases. Assisted-by: OpenAI Codex:model version unavailable
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.
Fixes #159182.
Check that the exclusive upper bound is positive and greater than the lower bound before subtracting one and calling
_Py_closerange(). This keeps empty, inverted, and negative-only ranges as no-ops, avoidsfd_high - 1overflow forINT_MIN, and preserves the helper's handling of negative lower bounds for nonempty ranges.The regression runs each boundary case in a subprocess and checks an independently opened descriptor. It uses exit status rather than the child's standard streams, which the bug can close. Includes a NEWS entry.
Validation on Linux x86-64, with a debug build based on current
main(e878e1e9688ebaafbfae700a872fa30a9f86a4c4):./python -m unittest -v test.test_os.test_os.FileTests: 23 tests, 3 platform-specific skips, otherwise passing.HAVE_CLOSE_RANGEundefined, recompiling both affected translation units and relinking, also passes these tests.AI assistance was used to investigate, implement, and test this change.