Eryk Sun <eryk...@gmail.com> added the comment:

> 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 
os.open('spam', os.O_DIRECTORY); os.open('spam/', 0); and os.open('spam/eggs', 
0).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41737>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to