Title: Allow path-like objects in `fnmatch.fnmatchcase` · Issue #123215 · python/cpython · GitHub
Open Graph Title: Allow path-like objects in `fnmatch.fnmatchcase` · Issue #123215 · python/cpython
X Title: Allow path-like objects in `fnmatch.fnmatchcase` · Issue #123215 · python/cpython
Description: Feature or enhancement Proposal: We should call os.fspath in fnmatchcase so that all functions in fnmatch have path-like support: def fnmatchcase(name, pat): """Test whether FILENAME matches PATTERN, including case. This is a version of ...
Open Graph Description: Feature or enhancement Proposal: We should call os.fspath in fnmatchcase so that all functions in fnmatch have path-like support: def fnmatchcase(name, pat): """Test whether FILENAME matches PATTER...
X Description: Feature or enhancement Proposal: We should call os.fspath in fnmatchcase so that all functions in fnmatch have path-like support: def fnmatchcase(name, pat): """Test whether FILENAME...
Opengraph URL: https://github.com/python/cpython/issues/123215
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow path-like objects in `fnmatch.fnmatchcase`","articleBody":"# Feature or enhancement\r\n\r\n### Proposal:\r\n\r\nWe should call `os.fspath` in `fnmatchcase` so that all functions in `fnmatch` have path-like support:\r\n\r\n```diff\r\n def fnmatchcase(name, pat):\r\n \"\"\"Test whether FILENAME matches PATTERN, including case. \r\n\r\n This is a version of fnmatch() which doesn't case-normalize\r\n its arguments.\r\n \"\"\"\r\n match = _compile_pattern(pat)\r\n- return match(name) is not None\r\n+ return match(os.fspath(name)) is not None\r\n```\r\n\r\n_See https://github.com/python/cpython/issues/123122#issuecomment-2301350063 and https://github.com/python/cpython/pull/123122#issuecomment-2302784855_\r\n\r\n### Has this already been discussed elsewhere?\r\n\r\nThis is a minor feature, which does not need previous discussion elsewhere\r\n\r\n### Links to previous discussion of this feature:\r\n\r\n_No response_\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* gh-123216\r\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2024-08-22T07:26:42Z","url":"https://github.com/python/cpython/issues/123215"}
| 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:e155acf7-240e-aa47-d245-5b108656c247 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFD0:21BD98:330F80D:40BB987:6B020AE1 |
| html-safe-nonce | 09b245e549cfbe9768dfcfe9d440038effeb757c14f0892f86e86873bebbbd03 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkQwOjIxQkQ5ODozMzBGODBEOjQwQkI5ODc6NkIwMjBBRTEiLCJ2aXNpdG9yX2lkIjoiMzkwNTcyNTAxMTczODEwMjQ5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 96effacaf970c7e675fce5efccd89389080f05744a9eaab6fdf6fa7171df7591 |
| hovercard-subject-tag | issue:2480042032 |
| 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/123215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c98496c2ee5b0c730d1f8d8ea287fe203e6d6caf0bf47a1a1ce7067a4969848/python/cpython/issues/123215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c98496c2ee5b0c730d1f8d8ea287fe203e6d6caf0bf47a1a1ce7067a4969848/python/cpython/issues/123215 |
| og:image:alt | Feature or enhancement Proposal: We should call os.fspath in fnmatchcase so that all functions in fnmatch have path-like support: def fnmatchcase(name, pat): """Test whether FILENAME matches PATTER... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | picnixz |
| 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