Title: Allow path-like objects in `fnmatch.filter` on POSIX platforms · Issue #123135 · python/cpython · GitHub
Open Graph Title: Allow path-like objects in `fnmatch.filter` on POSIX platforms · Issue #123135 · python/cpython
X Title: Allow path-like objects in `fnmatch.filter` on POSIX platforms · Issue #123135 · python/cpython
Description: In fnmatch.filter, it says that # normcase on posix is NOP. Optimize it away from the loop. This is not the case. os.path.normcase actually calls os.fspath on POSIX, meaning that path-like objects are allowed. Thus, we cannot optimize it...
Open Graph Description: In fnmatch.filter, it says that # normcase on posix is NOP. Optimize it away from the loop. This is not the case. os.path.normcase actually calls os.fspath on POSIX, meaning that path-like objects ...
X Description: In fnmatch.filter, it says that # normcase on posix is NOP. Optimize it away from the loop. This is not the case. os.path.normcase actually calls os.fspath on POSIX, meaning that path-like objects ...
Opengraph URL: https://github.com/python/cpython/issues/123135
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow path-like objects in `fnmatch.filter` on POSIX platforms","articleBody":"In `fnmatch.filter`, it says that\r\n\r\n```py\r\n# normcase on posix is NOP. Optimize it away from the loop.\r\n```\r\n\r\nThis is not the case. `os.path.normcase` actually calls `os.fspath` on POSIX, meaning that path-like objects are allowed. Thus, we cannot optimize it away from the loop. I'll update #123122 accordingly.\r\n\r\nRelated: https://github.com/python/cpython/pull/123122#issuecomment-2295320508\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\n_No response_\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* gh-123122\r\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2024-08-19T07:32:09Z","url":"https://github.com/python/cpython/issues/123135"}
| 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:5d093035-f798-cbfd-73b5-03dbcd2ad4d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAB0:1F2F:1AD0C07:239C3D8:6B020AD5 |
| html-safe-nonce | 9b8ff06e82b572e9adb1a56a075950a0738b1e91793a947996f40fd2e7ce5e33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUIwOjFGMkY6MUFEMEMwNzoyMzlDM0Q4OjZCMDIwQUQ1IiwidmlzaXRvcl9pZCI6Ijg5NTk1MDkyODgzMDEyMzQ5MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7b33f0fe10296c22b6814d2a722b83f66eecefb05fe94c53cc3de4e8aaf07649 |
| hovercard-subject-tag | issue:2472660021 |
| 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/123135/issue_layout |
| twitter:image | https://opengraph.githubassets.com/012411b03c61d446c3e46a16a2b3ffe94710d30f45ead1487da4b1ccd75720c4/python/cpython/issues/123135 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/012411b03c61d446c3e46a16a2b3ffe94710d30f45ead1487da4b1ccd75720c4/python/cpython/issues/123135 |
| og:image:alt | In fnmatch.filter, it says that # normcase on posix is NOP. Optimize it away from the loop. This is not the case. os.path.normcase actually calls os.fspath on POSIX, meaning that path-like objects ... |
| 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