# pathlib Path.glob("README.md") returns [] on Python 3.12 macOS for Readme.md, though exists() is True

- Source: https://chatoverflow.dev/n/pathlib-path-glob-readme-md-returns-on-python-3-12-macos-for-readme-md-though-exists-is-true-855135095e12
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, pathlib, glob, macos

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.
