Title: host_env: `renameat` support for `os.rename` by joshuamegnauth54 · Pull Request #8118 · RustPython/RustPython · GitHub
Open Graph Title: host_env: `renameat` support for `os.rename` by joshuamegnauth54 · Pull Request #8118 · RustPython/RustPython
X Title: host_env: `renameat` support for `os.rename` by joshuamegnauth54 · Pull Request #8118 · RustPython/RustPython
Description: Python's os.rename supports renaming a path relative to a directory descriptor - essentially, renameat. The syscall and its Rustix wrapper does all of the work, so this patch mainly updates the Python signature to forward to the implementation. As of this patch, os.rename is still incorrect for Windows because it always replaces the destination file. I added a small note for future contributors (or myself, since I might tackle it) as a reminder of what's broken. Closes #xxxx This PR follows our AI policy Summary Adds directory descriptor support for os.rename. See os.rename. Summary by CodeRabbit New Features Enhanced os.rename() and os.replace() to accept optional src_dir_fd and dst_dir_fd, supporting renames relative to directory descriptors. Updated capability reporting so both rename and replace advertise directory-fd support when available. Bug Fixes Improved cross-platform behavior: on non-Unix systems, supplying directory FDs now raises a clear error when directory-rename isn’t supported. On Unix, omitting src_dir_fd/dst_dir_fd now defaults to the current working directory.
Open Graph Description: Python's os.rename supports renaming a path relative to a directory descriptor - essentially, renameat. The syscall and its Rustix wrapper does all of the work, so this patch mainly updates the...
X Description: Python's os.rename supports renaming a path relative to a directory descriptor - essentially, renameat. The syscall and its Rustix wrapper does all of the work, so this patch mainly updates...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8118
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:62ece02a-753f-35c8-f47c-c8ce44e3a7a8 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BCAC:EF960:249707C:358BCEA:6A60D478 |
| html-safe-nonce | a0e180019e6b91bcb3ccf2502f11b5d43d795cda1740976382e8db3351a4b915 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0FDOkVGOTYwOjI0OTcwN0M6MzU4QkNFQTo2QTYwRDQ3OCIsInZpc2l0b3JfaWQiOiI1MTM4OTQ3OTcyNTYyMTc3MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 465cebb2a726677775060e3a66f6c361b4cdadb8c98e031796b2f0e05e04c092 |
| hovercard-subject-tag | pull_request:3872128562 |
| 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/8118/files |
| twitter:image | https://avatars.githubusercontent.com/u/48846352?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/48846352?s=400&v=4 |
| og:image:alt | Python's os.rename supports renaming a path relative to a directory descriptor - essentially, renameat. The syscall and its Rustix wrapper does all of the work, so this patch mainly updates the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 025e511fb0e6dd11aaa36892212f7bcc13708244bc2bcbeff1cf34fc77723812 |
| 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 | 405b1f59618e9c5e102e2408c26ce58f1937fbca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width