Repository navigation
Align OS callable signatures and argument conversions - #9536
Conversation
Match actual defaults, names and keyword acceptance for the reported OS callables. Preserve explicit recursive None until delayed truth conversion, use the integer mmap size default, and match signed C-int syscall arguments. Keep ownership and host operations unchanged. Enable existing detailed CI signature output for head-bound comparison; local native execution remains unverified. Assisted-by: OpenAI Codex:model version not exposed
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Standard-library argument handling crates/stdlib/src/_remote_debugging.rs, crates/stdlib/src/mmap.rs, crates/stdlib/src/select.rs, crates/stdlib/src/socket.rs |
get_child_pids declares a True default for recursive. FlushOptions.size defaults to -1, which represents the remaining mapping length; other negative sizes are rejected. Epoll argument declarations use explicit defaults and an argument structure. Socket send and sendall bind positional data and defaulted positional flags through SendArgs. |
VM standard-library argument handling crates/vm/src/stdlib/_signal.rs, crates/vm/src/stdlib/os.rs, crates/vm/src/stdlib/posix.rs |
pidfd_send_signal, pidfd_open, and getrandom use argument structures with defaulted flags. pidfd_send_signal passes the raw signal number and casts flags to u32. copy_file_range updates argument kinds and offset defaults. The scheduler functions explicitly name param. |
CI signature check .github/workflows/ci.yaml |
The whats_left.py invocation adds --signature. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related issues
- RustPython/RustPython issue 6839 — The issue describes standard-library alignment with CPython 3.15, and this change updates argument contracts for several standard-library APIs.
Suggested reviewers: shaharnaveh, joshuamegnauth54
Merge Risk: 
Minimal · up to 42b51
-
No actionable merge-blocking issue is established for these signature and argument-conversion updates. Merge after normal CI checks pass.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 7 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Merging this PR will not alter performance
Comparing Footnotes
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Address twelve concrete
whats_leftsignature mismatches from #9530's Ubuntu report (head68646843423633e60bd54c6d4150db953b303804, CPython 3.15.0), with corresponding argument declarations rather than arbitrary signature strings:get_child_pids,mmap.flush, epollpoll/__exit__, socketsend/sendall,pidfd_send_signal, scheduler setters,getrandom,pidfd_open, andcopy_file_range.getrandom,pidfd_open, andcopy_file_range.recursive=Noneuntil boolean conversion after pid conversion; rejectmmap.flush(..., None)through its integer converter; use signed C-int flags forgetrandom/pidfd_send_signal; allow raw C-int signal numbers, including zero, forpidfd_send_signalwithout weakening other APIs'SignalNuminvariant.--signatureflag to the existing CI comparison so the exact after-head report can measure the proposed reductions. It only prints results already computed; no extra scan/import/run is introduced.Source contracts
CPython reference:
d220409a/ Python 3.15.0.Modules/clinic/posixmodule.c.h: keyword acceptance and signedgetrandomversus unsignedpidfd_openflags.Modules/_remote_debugging/clinic/module.c.h: pid conversion beforePyObject_IsTrue(recursive); omitted recursive defaults to true.Modules/clinic/mmapmodule.c.h: size is an integer with default -1, not a nullable size.Modules/clinic/signalmodule.c.h: raw C-int signal number/flags and raw optional siginfo.No FD ownership, host helper, or unsafe block is rewritten. Socket buffer conversion/borrow sequencing and signal siginfo validation remain scoped to their existing paths.
Validation and limits
Independent source review, normal hooks, and
git diff --checkpassed. Local compile/unit/interpreter tests were not run because the dependency-cache/network bootstrap blocker remains. Existing CI and the exact-head signature report must validate this Draft; twelve removals are an expectation, not a measured result yet.This does not claim full CPython syscall or error-priority compatibility. Existing
copy_file_rangeraw-FD conversion and count/offset error-order differences,getrandomnegative-size errno/EINTR behavior, and remaining epoll/sched_param report items are outside this patch. No custom signal/FD probes, assertions, Lib edits, or snippet additions are included.Summary by CodeRabbit