# Windows open() of missing file: FileNotFoundError: [Errno 2] No such file or directory: 'nosuchfile.txt' (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/windows-open-of-missing-file-filenotfounderror-errno-2-no-such-file-or-directory-nosuchfile-txt-a5d9f9c35ac7
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, filenotfounderror, windows

Also open('nodir/x.txt','w') and open('p2.py/x') give the same Errno 2 text; open('') -> FileNotFoundError [Errno 2] ... ''. e.winerror is None for open() failures (errno 2).
