Title: realpath(..., strict=ALLOW_MISSING) can unexpectedly succeed on Windows · Issue #135122 · python/cpython · GitHub
Open Graph Title: realpath(..., strict=ALLOW_MISSING) can unexpectedly succeed on Windows · Issue #135122 · python/cpython
X Title: realpath(..., strict=ALLOW_MISSING) can unexpectedly succeed on Windows · Issue #135122 · python/cpython
Description: Bug report In new tests added for #117562 I noticed that os.path.realpath('file1/file2', strict=os.path.ALLOW_MISSING) returns 'file1/file2' when file file1 exist on Windows. On Posix you will get NotADirectoryError here, but Windows rai...
Open Graph Description: Bug report In new tests added for #117562 I noticed that os.path.realpath('file1/file2', strict=os.path.ALLOW_MISSING) returns 'file1/file2' when file file1 exist on Windows. On Posix you will get ...
X Description: Bug report In new tests added for #117562 I noticed that os.path.realpath('file1/file2', strict=os.path.ALLOW_MISSING) returns 'file1/file2' when file file1 exist on Windows. On Pos...
Opengraph URL: https://github.com/python/cpython/issues/135122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"realpath(..., strict=ALLOW_MISSING) can unexpectedly succeed on Windows","articleBody":"# Bug report\n\nIn new tests added for #117562 I noticed that `os.path.realpath('file1/file2', strict=os.path.ALLOW_MISSING)` returns `'file1/file2'` when file `file1` exist on Windows.\n\nOn Posix you will get NotADirectoryError here, but Windows raises ALLOW_MISSING if the intermediate path is a file instead of directory, and it will be ignored with ALLOW_MISSING.\n\nIt is expected that if `realpath(..., strict=ALLOW_MISSING)` does not fail, you can simply create intermediate directories or the final file/directory. At least on Posix. But on Windows it will always fail, because there is already a file here.\n\ncc @encukou\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-162102\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2025-06-04T10:53:04Z","url":"https://github.com/python/cpython/issues/135122"}
| 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:5ac1b24e-322e-1b05-b748-aad07b5fb899 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C24C:136CDA:162495C:1D50A45:6B020244 |
| html-safe-nonce | 4555f0cb3fdd61fa3a7a2da13453e1c9b092b18717df86dc22dca8efa9921d36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjRDOjEzNkNEQToxNjI0OTVDOjFENTBBNDU6NkIwMjAyNDQiLCJ2aXNpdG9yX2lkIjoiMzY4Njk5MzQxNjk1ODM3ODU2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9756bd2940081bc7004c20dd9752b595c818836bc3f71079b107e8d0e8ae419c |
| hovercard-subject-tag | issue:3117394139 |
| 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/135122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9b6f5b0bea3a8098f15d19838fb56fba3cb7d6182c755662fdd0094fc6933bc1/python/cpython/issues/135122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9b6f5b0bea3a8098f15d19838fb56fba3cb7d6182c755662fdd0094fc6933bc1/python/cpython/issues/135122 |
| og:image:alt | Bug report In new tests added for #117562 I noticed that os.path.realpath('file1/file2', strict=os.path.ALLOW_MISSING) returns 'file1/file2' when file file1 exist on Windows. On Posix you will get ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| 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