Title: ntpath.realpath() mishandles filenames that resemble drives · Issue #102475 · python/cpython · GitHub
Open Graph Title: ntpath.realpath() mishandles filenames that resemble drives · Issue #102475 · python/cpython
X Title: ntpath.realpath() mishandles filenames that resemble drives · Issue #102475 · python/cpython
Description: The realpath() docs say: If strict is False, the path is resolved as far as possible and any remainder is appended without checking whether it exists. Note the word "appended". In fact, realpath() uses os.path.join() to join the path seg...
Open Graph Description: The realpath() docs say: If strict is False, the path is resolved as far as possible and any remainder is appended without checking whether it exists. Note the word "appended". In fact, realpath() ...
X Description: The realpath() docs say: If strict is False, the path is resolved as far as possible and any remainder is appended without checking whether it exists. Note the word "appended". In fact, r...
Opengraph URL: https://github.com/python/cpython/issues/102475
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ntpath.realpath() mishandles filenames that resemble drives","articleBody":"[The `realpath()` docs](https://docs.python.org/3/library/os.path.html#os.path.realpath) say:\r\n\r\n\u003e If *strict* is `False`, the path is resolved as far as possible and any remainder is appended without checking whether it exists.\r\n\r\nNote the word \"appended\". In fact, `realpath()` uses `os.path.join()` to join the path segments, and as we all know/love, `os.path.join()` supports resetting the drive or root, thus discarding prior parts. As a result:\r\n\r\n```python\r\n\u003e\u003e\u003e os.path.realpath('c:/a:b')\r\n'a:b' # should be 'c:/a:b'\r\n```","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-03-06T18:05:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/102475/cpython/issues/102475"}
| 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:8915f6d8-e7e5-e4e0-c2d8-7a55f1e4b679 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA88:8D103:22D955F:2DB9314:696B1315 |
| html-safe-nonce | 7399ee02fd107bd9e045fe52f24c864f72eb2cec2487b555e0321edec0ee291c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTg4OjhEMTAzOjIyRDk1NUY6MkRCOTMxNDo2OTZCMTMxNSIsInZpc2l0b3JfaWQiOiI1NTcwOTI3MjUwMTk1MDI2NzA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7b8c9ca1d6e3818b0fd2495e4df9822cc77100561b82a085745dc1a5f470e251 |
| hovercard-subject-tag | issue:1611956082 |
| 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/102475/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98ac80e37469eab388778a9790ccc7ae78ab7d951892b9c61bc7a269963c46b3/python/cpython/issues/102475 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98ac80e37469eab388778a9790ccc7ae78ab7d951892b9c61bc7a269963c46b3/python/cpython/issues/102475 |
| og:image:alt | The realpath() docs say: If strict is False, the path is resolved as far as possible and any remainder is appended without checking whether it exists. Note the word "appended". In fact, realpath() ... |
| 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 | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width