Title: Handle leading `//` for `posixpath.commonpath` · Issue #117201 · python/cpython · GitHub
Open Graph Title: Handle leading `//` for `posixpath.commonpath` · Issue #117201 · python/cpython
X Title: Handle leading `//` for `posixpath.commonpath` · Issue #117201 · python/cpython
Description: Bug report Bug description: >>> import posixpath >>> posixpath.commonpath(["//foo/bar", "//foo/baz"]) '/foo' Expected: //foo with precisely two leading slashes, see: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.htm...
Open Graph Description: Bug report Bug description: >>> import posixpath >>> posixpath.commonpath(["//foo/bar", "//foo/baz"]) '/foo' Expected: //foo with precisely two leading slashes, see: https://pubs.opengroup.org/onli...
X Description: Bug report Bug description: >>> import posixpath >>> posixpath.commonpath(["//foo/bar", "//foo/baz"]) '/foo' Expected: //foo with precisely two leading...
Opengraph URL: https://github.com/python/cpython/issues/117201
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Handle leading `//` for `posixpath.commonpath`","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\n```python\r\n\u003e\u003e\u003e import posixpath\r\n\u003e\u003e\u003e posixpath.commonpath([\"//foo/bar\", \"//foo/baz\"])\r\n'/foo'\r\n```\r\n\r\nExpected: `//foo` with precisely two leading slashes, see: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13\r\n\r\nThis can be quite easily solved using `posixpath.splitroot`, see the PR.\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nmacOS\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-117202\r\n* gh-117334\r\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/nineteendo","@type":"Person","name":"nineteendo"},"datePublished":"2024-03-24T20:56:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/117201/cpython/issues/117201"}
| 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:96123377-bfbc-741c-bba1-95824f8185d2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A80C:D449A:1952930:20D0805:696B2EB0 |
| html-safe-nonce | 63ebb7aa02ad157207bd8b9331e4baf3d69cd00bf259691834fbbabe2cd5cec2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODBDOkQ0NDlBOjE5NTI5MzA6MjBEMDgwNTo2OTZCMkVCMCIsInZpc2l0b3JfaWQiOiI0OTg5ODE0NDU5ODk5NTIyNzM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c6cb0f0f4363ebf3088b93481a5b9874727c9fa3a87973f4c1142afc84347651 |
| hovercard-subject-tag | issue:2204551216 |
| 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/117201/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4790924cf5c7816a446c9f8cacafc18681a51b0a80a979f2605c3dee49387819/python/cpython/issues/117201 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4790924cf5c7816a446c9f8cacafc18681a51b0a80a979f2605c3dee49387819/python/cpython/issues/117201 |
| og:image:alt | Bug report Bug description: >>> import posixpath >>> posixpath.commonpath(["//foo/bar", "//foo/baz"]) '/foo' Expected: //foo with precisely two leading slashes, see: https://pubs.opengroup.org/onli... |
| 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 | 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width