GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Align POSIX control argument handling with Python 3.15 by youknowdot · Pull Request #9664 · RustPython/RustPython

Conversation

@youknowdot

@youknowdot youknowdot commented Nov 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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
All reactions
  • 👍 1 reaction
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone reviewed Nov 6, 2026
View reviewed changes
Comment thread crates/stdlib/src/fcntl.rs
struct FcntlArg {
#[pyarg(positional, default = 0)]
arg: Either<ArgStrOrBytesLike, ArgIndex>,
arg: PyObjectRef,

@youknowone youknowone Nov 6, 2026

Copy link
Copy Markdown
Member

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.

All reactions
youknowdot added 2 commits November 7, 2026 22:13
@youknowdot @codex
Align POSIX control argument conversion with Python 3.15
105e793
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
@youknowdot @codex
Normalize platform lock constant types
4712df2
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
@youknowdot
youknowdot force-pushed the fix-posix-control-conversion-order-315 branch from 3efe056 to 4712df2 Compare November 7, 2026 15:46
youknowone
youknowone approved these changes Nov 8, 2026
View reviewed changes
youknowone
youknowone approved these changes Nov 9, 2026
View reviewed changes
@youknowone
youknowone marked this pull request as ready for review November 9, 2026 14:11
@youknowone
youknowone merged commit 172130a into RustPython:main Nov 9, 2026
28 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

2 participants

@youknowdot @youknowone
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.