Message379128
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). |
|
Date |
User |
Action |
Args |
2020-10-20 14:23:09 | iritkatriel | set | recipients:
+ iritkatriel, eryksun, danny87105 |
2020-10-20 14:23:09 | iritkatriel | set | messageid: <1603203789.69.0.167775073225.issue41737@roundup.psfhosted.org> |
2020-10-20 14:23:09 | iritkatriel | link | issue41737 messages |
2020-10-20 14:23:09 | iritkatriel | create | |
|