fnmatch.filter and glob don't match uppercase names under Windows simulation
Maintainers usually reply within 2 days
@sricharanreddycheruku is already working on this.
Since Oct 7, 2026.
- #1352 by @sricharanreddycheruku — open
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- operating-systems, testing
Research direction
Start with the reproduced calls to fnmatch.filter, glob.glob, and the pyfakefs Patcher configured with OSType.WINDOWS. Compare their matching and directory-listing paths with fnmatch.fnmatch, then run the supplied reproduction to verify behavior. Done means uppercase names match case-insensitively for both filter and glob under Windows simulation without changing the already-correct single-name result.
Written by the indexing model from the issue text.
Description
Describe the bug
With Windows simulated on a POSIX host, fnmatch.filter doesn't match names containing uppercase letters, even when the pattern is in the same case. glob.glob misses the same files. fnmatch.fnmatch on a single name gives the right answer.
Expected: matching is case-insensitive, as on Windows.
fnmatch.fnmatch('B.TXT', '*.txt') -> True (correct)
fnmatch.filter(['B.TXT'], '*.txt') -> [] (expected ['B.TXT'])
fnmatch.filter(['B.TXT'], '*.TXT') -> [] (expected ['B.TXT'])
glob.glob('*.txt', root_dir='C:\\d') -> [] (expected ['B.TXT'])
I see the same results running from a case-sensitive and from a case-insensitive APFS volume.
How To Reproduce
Run on a POSIX host:
import fnmatch, glob, os
from pyfakefs.fake_filesystem import OSType
from pyfakefs.fake_filesystem_unittest import Patcher
with Patcher() as p:
p.fs.os = OSType.WINDOWS
os.makedirs('C:\\d')
open('C:\\d\\B.TXT', 'w').close()
print(fnmatch.fnmatch('B.TXT', '*.txt'))
print(fnmatch.filter(['B.TXT'], '*.txt'))
print(fnmatch.filter(['B.TXT'], '*.TXT'))
print(glob.glob('*.txt', root_dir='C:\\d'))
Your environment
macOS-27.0-arm64-arm-64bit-Mach-O
Python 3.14.7 (main, Aug 5 2026, 10:29:49) [Clang 21.0.0 (clang-2100.1.1.101)]
pyfakefs 6.2.0
ModuleNotFoundError: No module named 'pytest'
- Dominant language
- Python
- Stars
- 756
- Forks
- 111
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytest-dev/pyfakefs
-
`patched_packages.py` fail: `AttributeError: module 'django' has no attribute 'conf'`Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pytest-dev/pyfakefs#1367 · 1 comment ·
Maintainers usually reply within 2 days
-
Real Path objects keep a lowercased _str_normcase after a fake filesystem session on Python 3.14Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
pytest-dev/pyfakefs#1359 · 1 comment ·
Maintainers usually reply within 2 days
-
`Path` is replaced with `FakePathlibPathModule` instead of `FakePath` when imported directlyPossibly taken @sunxiuguo claimed this 19 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 70/100
pytest-dev/pyfakefs#1334 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
pytest-dev/pyfakefs#1321 · 4 comments ·
Maintainers usually reply within 2 days
-
fake_filesystem: RuntimeError "dictionary changed size during iteration" under concurrent mkdirOpen
Difficulty 3/5 1-2 days Newbie friendliness 65/100
pytest-dev/pyfakefs#1319 · 1 comment ·
Maintainers usually reply within 2 days
All issues in pytest-dev/pyfakefs
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4237 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jejjohnson/gaussx#721 ·
Maintainers usually reply within 1 day
-
mock-core-configs/etc/mock/rocky-10-riscv64.cfg contains the wrong architecture in config_opts['root']Possibly taken @jasonmontleon claimed this 4 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 94/100
rpm-software-management/mock#1834 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
elastic/elastic-otel-python#683 ·
Maintainers usually reply within 1 day
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesOpenfollow-up
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day