[Python-checkins] python/dist/src/Lib/email Errors.py,1.5,1.6
bwarsaw at users.sourceforge.net
bwarsaw at users.sourceforge.net
Sat May 8 23:26:10 EDT 2004
Update of /cvsroot/python/python/dist/src/Lib/email
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10677
Modified Files:
Errors.py
Log Message:
Add MessageDefect and subclasses.
Index: Errors.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Errors.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Errors.py 1 Jun 2002 05:45:37 -0000 1.5
--- Errors.py 9 May 2004 03:26:07 -0000 1.6
***************
*** 1,7 ****
! # Copyright (C) 2001,2002 Python Software Foundation
! # Author: barry at zope.com (Barry Warsaw)
! """email package exception classes.
! """
--- 1,6 ----
! # Copyright (C) 2001-2004 Python Software Foundation
! # Author: barry at python.org (Barry Warsaw)
! """email package exception classes."""
***************
*** 25,26 ****
--- 24,49 ----
class MultipartConversionError(MessageError, TypeError):
"""Conversion to a multipart is prohibited."""
+
+
+
+ # These are parsing defects which the parser was able to work around.
+ class MessageDefect:
+ """Base class for a message defect."""
+
+ def __init__(self, line=None):
+ self.line = line
+
+ class NoBoundaryInMultipart(MessageDefect):
+ """A message claimed to be a multipart but had no boundary parameter."""
+
+ class StartBoundaryNotFound(MessageDefect):
+ """The claimed start boundary was never found."""
+
+ class FirstHeaderLineIsContinuation(MessageDefect):
+ """A message had a continuation line as its first header line."""
+
+ class MisplacedEnvelopeHeader(MessageDefect):
+ """A 'Unix-from' header was found in the middle of a header block."""
+
+ class MalformedHeader(MessageDefect):
+ """Found a header that was missing a colon, or was otherwise malformed"""
More information about the Python-checkins
mailing list