Title: `ntpath.join()` adds slash to incomplete UNC drive with trailing slash · Issue #103220 · python/cpython · GitHub
Open Graph Title: `ntpath.join()` adds slash to incomplete UNC drive with trailing slash · Issue #103220 · python/cpython
X Title: `ntpath.join()` adds slash to incomplete UNC drive with trailing slash · Issue #103220 · python/cpython
Description: ntpath.join() incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash: >>> import ntpath >>> ntpath.join('\\\\server\\share\\foo\\', 'bar') '\\\\server\\share\\foo\\bar' # ok >>...
Open Graph Description: ntpath.join() incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash: >>> import ntpath >>> ntpath.join('\\\\server\\share\\foo\\', 'bar...
X Description: ntpath.join() incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash: >>> import ntpath >>> ntpath.join('\\\\serve...
Opengraph URL: https://github.com/python/cpython/issues/103220
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ntpath.join()` adds slash to incomplete UNC drive with trailing slash","articleBody":"`ntpath.join()` incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash:\r\n\r\n```python\r\n\u003e\u003e\u003e import ntpath\r\n\u003e\u003e\u003e ntpath.join('\\\\\\\\server\\\\share\\\\foo\\\\', 'bar')\r\n'\\\\\\\\server\\\\share\\\\foo\\\\bar' # ok\r\n\u003e\u003e\u003e ntpath.join('\\\\\\\\server\\\\share\\\\', 'foo')\r\n'\\\\\\\\server\\\\share\\\\foo' # ok\r\n\u003e\u003e\u003e ntpath.join('\\\\\\\\server\\\\', 'share')\r\n'\\\\\\\\server\\\\\\\\share' # wrong!\r\n\u003e\u003e\u003e ntpath.join('\\\\\\\\', 'server')\r\n'\\\\\\\\\\\\server' # wrong!\r\n```\r\n\r\nBefore 005e69403d638f9ff8f71e59960c600016e101a4 (3.12), the last test case succeeds because `splitdrive()` doesn't identify `'\\\\\\\\'` as a UNC drive. But the third test case is reproducible going back to 3.11 and 3.10.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103221\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-04-03T19:34:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/103220/cpython/issues/103220"}
| 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:f9fe7c31-bf7f-aab2-4843-5356746cadee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC84:34B6FA:1908423:229A856:696AA846 |
| html-safe-nonce | 757d9704c81d1d5b7d12212c0794bcf0481885c0c19b428a2533f4ddb32d6a80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzg0OjM0QjZGQToxOTA4NDIzOjIyOUE4NTY6Njk2QUE4NDYiLCJ2aXNpdG9yX2lkIjoiODk2MTU2NzkwMDQ1OTI0NzY4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5e7c1489268ae7be084343557209b56f4c292a7d2761eae3c503840b9289594f |
| hovercard-subject-tag | issue:1652653717 |
| 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/103220/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6832169ee0129bc11ae55e58993467e482015850b208ede0f1eb3a23b2d7d28d/python/cpython/issues/103220 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6832169ee0129bc11ae55e58993467e482015850b208ede0f1eb3a23b2d7d28d/python/cpython/issues/103220 |
| og:image:alt | ntpath.join() incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash: >>> import ntpath >>> ntpath.join('\\\\server\\share\\foo\\', 'bar... |
| 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 | 3eaf9b8cf1badcd7041a8ad480b9d9b28bea0ef1cc821ca9ff20f2cc7f4fe4b9 |
| 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 | dd9a979046e6382bd084e2bd873bf65f797125ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width