Title: Fix `ntpath.normpath()` for drive-relative paths · Issue #126780 · python/cpython · GitHub
Open Graph Title: Fix `ntpath.normpath()` for drive-relative paths · Issue #126780 · python/cpython
X Title: Fix `ntpath.normpath()` for drive-relative paths · Issue #126780 · python/cpython
Description: Bug report Bug description: from @eryksun (#117855 (comment)): Note that the behavior for normalizing drive-relative paths is currently wrong in this case on Windows: >>> nt._path_normpath('C:./spam') 'C:.\\spam' That's the result that w...
Open Graph Description: Bug report Bug description: from @eryksun (#117855 (comment)): Note that the behavior for normalizing drive-relative paths is currently wrong in this case on Windows: >>> nt._path_normpath('C:./spa...
X Description: Bug report Bug description: from @eryksun (#117855 (comment)): Note that the behavior for normalizing drive-relative paths is currently wrong in this case on Windows: >>> nt._path_normpath...
Opengraph URL: https://github.com/python/cpython/issues/126780
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix `ntpath.normpath()` for drive-relative paths","articleBody":"# Bug report\n\n### Bug description:\n\nfrom @eryksun (https://github.com/python/cpython/pull/117855#discussion_r1581286073):\n\n\u003e Note that the behavior for normalizing drive-relative paths is currently wrong in this case on Windows:\n\u003e \n\u003e ```\n\u003e \u003e\u003e\u003e nt._path_normpath('C:./spam')\n\u003e 'C:.\\\\spam'\n\u003e ```\n\u003e \n\u003e That's the result that we want here when returning an explicit current directory for _internal use_, but that's not the expected behavior for `normpath()`. The fallback implementation that's used on POSIX gets it right:\n\u003e \n\u003e ```\n\u003e \u003e\u003e\u003e ntpath.normpath('C:./spam')\n\u003e 'C:spam'\n\u003e ```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-126801\n* gh-127103\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/nineteendo","@type":"Person","name":"nineteendo"},"datePublished":"2024-11-13T12:35:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/126780/cpython/issues/126780"}
| 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:b3e609ff-7d74-1b23-eb61-99cd0a22ebd7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A73A:1B00D1:18B474D:20B2B29:6A51D277 |
| html-safe-nonce | 116dd3b5fa6be709d9b9d0df3a8b20e6f775933ff43ff4b60567a79f61789888 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzNBOjFCMDBEMToxOEI0NzREOjIwQjJCMjk6NkE1MUQyNzciLCJ2aXNpdG9yX2lkIjoiODAzMDY2ODA3NzMyOTkyODgyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | de3d03a0aae637f2bf6c03f2ae9fbd42df5e4b1acbf7b6f0db3dde058f670975 |
| hovercard-subject-tag | issue:2655338898 |
| 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/126780/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a098daa6d20bc9bb49ed727b2591e0e49862515a9e663d9b7e93e574566fbd57/python/cpython/issues/126780 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a098daa6d20bc9bb49ed727b2591e0e49862515a9e663d9b7e93e574566fbd57/python/cpython/issues/126780 |
| og:image:alt | Bug report Bug description: from @eryksun (#117855 (comment)): Note that the behavior for normalizing drive-relative paths is currently wrong in this case on Windows: >>> nt._path_normpath('C:./spa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nineteendo |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width