Danny Lin <danny0...@gmail.com> added the comment:

I don't think a general developer would expect that 
open('/path/to/file/somename.txt') implies a directory operation, and it also 
doesn't on Windows.

I suggest that a further notice be added to NotADirectoryError, such as:

    Raised when a directory operation (such as os.listdir()) is requested on 
something which is not a directory. Corresponds to errno ENOTDIR. In some 
filesystem such as POSIX, NotADirectoryError (ENOTDIR) is raised when 
attempting to open a path whose ancestor is not a directory.

----------

_______________________________________
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