Title: Align OS argument conversion and syscall handling with Python 3.15 by youknowdot · Pull Request #9146 · RustPython/RustPython · GitHub
Open Graph Title: Align OS argument conversion and syscall handling with Python 3.15 by youknowdot · Pull Request #9146 · RustPython/RustPython
X Title: Align OS argument conversion and syscall handling with Python 3.15 by youknowdot · Pull Request #9146 · RustPython/RustPython
Description: Summary Align OS argument conversion and timestamp protocols with CPython 3.15.0, preserving integer/ns semantics from #9116. Use raw-descriptor syscall entrypoints for Python-supplied descriptors; support Linux sendfile(offset=None), checked macOS headers/trailers and flags, canonical partial-success errors, and signal-aware EINTR retries. Add the Python-facing ftruncate/truncate audit events with canonical conversion ordering, retain Windows CRT errno handling, and update getlogin decoding/errno, Linux GNU NODEV, WASI chmod validation and fork-warning propagation. Import os.py and the final test_os package directly with update_lib from CPython d220409a13b77de7a6c30abe16ea90db01528edc. Preserve all five current test guards; retire the two legacy test modules through the reviewed package mapping. Rebased onto main at 9e18d7be6b90cec1fa01429a2955f1623dd53d4c, preserving the merged #9142 updater behavior. The CI repair adds six canonical test.support lines through an actual update_lib migrate invocation pinned to CPython d220409a13b77de7a6c30abe16ea90db01528edc: three root-user decorator assignments and two export names. Unrelated existing support helpers and customizations remain intact. The existing updater and its tests gain a narrowly scoped, hash-pinned selective test.support import mode with dependency and mode-conflict checks. This PR excludes closerange (#9031), mmap (#9141), getpath/sysconfig/venv and test_io changes. Validation Independent source/integration review and normal commit hooks passed. Current rebased head 948ebad7a7e6be094e63445fc13a9870527172de: All 238 updater host tests passed, including selective imports and unchanged preservation/default modes. A fresh matching narrow release build passed (threading,stdlib,stdio,importlib,host_env). Strict release Clippy passed for host_env and VM, all targets, with warnings denied. A bounded native import gate passed for test.support and the canonical test.test_os.test_os module, checking the imported helpers and root/non-root decorator flags/reasons in a non-root environment. Zero test bodies, loaders or fixtures were run. The exact copied binary, full source/Lib hashes, cache absence and loaded module origins were verified. The import ran with private cwd/TMP/cache and time/resource limits; its capability probes include disposable files/symlinks/xattrs, a localhost IPv6 bind and password-database enumeration. Historical focused runtime coverage on the original head 3f91766266469f922b44b32dbcbe630dbff591db: Nine fresh bounded canonical invocations: eight passed; getlogin skipped with ENOTTY because the environment has no login terminal. This is not validated login behavior. Complete source/Lib hashes, cache checks and module origins were verified before/after each case. Six test_os cases used AST-identical extracted methods/helpers and setup/cleanup rather than importing unrelated socket capability probes. Three PosixTester cases used the canonical leaf module. Those historical OS cases were not rerun on the rebased head. No broad OS suite, root-account execution or cross-platform local validation is claimed. Remaining differences and coverage limits Mutable sendfile buffers are snapshotted after argument/exporter conversion using RustPython's existing unlocked-buffer mechanism. CPython observes live buffers, so concurrent mutation semantics are not claimed identical. Shared integer overflow messages still name Rust primitive types. Pathname truncate still uses open/set_len, retaining existing permission/race/negative-length differences. The internal FileIO borrowed-descriptor helper remains unchanged. getlogin still copies libc's non-reentrant storage. Fork warnings occur after child creation; warning-as-error can hide the returned child/master descriptor, as in final CPython's ordering. No local signal injection, fork, concurrent mutation, invalid-FD or full sendfile fixture tests were run. macOS/Windows/WASI paths require hosted validation. An environment-dependent getlogin skip is reported separately from passes.
Open Graph Description: Summary Align OS argument conversion and timestamp protocols with CPython 3.15.0, preserving integer/ns semantics from #9116. Use raw-descriptor syscall entrypoints for Python-supplied descriptors...
X Description: Summary Align OS argument conversion and timestamp protocols with CPython 3.15.0, preserving integer/ns semantics from #9116. Use raw-descriptor syscall entrypoints for Python-supplied descriptors...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9146
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:b701e205-244e-db2b-bc50-495cf14eb9eb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8CC4:11EACE:3494EA0:46318A5:6B01FE92 |
| html-safe-nonce | 7d068005fdf44f55536ac8d0a06b85f751ca21ad0a39727e8681ee760914db11 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0M0OjExRUFDRTozNDk0RUEwOjQ2MzE4QTU6NkIwMUZFOTIiLCJ2aXNpdG9yX2lkIjoiNzcxOTQ5OTAwMjQxNjMzMjQzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 26e82756702202442343537c22c2aef3826942260e33b4989c894174d61be2d5 |
| hovercard-subject-tag | pull_request:4871015772 |
| 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/9146/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 OS argument conversion and timestamp protocols with CPython 3.15.0, preserving integer/ns semantics from #9116. Use raw-descriptor syscall entrypoints for Python-supplied descriptors... |
| 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