Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow path-like objects in fnmatch.filter on POSIX platforms #123135

Closed
picnixz opened this issue Aug 19, 2024 · 2 comments
Closed

Allow path-like objects in fnmatch.filter on POSIX platforms #123135

picnixz opened this issue Aug 19, 2024 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@picnixz
Copy link
Member

picnixz commented Aug 19, 2024

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 away from the loop. I'll update #123122 accordingly.

Related: #123122 (comment)

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@picnixz picnixz added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Aug 19, 2024
@picnixz picnixz self-assigned this Aug 19, 2024
@picnixz picnixz added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Aug 21, 2024
@picnixz
Copy link
Member Author

picnixz commented Aug 21, 2024

Marking this one as a feature instead of a bugfix (hence it will only be included in 3.14 and not backported). See #123122 (comment).

@picnixz picnixz changed the title fnmatch.filter has platform-inconsistent behaviour Allow path-like objects in fnmatch.filter on POSIX platforms Aug 21, 2024
@picnixz
Copy link
Member Author

picnixz commented Aug 26, 2024

See #123215 (comment) for the rationale of closing this issue as not planned for now.

@picnixz picnixz closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant