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 DimitriPapadopoulos
Recipients DimitriPapadopoulos, docs@python, ezio.melotti, mrabarnett
Date 2021-11-16.10:46:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
The fnmatch documentation should explicitly mention the type of exceptions raised by fnmatch.fnmatch():
https://docs.python.org/3/library/fnmatch.html

In my case it raised sre_constants.error, and it took some time to understand that the proper way to catch this type of exceptions is to catch the re.error superclass, by reading https://bugs.python.org/issue795379.

Actually that would be the case for any module using the re module under the hood, possibly passing an ill-formed regex to a re function.
History
Date User Action Args
2021-11-16 10:46:44DimitriPapadopoulossetrecipients: + DimitriPapadopoulos, ezio.melotti, mrabarnett, docs@python
2021-11-16 10:46:44DimitriPapadopoulossetmessageid: <[email protected]>
2021-11-16 10:46:44DimitriPapadopouloslinkissue45815 messages
2021-11-16 10:46:44DimitriPapadopouloscreate