Title: `os.path.realpath('loop/../link')` does not resolve link · Issue #117546 · python/cpython · GitHub
Open Graph Title: `os.path.realpath('loop/../link')` does not resolve link · Issue #117546 · python/cpython
X Title: `os.path.realpath('loop/../link')` does not resolve link · Issue #117546 · python/cpython
Description: If os.path.realpath() encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils realpath: $ cd /tmp $ ln -s loop loop $ ln -s target link $ realpath -m loop/../link...
Open Graph Description: If os.path.realpath() encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils realpath: $ cd /tmp $ ln -s loop loop $ ln -...
X Description: If os.path.realpath() encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils realpath: $ cd /tmp $ ln -s loop loop $ ln -...
Opengraph URL: https://github.com/python/cpython/issues/117546
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`os.path.realpath('loop/../link')` does not resolve link","articleBody":"If `os.path.realpath()` encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils `realpath`:\r\n\r\n```shell\r\n$ cd /tmp\r\n$ ln -s loop loop\r\n$ ln -s target link\r\n$ realpath -m loop/../link\r\n/tmp/target\r\n$ python -c 'import os.path; print(os.path.realpath(\"loop/../link\"))'\r\n/tmp/link\r\n```\r\n\r\nIt also differs from how `lstat()` errors are handled:\r\n\r\n```shell\r\n$ realpath -m missing/../link\r\n/tmp/target\r\n$ python -c 'import os.path; print(os.path.realpath(\"missing/../link\"))'\r\n/tmp/target\r\n```\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-117568\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2024-04-04T14:52:28Z","url":"https://github.com/python/cpython/issues/117546"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a69493fc-4de8-7e41-e68d-5bb9fe3b7069 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEAC:25F5AB:1B9C1C:2345CE:6B020284 |
| html-safe-nonce | 379fcaadbe801d569844cc0a81af82f83164e0798529eee66066ea1658a232e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUFDOjI1RjVBQjoxQjlDMUM6MjM0NUNFOjZCMDIwMjg0IiwidmlzaXRvcl9pZCI6IjU0OTY0MzU4NjE0MjU4ODE3MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f1a0b117374d37e6334ea4fb6eab72af450df292bec7e11cdc069f353835c5a3 |
| hovercard-subject-tag | issue:2225736176 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/117546/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a5989b91768a882b4717fb0673f8b00d97e24a408fceda6c33ff8330e4ad0c4/python/cpython/issues/117546 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a5989b91768a882b4717fb0673f8b00d97e24a408fceda6c33ff8330e4ad0c4/python/cpython/issues/117546 |
| og:image:alt | If os.path.realpath() encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils realpath: $ cd /tmp $ ln -s loop loop $ ln -... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | barneygale |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width