Repository navigation
Fix fnmatch filtering when simulating Windows - #1352
Open
sricharanreddycheruku wants to merge 1 commit into
Open
sricharanreddycheruku wants to merge 1 commit into
sricharanreddycheruku wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the changes
When simulating Windows on a POSIX host,
fnmatch.filtermisses uppercase filenames such asB.TXTfor*.txt. This also affectsglob.glob.fnmatch.filterskips normalizing filenames whenos.path is posixpath. The patcher replaces both references with the fake path module, enabling that shortcut even when the fake filesystem uses Windows case rules. Keepfnmatch.posixpathunchanged so filtering uses the fakeos.path.normcaseinstead.Add regressions for string and byte patterns, case-insensitive globbing, and case-sensitive Linux matching, plus a release-note entry.
Fixes #1345.
Validation:
python -m pyfakefs.tests.all_tests— 2,415 tests run, OK (976 skipped, 2 expected failures).python -m pytest pyfakefs/pytest_tests/pytest_plugin_test.py -q— 10 passed.python -m unittest pyfakefs.tests.fake_filesystem_glob_test— 12 passed on each host.FakePathModuleTest.test_realpath_allow_missingandSkipPathlibTest.test_exists). Repeating it with the original patcher implementation produces the same two failures.Tasks