Title: Support directory descriptors in chmod by youknowdot · Pull Request #9054 · RustPython/RustPython · GitHub
Open Graph Title: Support directory descriptors in chmod by youknowdot · Pull Request #9054 · RustPython/RustPython
X Title: Support directory descriptors in chmod by youknowdot · Pull Request #9054 · RustPython/RustPython
Description: Summary Extract the independent Unix chmod(dir_fd=...) support from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7) onto Python 3.14 main (3af5f8a15314446d2b28a90e429c938dc7b8beeb). Route relative directory-descriptor operations through the existing host fchmodat wrapper and report the implemented fd/dir_fd capabilities. Preserve filename-bearing OS errors and CPython's nofollow unsupported-error distinctions. Use a chmod-local signed C-int converter, so absolute paths can ignore negative directory descriptors as CPython does, without constructing an invalid borrowed descriptor or changing shared converters. Preserve merged #8968's signature, existing integer-path fchmod dispatch, macOS/BSD lchmod dispatch, and Redox fallback. Windows and WASI paths are unchanged. Reference: CPython 3.14.7 chmod implementation and capability construction. Source and runtime agree that successfully parsed dir_fd/follow_symlinks values are ignored for an integer path in 3.14, despite contradictory docstring wording; this patch preserves that behavior. Existing mode parsing and broader unrelated chmod differences are not rewritten. Current open/merged searches found no dedicated duplicate. #8968 and the earlier integer-fd support remain intact. No host dependency or shared conversion changes are required. Validation Exact CPython 3.14.7 and this native head pass the newly added function from the existing os snippet. Unchanged main fails its capability assertion. All 17 bounded reference/native cases match exactly, including negative C-int endpoints, relative EBADF/filename, nofollow results, integer-path combinations, bool warnings, overflow diagnostics and index exceptions. Six unchanged canonical chmod tests pass in a fresh private working directory, including TestPosixDirFd.test_chmod_dir_fd, file/directory/fd and symlink cases. Existing builtin_signature.py passes unchanged. Every chmod probe targets only freshly created private temporary files, directories, symlinks or owned descriptors. The broader os snippet and POSIX suite were not run locally because they contain unrelated actions; no assertions or skip markers were weakened. Independent source audit, normal repository hooks, VM Clippy and separate C-API Clippy pass. Native validation is Linux-only. Other platform conclusions are source-reviewed, not execution claims; full hosted CI is pending. No Rust behavioral tests, implementation-name guards or README changes. This remains a draft for review. AI-assisted implementation and validation with OpenAI Codex; model identifier unavailable. No human review is implied.
Open Graph Description: Summary Extract the independent Unix chmod(dir_fd=...) support from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7) onto Python 3.14 main (3af5f8a15314446d2b28a90e429c938dc7b8beeb). Route relativ...
X Description: Summary Extract the independent Unix chmod(dir_fd=...) support from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7) onto Python 3.14 main (3af5f8a15314446d2b28a90e429c938dc7b8beeb). Route relativ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9054
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:8f3f2491-21dc-4c1b-abaf-a39d9daa401c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A8F8:2AF0D8:386137:464AA5:6B01FA5A |
| html-safe-nonce | ae9590042bf4ed0adc8e05e10dfb2276f71d70d30734b6df6b6e3bf6fb1c0d7f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEY4OjJBRjBEODozODYxMzc6NDY0QUE1OjZCMDFGQTVBIiwidmlzaXRvcl9pZCI6Ijg4OTEyMjc0NDI5NjI4ODkzMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 155f99766e92916c24ab4a440da81133a60fcbe372dc5985ab9927820ff64d14 |
| hovercard-subject-tag | pull_request:4810544909 |
| 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/9054/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 Extract the independent Unix chmod(dir_fd=...) support from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7) onto Python 3.14 main (3af5f8a15314446d2b28a90e429c938dc7b8beeb). Route relativ... |
| 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