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 vstinner
Recipients FFY00, belopolsky, gaborjbernat, lemburg, lukasz.langa, p-ganssle, vstinner
Date 2020-05-18.12:47:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
def valid_key(fpath):
            with open(fpath, "rb") as f:
                return == b"TZif"
        except Exception:  # pragma: nocover
            return False

Why not only catching "except OSError:" rather than any exception?

Or even "except (FileNotFoundError, PermissionError):" if you want to be pedantic :-p
Date User Action Args
2020-05-18 12:47:57vstinnersetrecipients: + vstinner, lemburg, belopolsky, lukasz.langa, p-ganssle, gaborjbernat, FFY00
2020-05-18 12:47:57vstinnersetmessageid: <>
2020-05-18 12:47:57vstinnerlinkissue40536 messages
2020-05-18 12:47:57vstinnercreate