Title: Implement mkfifo with directory descriptor support by youknowdot · Pull Request #9056 · RustPython/RustPython · GitHub
Open Graph Title: Implement mkfifo with directory descriptor support by youknowdot · Pull Request #9056 · RustPython/RustPython
X Title: Implement mkfifo with directory descriptor support by youknowdot · Pull Request #9056 · RustPython/RustPython
Description: Current revision Targets Python 3.15 main with one logical commit: 5b251a5fecda927d37fcc238887362328c5c40b5, based on f39da82d9d38cd5bdceb9e645205e830f65126fb. Rebased once to include the merged shared I/O CI fix and intervening main changes. The unique patch has identical added/deleted lines and an unchanged range-diff; original author and assistance trailer are preserved. No Lib/ changes. Main's TextIOWrapper setter fix and this PR's FileIO open/EINTR changes are both preserved. Normal commit hooks, explicit changed-range hooks, and whitespace/source checks passed. No new local build or runtime test is claimed. Normal hosted CI on this exact head is pending; earlier validation below remains historical. Summary Extract the independent POSIX os.mkfifo implementation from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7) for the Python 3.15 target. Create FIFOs through the host layer, release interpreter execution during the syscall, and retry interrupted calls after checking signals. Support dir_fd with truthful capability reporting. Keep descriptors as raw C integers so absolute paths can correctly ignore negative descriptors without manufacturing an invalid borrowed descriptor. Resolve Apple's newer mkfifoat symbol at runtime, preserving ordinary mkfifo on older systems. Adapt the mega hunk with local path/mode converters and precise descriptor overflow messages. Retry EINTR in direct-path FileIO and os.open calls, honoring signal-handler exceptions. Enabling mkfifo exposes the previously skipped canonical FIFO-open cases. os.open carries directory descriptors as raw integers through a narrow host openat wrapper, without creating a Rust descriptor borrow across callbacks. Generic DirFd conversion and custom FileIO openers are unchanged. Duplicate review found no separate mkfifo implementation. #9054 changes chmod in the same files but owns different behavior. No changes from that open PR are required. References: CPython 3.14.7 implementation and argument parser. Initial mkfifo validation (96df674) Normal repository hooks passed. VM/host-layer Clippy and separately configured CAPI Clippy passed with -D warnings. Native build passed. The focused new function in the existing stdlib_os.py snippet passed; the baseline fails with missing os.mkfifo before any filesystem operation. All 27 bounded reference/native cases match CPython 3.14.7, including path/mode/descriptor conversion order, huge-integer bounds, absolute negative descriptors, errors without filenames, and warnings-as-errors before creation. Unchanged canonical PosixTester.test_mkfifo and TestPosixDirFd.test_mkfifo_dir_fd both passed in a private temporary working directory. All behavior checks are Python-side. Tests only create, stat and unlink FIFOs in owned temporary directories; they never open a FIFO, change umask, create devices, or target user/system paths. EINTR follow-up validation The initial hosted run failed both newly enabled canonical FIFO-open tests. The same failures reproduced locally in 0.26 seconds; they are not flaky-test skips. The fix follows CPython 3.14 FileIO retry handling and os.open retry handling, with a raw directory-descriptor boundary instead of mega's borrowed-descriptor lifetime across signal callbacks. Validated follow-up commit cadfd738f5e5ef6d38cf3e63b9a4573f41eaea6e: Independent raw-descriptor lifetime/ownership review and normal hooks passed. Native build, VM/host Clippy, and separately configured CAPI Clippy passed with -D warnings. Both previously failing canonical FIFO-open tests pass unchanged in 1.27 seconds, in a private temporary directory with an external hard timeout and subprocess cleanup. These tests intentionally open only their own FIFOs. Five additional unchanged canonical tests pass: mkfifo, mkfifo dir_fd, open dir_fd, FileIO seek/tell, and FileIO attributes. Native checks match exact CPython 3.14.7/3.14.8 for raising signal handlers in FileIO/open/openat, non-EINTR filename errors, single invocation of a failing custom opener, the public signature, valid index conversion order, str/bytes paths, and the None directory-descriptor default. No invalid/closed-descriptor probes or canonical test edits are part of this follow-up. Fresh hosted CI is required; the original-head EINTR failure is superseded only after the new head is validated. Scope and remaining limitations Android retains ordinary mkfifo but no dir_fd because the pinned libc crate has no Android mkfifoat binding. Redox remains excluded; Windows/WASI modules are unchanged. Apple ABI and availability were source-reviewed, but non-Linux runtime execution was not performed. The existing shared path converter still differs from CPython in the prefix of the error for an invalid __fspath__ return; its behavior was not duplicated or broadly rewritten here. Full stdlib_os.py, full workspace tests, and the complete canonical OS suite were not run locally; they include unrelated operations outside this bounded validation. Hosted CI remains required. No canonical assertions or skips were weakened, and no Rust behavior tests were added. Summary by CodeRabbit New Features Added os.mkfifo for creating named pipes, with support for paths, permissions, and directory descriptors where available. Added directory-descriptor support to os.open on supported platforms. Updated Python compatibility to 3.15. Bug Fixes File-opening operations now retry when interrupted, while still checking for pending signals. Improved handling of negative timestamps on Windows and integer-like values in logarithm and sleep operations. Corrected behavior for memory-mapped searches, struct format errors, and AST constructor validation.
Open Graph Description: Current revision Targets Python 3.15 main with one logical commit: 5b251a5fecda927d37fcc238887362328c5c40b5, based on f39da82d9d38cd5bdceb9e645205e830f65126fb. Rebased once to include the merged sh...
X Description: Current revision Targets Python 3.15 main with one logical commit: 5b251a5fecda927d37fcc238887362328c5c40b5, based on f39da82d9d38cd5bdceb9e645205e830f65126fb. Rebased once to include the merged sh...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9056
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:db08c70d-d57c-ff08-2e10-f633366e78be |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ECD4:16E4ED:4611C0:5848BB:6B01FE9C |
| html-safe-nonce | 12baba1c3fbae2bbd5507ed9bfeeac9cc85970f1976f5224ec6ff35fd7a9caa5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Q0OjE2RTRFRDo0NjExQzA6NTg0OEJCOjZCMDFGRTlDIiwidmlzaXRvcl9pZCI6Ijc3NjY3NTc1MjcyNzkzNjY2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0c52ac6f50b10e92a266fef2ff781934195a016c03b3c6f881b43eba0f257303 |
| hovercard-subject-tag | pull_request:4810629238 |
| 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/9056/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 | Current revision Targets Python 3.15 main with one logical commit: 5b251a5fecda927d37fcc238887362328c5c40b5, based on f39da82d9d38cd5bdceb9e645205e830f65126fb. Rebased once to include the merged sh... |
| 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