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 martin.panter
Recipients barry, martin.panter, r.david.murray
Date 2016-06-16.04:36:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466051780.69.0.693934528135.issue27328@psf.upfronthosting.co.za>
In-reply-to
Content
In trying to understand the defects from parsing an email Message object, and trying to use the raise_on_defect=True mode, I found a few inconsistencies with the documentation. I made a preliminary patch, but it may need adjusting.

1. There is no class called email.errors.Defect. My patch just removes the sentences mentioning this class. But an alternative might be to say handle/register_defect() are called with a subclass of MessageDefect.

2. Some defects are never raised, even if the policy says they should. I changed some of the wording to be less strict. But later I discovered Issue 24364, so perhaps this is actually an implementation bug instead.

3(a). MessageDefect is an exception class, and its subclasses are raised directly with raise_on_defect=True. However the documentation is explicit that defect classes are not exceptions.

3(b). If you assume defects are not exceptions, the documentation leads you to expect a defect will raise Message/Header(Parse)Error. But the defect exception classes that are raised are not even subclasses of MessageError.
History
Date User Action Args
2016-06-16 04:36:20martin.pantersetrecipients: + martin.panter, barry, r.david.murray
2016-06-16 04:36:20martin.pantersetmessageid: <1466051780.69.0.693934528135.issue27328@psf.upfronthosting.co.za>
2016-06-16 04:36:20martin.panterlinkissue27328 messages
2016-06-16 04:36:19martin.pantercreate