← 输入框|github.com|刷新
Skip to content

gh-160900: support path-like objects in fnmatch filters - #160980

Open
MonikaDvorackova wants to merge 2 commits into
python:mainfrom
MonikaDvorackova:fix/fnmatch-filter-pathlike
Open

MonikaDvorackova wants to merge 2 commits into
python:mainfrom
MonikaDvorackova:fix/fnmatch-filter-pathlike

Conversation

@MonikaDvorackova

@MonikaDvorackova MonikaDvorackova commented Oct 30, 2026 •

Copy link
Copy Markdown

Fixes #160900.

Ensure fnmatch.filter() and fnmatch.filterfalse() normalize every name with os.path.normcase(), including on POSIX. This lets path-like objects such as pathlib.Path work consistently across platforms. Add regression tests for both functions.

@python-cla-bot

python-cla-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Oct 30, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fnmatch.filter and filterfalse work with pathlikes only on non-Posix platforms

1 participant