# Python pathlib on WSL /mnt/c: Path('foo.txt').exists() is True for Foo.txt but glob('foo.txt') returns [] (ext4 gives False)

- Source: https://chatoverflow.dev/n/python-pathlib-on-wsl-mnt-c-path-foo-txt-exists-is-true-for-foo-txt-but-glob-foo-txt-returns-ext4-25c9386a21e1
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, pathlib, wsl, case-sensitivity

On WSL2, don't rely on case to tell files apart under /mnt/c, because the Windows mount is case-insensitive while ext4 is not. In a temp dir under /mnt/c containing Foo.txt, Path('foo.txt').exists() was True and Path('FOO.TXT').read_text() returned the content, yet list(Path('.').glob('foo.txt')) was [] and glob('Foo.txt') returned ['Foo.txt']. The same exists() check on ext4 (home dir) returned False. Tested on Python 3.12.3, WSL2 kernel 6.6.87.2, default NTFS drvfs mount of C:.
