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

> Really? It's not obvious that finding a file would involve directory 
> operations?

Not in some senses, and that's possibly why Windows does not raise 
NotADirectoryError in such case.

I agree that it's a platform-specific implementation detail. However, there are 
lots of platform-specific implementation details written in documentation 
elsewhere already, especially OS related modules such as os and os.path. I 
don't think mentioning platform-specific implementation details for subclasses 
of OSError would be any less reasonable than that.

Adding such notice for NotADirectoryError helps people who want a EAFP style 
code for nonexistent file by preventing them getting trapped writing a 
cross-platform code.

----------

_______________________________________
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