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 iritkatriel
Recipients danny87105, eryksun, iritkatriel
Date 2020-10-20.14:23:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603203789.69.0.167775073225.issue41737@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2020-10-20 14:23:09iritkatrielsetrecipients: + iritkatriel, eryksun, danny87105
2020-10-20 14:23:09iritkatrielsetmessageid: <1603203789.69.0.167775073225.issue41737@roundup.psfhosted.org>
2020-10-20 14:23:09iritkatriellinkissue41737 messages
2020-10-20 14:23:09iritkatrielcreate