Repository navigation
Fix closerange empty ranges before unsigned conversion - #9031
Draft
youknowdot wants to merge 3 commits into
Draft
youknowdot wants to merge 3 commits into
youknowdot wants to merge 3 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
youknowdot
force-pushed
the
fix/closerange-empty-range
branch
2 times, most recently
from
October 11, 2026 03:01
7c27a9f to
0a3d05a
Compare
Contributor
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_mmap.py (TODO: 19) dependencies: dependent tests: (2 tests)
Legend:
|
youknowdot
force-pushed
the
fix/closerange-empty-range
branch
from
October 11, 2026 03:21
0a3d05a to
7ad6487
Compare
youknowdot
force-pushed
the
fix/closerange-empty-range
branch
from
October 11, 2026 04:07
7ad6487 to
e1a5bb2
Compare
youknowdot
force-pushed
the
fix/closerange-empty-range
branch
from
October 11, 2026 04:14
e1a5bb2 to
462147d
Compare
Return for equal bounds after clamping the lower bound. Retain subprocess-isolated Python regressions for empty, reversed, negative, and one-descriptor ranges. CPython builds with HAVE_CLOSE_RANGE retain the reference defect; do not weaken the regression. Assisted-by: OpenAI Codex:model version unavailable
Import PyCodeInput from the types module, the canonical location in PyO3 0.30. The old ffi re-export is deprecated and fails Clippy with warnings denied. Assisted-by: OpenAI Codex:model version unavailable
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
youknowdot
force-pushed
the
fix/closerange-empty-range
branch
from
October 16, 2026 04:13
462147d to
5bc1814
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.
Summary
Fix empty
os.closerange()ranges before converting the exclusive upper bound to an inclusive unsigned bound. After clamping the lower bound, equal bounds must return without callingclose_range(). Otherwise zero or negative upper bounds can close every descriptor.Rebased onto
fd5b30eb5e6c1dd24bb98a305b1c5f47fa64820d. This includes main's Python 3.15 TextIOWrapper assertion correction (#9082). The branch also carries the shared PyO3 0.30 benchmark import fix needed by strict Clippy. NoLib/changes or Rust behavioral regression tests are added.Regression coverage and CPython reference limitation
The existing
stdlib_os.pysnippet runs the closerange regression in a child process. Every RustPython no-op case remains active:(0, 0),(-1, 0), positive equal bounds, positive reversed bounds, and(-2, -1). The single-descriptor case also verifies adjacent descriptors remain open.The exact setup-python CPython 3.15.0 Linux artifact reproduces python/cpython#159182, with upstream fix #159183 still open. Unlike the earlier revision, this revision explicitly excludes the three documented zero/negative-upper-bound cases only on CPython 3.15.0 final, Linux, with
HAVE_CLOSE_RANGE. All other reference cases still execute. RustPython and Python 3.15.1+ are not excluded. The temporary exclusion cites the upstream issue and fix.Validation
stdlib_io.pypasses the exact CPython reference artifact.stdlib_osreaches a later sandbox-specific chown failure (EINVALinstead ofPermissionError); three multiprocessing failures were not investigated. No unrelated assertions were changed.stdlib_os.pyreaches the same later sandbox chown failure as CPython.AI assistance: OpenAI Codex rebased, implemented, reviewed, and tested this revision under maintainer direction. Model version unavailable.