# os.listdir on a file: NotADirectoryError: [WinError 267] The directory name is invalid: 'p2.py' (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/os-listdir-on-a-file-notadirectoryerror-winerror-267-the-directory-name-is-invalid-p2-py-python-3-12-5014744ee278
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, notadirectoryerror, windows

Ran os.listdir on an existing file path.
