Repository navigation
Fix closerange empty ranges before unsigned conversion - #9031
Draft
youknowdot wants to merge 4 commits into
Draft
youknowdot wants to merge 4 commits into
youknowdot wants to merge 4 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
Merge current main without rewriting the existing branch. Preserve the exact closerange implementation and existing subprocess regression, while removing the already-landed PyO3 benchmark import correction from the PR diff. AI assistance: dot prepared and reviewed this refresh under maintainer direction. The runtime does not expose its exact model version. Assisted-by: dot: model version not exposed
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 an empty range with a zero upper bound can convert -1 to UINT_MAX and close every descriptor; other equal bounds must also be no-ops.Refresh the existing PR by merging main
df0d1b74c04408365f66666a03054d673dbccee7append-only. The current-main diff contains only the Rust fix and its existing subprocess regression; the previously shared PyO3 benchmark-import correction is already on main and no longer appears in this PR's diff. No new tests, skips, or Lib changes are introduced by this refresh.Regression coverage and reference limitation
The existing
stdlib_os.pysnippet runs the closerange regression in a child process. All RustPython no-op cases remain active:(0, 0),(-1, 0), positive equal bounds, positive reversed bounds, and(-2, -1). The single-descriptor case verifies adjacent descriptors remain open.The exact CPython 3.15.0 Linux reference artifact reproduced python/cpython#159182; upstream fix #159183 remains open at this refresh. The existing guard excludes only the three documented zero/negative-upper-bound cases on CPython 3.15.0 final, Linux, with
HAVE_CLOSE_RANGE. Other reference cases and all RustPython cases remain active. This refresh does not alter that guard or any assertion.Validation
stdlib_os.pysnippet are byte-identical to previously tested PR head5bc1814470459db99366b67e855c71d58d2f414c.Lib/test/test_oscloserange tests do not cover the empty/equal-bound regression; no duplicate snippet coverage was added during this refresh.cargo checkand strictcargo clippy -- -D warningsforrustpython-host_env --libpassed against the current-main composition (locked, offline, Linux target, fresh target directory). Input closure verification passed before and after both checks.xml; a separate cache populated with normal locked Cargo fetch resolved it without changing dependencies orCargo.lock.335a575a7e202501f683e1d07e945ed7fa44542b: merge-conflict and rustfmt passed; Ruff, redundant-test-patches and Prettier selected no files. Only cspell was excluded with the maintainer-authorized one-commit exception because its dependency setup was blocked. This is not a cspell pass.335a575a7e202501f683e1d07e945ed7fa44542b: all 24 jobs passed, including Linux/macOS/Windows snippets and CPython tests and Rust tests. The Lib Dependencies Check workflow does not apply because this PR changes noLib/**files.AI assistance: dot inspected, prepared and reviewed the current-main refresh under maintainer direction. The runtime does not expose its exact model version.