GeezerVison is showing github.com — Align POSIX control argument handling with Python 3.15 by youknowdot · Pull Request #9664 · RustPython/RustPython
Conversation
youknowdot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Align the related fcntl/termios control argument paths with CPython 3.15 while reusing typed/derived binding and existing buffer/descriptor helpers.
- Prefer the integer protocol over buffer fallback in fcntl/ioctl and preserve conversion/exporter exceptions. Share unsigned-mask conversion and the 3.15 out-of-range DeprecationWarning behavior.
- Convert ioctl request and mutation flag before inspecting its argument, retain raw argument roots, release immutable exports before the syscall, and use the existing guarded scratch buffer for writable input without holding its lock across a detached syscall.
- Validate lockf arguments in CPython order and return None from flock/lockf.
- Convert termios descriptors before later arguments, read attribute-list fields after prior conversion callbacks, use native signed narrowing, and validate control characters before libc speed checks.
- Preserve sequential winsize conversion, I/O-before-range-check ordering, and existing pixel dimensions.
Only four production Rust files changed; no tests or snippets edited. Existing primitive integer conversion remains in use, so this does not introduce another per-function FuncArgs parser or duplicate shared argument machinery.
Reference
Compared against CPython v3.15.0 Modules/fcntlmodule.c, Modules/termios.c, their generated Clinic bindings, and Python/getargs.c.
Validation
Validated against base 0bdba72ff9a3ce7187798bb77ee6b5384481259c. Before publication, main advanced to 0b081b0283987c7b2d79327dd481f403d515580b with only unrelated Windows winreg changes (#9589). The four-file patch is identical against that newer main; the newer main was not locally rebuilt.
- Focused VM, host_env, and stdlib threading
cargo check --offline: passed.
- Matching strict
cargo clippy --offline -- -D warnings: passed.
- Independent source review, formatting,
git diff --check, and normal repository pre-commit hooks: passed.
- Bounded CPython 3.15 reference probes used owned temporary files and PTYs to check conversion/callback order, warning boundaries, None returns, and native narrowing. No real terminal settings or undersized ioctl buffers were used.
- Native RustPython execution, full workspace/C-API tests, and cross-platform builds were not run under the current task restrictions. Hosted CI remains required.
Generic C-int/C-long overflow diagnostic wording is unchanged. Platform-specific native layouts were reviewed in source but not exercised outside Linux.
AI assistance
OpenAI Codex assisted with source comparison, implementation, review, and validation. The model version is not exposed by this environment.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
coderabbitai
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Caution
Review failed
The pull request is closed.
- 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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will not alter performance
✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1
Comparing youknowdot:fix-posix-control-conversion-order-315 (e0e3258) with main (0b081b0)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
struct FcntlArg {
|
|
|
#[pyarg(positional, default = 0)]
|
|
|
arg: Either<ArgStrOrBytesLike, ArgIndex>,
|
|
|
arg: PyObjectRef,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check this change is necessary after #9563
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Preserve fcntl and ioctl protocol precedence, unsigned warnings, buffer lifetimes and guards. Align lockf and termios conversion order, native narrowing, and return values using existing argument binding and host helpers.
Assisted-by: OpenAI Codex:model version not exposed
Widen BSD-family c_short lock constants to the shared c_int result while retaining checked flock-field conversion.
Assisted-by: OpenAI Codex:model version not exposed
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-09T14:15:32.298556Z |
4712df2 |
Draft marked ready |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|