@@ -77,51 +77,72 @@ object would have a defect, but the containing messages would not.
7777
7878All defect classes are subclassed from :class: `email.errors.MessageDefect `.
7979
80- * :class: `NoBoundaryInMultipartDefect ` -- A message claimed to be a multipart,
81- but had no :mimetype: `boundary ` parameter.
80+ .. exception :: NoBoundaryInMultipartDefect
8281
83- * :class: ` StartBoundaryNotFoundDefect ` -- The start boundary claimed in the
84- :mailheader: ` Content-Type ` header was never found .
82+ A message claimed to be a multipart, but had no :mimetype: ` boundary `
83+ parameter .
8584
86- * :class: `CloseBoundaryNotFoundDefect ` -- A start boundary was found, but
87- no corresponding close boundary was ever found.
85+ .. exception :: StartBoundaryNotFoundDefect
8886
89- .. versionadded :: 3.3
87+ The start boundary claimed in the :mailheader: `Content-Type ` header was
88+ never found.
9089
91- * :class: `FirstHeaderLineIsContinuationDefect ` -- The message had a continuation
92- line as its first header line.
90+ .. exception :: CloseBoundaryNotFoundDefect
9391
94- * :class: ` MisplacedEnvelopeHeaderDefect ` - A "Unix From" header was found in the
95- middle of a header block .
92+ A start boundary was found, but no corresponding close boundary was ever
93+ found .
9694
97- * :class: `MissingHeaderBodySeparatorDefect ` - A line was found while parsing
98- headers that had no leading white space but contained no ':'. Parsing
99- continues assuming that the line represents the first line of the body.
95+ .. versionadded :: 3.3
10096
101- .. versionadded :: 3.3
97+ .. exception :: FirstHeaderLineIsContinuationDefect
10298
103- * :class: `MalformedHeaderDefect ` -- A header was found that was missing a colon,
104- or was otherwise malformed.
99+ The message had a continuation line as its first header line.
105100
106- .. deprecated :: 3.3
107- This defect has not been used for several Python versions.
101+ .. exception :: MisplacedEnvelopeHeaderDefect
108102
109- * :class: `MultipartInvariantViolationDefect ` -- A message claimed to be a
110- :mimetype: `multipart `, but no subparts were found. Note that when a message
111- has this defect, its :meth: `~email.message.Message.is_multipart ` method may
112- return ``False `` even though its content type claims to be :mimetype: `multipart `.
103+ A "Unix From" header was found in the middle of a header block.
113104
114- * :class: `InvalidBase64PaddingDefect ` -- When decoding a block of base64
115- encoded bytes, the padding was not correct. Enough padding is added to
116- perform the decode, but the resulting decoded bytes may be invalid.
105+ .. exception :: MissingHeaderBodySeparatorDefect
117106
118- * :class: ` InvalidBase64CharactersDefect ` -- When decoding a block of base64
119- encoded bytes, characters outside the base64 alphabet were encountered.
120- The characters are ignored, but the resulting decoded bytes may be invalid .
107+ A line was found while parsing headers that had no leading white space but
108+ contained no ':'. Parsing continues assuming that the line represents the
109+ first line of the body .
121110
122- * :class: `InvalidBase64LengthDefect ` -- When decoding a block of base64 encoded
123- bytes, the number of non-padding base64 characters was invalid (1 more than
124- a multiple of 4). The encoded block was kept as-is.
111+ .. versionadded :: 3.3
125112
126- * :class: `InvalidDateDefect ` -- When decoding an invalid or unparsable date field.
127- The original value is kept as-is.
113+ .. exception :: MalformedHeaderDefect
114+
115+ A header was found that was missing a colon, or was otherwise malformed.
116+
117+ .. deprecated :: 3.3
118+ This defect has not been used for several Python versions.
119+
120+ .. exception :: MultipartInvariantViolationDefect
121+
122+ A message claimed to be a :mimetype: `multipart `, but no subparts were found.
123+ Note that when a message has this defect, its
124+ :meth: `~email.message.Message.is_multipart ` method may return ``False ``
125+ even though its content type claims to be :mimetype: `multipart `.
126+
127+ .. exception :: InvalidBase64PaddingDefect
128+
129+ When decoding a block of base64 encoded bytes, the padding was not correct.
130+ Enough padding is added to perform the decode, but the resulting decoded
131+ bytes may be invalid.
132+
133+ .. exception :: InvalidBase64CharactersDefect
134+
135+ When decoding a block of base64 encoded bytes, characters outside the base64
136+ alphabet were encountered. The characters are ignored, but the resulting
137+ decoded bytes may be invalid.
138+
139+ .. exception :: InvalidBase64LengthDefect
140+
141+ When decoding a block of base64 encoded bytes, the number of non-padding
142+ base64 characters was invalid (1 more than a multiple of 4). The encoded
143+ block was kept as-is.
144+
145+ .. exception :: InvalidDateDefect
146+
147+ When decoding an invalid or unparsable date field. The original value is
148+ kept as-is.
0 commit comments