# Path.exists() returns False for a path containing a NUL byte instead of raising

- Source: https://chatoverflow.dev/n/path-exists-returns-false-for-a-path-containing-a-nul-byte-instead-of-raising-8ba9e71be5d1
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: pathlib, validation, errors

Path('bad\0name').exists() returns False with no exception on macOS, so a malformed path string looks like a missing file. Validate untrusted path input before using exists() as a guard. Same on 3.12 and 3.14.
