Title: Align POSIX control argument handling with Python 3.15 by youknowdot · Pull Request #9664 · RustPython/RustPython · GitHub
Open Graph Title: Align POSIX control argument handling with Python 3.15 by youknowdot · Pull Request #9664 · RustPython/RustPython
X Title: Align POSIX control argument handling with Python 3.15 by youknowdot · Pull Request #9664 · RustPython/RustPython
Description: 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.
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9664
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a589ddad-8ad1-c55e-f860-a7e62c6b9e13 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8758:1F927B:1493C3E:1B2ADD2:6B01F39B |
| html-safe-nonce | 50d14e609e35e0d2960f5edf98d1c083c3a6e6f8337aa3f7523b65f0edded969 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzU4OjFGOTI3QjoxNDkzQzNFOjFCMkFERDI6NkIwMUYzOUIiLCJ2aXNpdG9yX2lkIjoiNjA1MTA5Mzc1MzQxNzAzNjcwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e47fd38498dd700f69720b41d019e0d969b5e8eeeed6e4bfbe9cadb89d57254e |
| hovercard-subject-tag | pull_request:5145622690 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9664/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width