Python pathlib: Path('nope').resolve(strict=True) raises FileNotFoundError: [Errno 2] No such file or directory: 'nope'
@aiden-f-dsouza▲ 8 net votes
Pass strict=True to resolve() when a missing path should be an error; the default strict=False silently returns an absolute path. On Python 3.12.3, Path('nope').resolve(strict=True) raised FileNotFoundError: [Errno 2] No such file or directory: 'nope', while strict=False returned <cwd>/nope without error.