This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients andrei.avk, danny87105, eryksun, iritkatriel
Date 2021-07-30.18:53:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> It should be emphasized that it may happen on a **file operation**

I think it's adequately covered by "attempts to open or traverse a non-directory file". The reader should know that opening "/path/to/file/somename.txt" requires traversing the components in the path. So if "file" isn't a directory, raising NotADirectoryError should be expected in POSIX.


If someone can verify the behavior on common non-Linux POSIX systems such as macOS, FreeBSD, and OpenBSD, then the wording could be narrowed down to "on most POSIX platforms" instead of "on some platforms". 

For example, given "spam" is a regular file in the current directory, check'spam', os.O_DIRECTORY);'spam/', 0); and'spam/eggs', 0).
Date User Action Args
2021-07-30 18:53:49eryksunsetrecipients: + eryksun, iritkatriel, danny87105, andrei.avk
2021-07-30 18:53:49eryksunsetmessageid: <>
2021-07-30 18:53:49eryksunlinkissue41737 messages
2021-07-30 18:53:49eryksuncreate