Movatterモバイル変換
[0]ホーム
The following exception classes are defined in theemail.errors module:
- This is the base class for all exceptions that theemailpackage can raise. It is derived from the standardException class and defines no additional methods.
| exception MessageParseError( | ) |
- This is the base class for exceptions thrown by theParserclass. It is derived fromMessageError.
| exception HeaderParseError( | ) |
- Raised under some error conditions when parsing theRFC 2822 headers ofa message, this class is derived fromMessageParseError.It can be raised from theParser.parse() orParser.parsestr() methods.
Situations where it can be raised include finding an envelopeheader after the firstRFC 2822 header of the message, finding acontinuation line before the firstRFC 2822 header is found, or findinga line in the headers which is neither a header or a continuationline.
| exception BoundaryError( | ) |
- Raised under some error conditions when parsing theRFC 2822 headers ofa message, this class is derived fromMessageParseError.It can be raised from theParser.parse() orParser.parsestr() methods.
Situations where it can be raised include not being able to find thestarting or terminating boundary in amultipart/* messagewhen strict parsing is used.
| exception MultipartConversionError( | ) |
- Raised when a payload is added to aMessage object usingadd_payload(), but the payload is already a scalar and themessage'sContent-Type: main type is not eithermultipart or missing.MultipartConversionErrormultiply inherits fromMessageError and the built-inTypeError.
SinceMessage.add_payload() is deprecated, this exception israrely raised in practice. However the exception may also be raisedif theattach() method is called on an instance of a classderived fromMIMENonMultipart (e.g.MIMEImage).
Here's the list of the defects that theFeedParser can find whileparsing messages. Note that the defects are added to the message where theproblem was found, so for example, if a message nested inside amultipart/alternative had a malformed header, that nested messageobject would have a defect, but the containing messages would not.
All defect classes are subclassed fromemail.errors.MessageDefect, butthis class isnot an exception!
New in version 2.4:All the defect classes were added.
- NoBoundaryInMultipartDefect - A message claimed to be a multipart, but had noboundary parameter.
- StartBoundaryNotFoundDefect - The start boundary claimed in theContent-Type: header was never found.
- FirstHeaderLineIsContinuationDefect - The message had a continuation line as its first header line.
- MisplacedEnvelopeHeaderDefect - A ``Unix From'' header was found in the middle of a header block.
- MalformedHeaderDefect - A header was found that was missing a colon, or was otherwise malformed.
- MultipartInvariantViolationDefect - A message claimed to be amultipart, but no subparts were found. Note that when a message has this defect, itsis_multipart() method may return false even though its content type claims to bemultipart.
Release 2.5.2, documentation updated on 21st February, 2008. SeeAbout this document... for information on suggesting changes.
[8]ページ先頭