Title: `pathlib.PurePath.match()` can incorrectly match empty path · Issue #106330 · python/cpython · GitHub
Open Graph Title: `pathlib.PurePath.match()` can incorrectly match empty path · Issue #106330 · python/cpython
X Title: `pathlib.PurePath.match()` can incorrectly match empty path · Issue #106330 · python/cpython
Description: >>> from pathlib import PurePath >>> PurePath().match('*') True This should be false, because a * segment always consumes exactly one path component, but empty paths have 0 components. Linked PRs gh-106331 gh-106372
Open Graph Description: >>> from pathlib import PurePath >>> PurePath().match('*') True This should be false, because a * segment always consumes exactly one path component, but empty paths have 0 components. Linked PRs g...
X Description: >>> from pathlib import PurePath >>> PurePath().match('*') True This should be false, because a * segment always consumes exactly one path component, but empty paths have ...
Opengraph URL: https://github.com/python/cpython/issues/106330
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`pathlib.PurePath.match()` can incorrectly match empty path","articleBody":"```python\r\n\u003e\u003e\u003e from pathlib import PurePath\r\n\u003e\u003e\u003e PurePath().match('*')\r\nTrue\r\n```\r\n\r\nThis should be false, because a `*` segment always consumes exactly one path component, but empty paths have 0 components. \n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-106331\n* gh-106372\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-07-02T09:47:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/106330/cpython/issues/106330"}
| 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:1f90d8e1-6070-9571-98c4-b032a8a9fefb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B232:3FF89A:3FD53B:5A0A0B:696A0AF8 |
| html-safe-nonce | ee2e4384d6850e735be960c633d94621aa8571c787c883104d0a76678f008c47 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjMyOjNGRjg5QTozRkQ1M0I6NUEwQTBCOjY5NkEwQUY4IiwidmlzaXRvcl9pZCI6IjM1MTc3NzY0ODg3OTk5NTY0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f4f497c30b1c0510c2c8785f0d9cef31559dac9ca7021f10c78d43d87ff070c6 |
| hovercard-subject-tag | issue:1784554516 |
| 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/106330/issue_layout |
| twitter:image | https://opengraph.githubassets.com/158dc6cb32eee33d1dd795f1e0fdd40f492f9d5a793741412db51fa4d0aca828/python/cpython/issues/106330 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/158dc6cb32eee33d1dd795f1e0fdd40f492f9d5a793741412db51fa4d0aca828/python/cpython/issues/106330 |
| og:image:alt | >>> from pathlib import PurePath >>> PurePath().match('*') True This should be false, because a * segment always consumes exactly one path component, but empty paths have 0 components. Linked PRs g... |
| 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 | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| 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 | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width