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 danny87105
Recipients danny87105, eryksun, iritkatriel
Date 2020-10-20.13:54:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
By writing "except FileNotFoundError:", the intention is to catch an error when the file being opened is not found, and don't catch an error for other cases, such as an existing file without adequate permission. Writing "except OSError:" catches just too much cases including unwanted ones.

As they are not equivalent, you cannot say that the latter is the "correct" way for the former.

And you totally omitted the argument for the inadequate documentation for NotADirectoryError. It says NotADirectoryError is raises when a DIRECTORY operation is requested, and does not cover the case of opening a file.
Date User Action Args
2020-10-20 13:54:41danny87105setrecipients: + danny87105, eryksun, iritkatriel
2020-10-20 13:54:41danny87105setmessageid: <>
2020-10-20 13:54:41danny87105linkissue41737 messages
2020-10-20 13:54:40danny87105create