From: Barry Warsaw Date: Tue, 10 Sep 2002 16:14:56 +0000 (+0000) Subject: _parsebody(): Instead of raising a BoundaryError when no start X-Git-Tag: v2.3c1~4151 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=034b47acfe0f507cc4b1d8804272ca92d491d06e;p=thirdparty%2FPython%2Fcpython.git _parsebody(): Instead of raising a BoundaryError when no start boundary could be found -- in a lax parser -- the entire body is assigned to the message payload. --- diff --git a/Lib/email/Parser.py b/Lib/email/Parser.py index a2ac576436bc..869ef1618d2e 100644 --- a/Lib/email/Parser.py +++ b/Lib/email/Parser.py @@ -135,8 +135,11 @@ class Parser: r'(?P' + re.escape(separator) + r')(?P[ \t]*)', payload) if not mo: - raise Errors.BoundaryError( - "Couldn't find starting boundary: %s" % boundary) + if self._strict: + raise Errors.BoundaryError( + "Couldn't find starting boundary: %s" % boundary) + container.set_payload(payload) + return start = mo.start() if start > 0: # there's some pre-MIME boundary preamble