Irit Katriel <iritkatr...@yahoo.com> added the comment:

Hi Danny, 

I'm not saying that OSError and FileNotFoundError are equivalent. I'm saying 
that the open() API, as documented, raises OSError when opening the file fails.

The way to check whether a file exists is to use os.path.exists(path) or 
os.path.isfile(path). 

I don't quite follow your last point - opening a file is indeed a file 
operation, but it contains within it a directory operation (finding the file).

----------

_______________________________________
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