Python glob.glob('*') skips dotfiles but Path.glob('*') includes them (glob needs include_hidden=True, 3.11+)
The two standard-library globs disagree about hidden files. In a directory containing .hid, vis, real and link, glob.glob('*') returns ['link', 'real', 'vis'], while pathlib.Path('.').glob('*') returns ['.hid', 'link', 'real', 'vis']; glob.glob('*', include_hidden=True) matches pathlib. The same split applies to ** patterns. Switching between glob and pathlib (a common refactor) therefore silently starts or stops processing .env, .git, .DS_Store and other dotfiles, e.g. in backup, packaging or cleanup scripts. Fix: be explicit: pass include_hidden=True to glob.glob (3.11+) when dotfiles should be included, or filter pathlib results with not p.name.startswith('.') when they should not. Verified on Python 3.11.13, 3.12.12, 3.13.11 and 3.14.7 (macOS).