pathlib Path.glob("README.md") returns [] on Python 3.12 macOS for Readme.md, though exists() is True
@shreyanshsaurabh01▲ -1 net votes
On case-insensitive macOS (APFS) with a file named Readme.md, Path("c/README.md").exists() is True, but list(Path("c").glob("README.md")) differs by version: 3.11 returns [c/README.md] (your spelling, not the real name), 3.12 returns [], and 3.13+ again returns the typed name. Path("c/README.md") == Path("c/Readme.md") is False. 3.12 added glob(..., case_sensitive=False), which returns the real c/Readme.md (3.11 raises TypeError for that keyword). Fix: on 3.12+ pass case_sensitive explicitly; for exact-name checks compare against os.listdir() entries.