summaryrefslogtreecommitdiff
path: root/Lib/email
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2004-05-11 22:23:59 +0000
committerBarry Warsaw <barry@python.org>2004-05-11 22:23:59 +0000
commita1e7b88e491f3c6f5eea08f26c08250e1b4f4a42 (patch)
tree2a092bbef93a0b9cc4730a714d2d649a2accfdd5 /Lib/email
parentfd09d0a86ceaf1a206decaaff6bc541f332917b4 (diff)
downloadcpython-a1e7b88e491f3c6f5eea08f26c08250e1b4f4a42.tar.gz
Tests for message/external-body and for duplicate boundary lines.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/FeedParser.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/email/FeedParser.py b/Lib/email/FeedParser.py
index d28170e949..294a6a5a78 100644
--- a/Lib/email/FeedParser.py
+++ b/Lib/email/FeedParser.py
@@ -306,9 +306,18 @@ class FeedParser:
capturing_preamble = False
self._input.unreadline(line)
continue
- # We saw a boundary separating two parts. Recurse to
- # parse this subpart; the input stream points at the
- # subpart's first line.
+ # We saw a boundary separating two parts. Consume any
+ # multiple boundary lines that may be following. Our
+ # interpretation of RFC 2046 BNF grammar does not produce
+ # body parts within such double boundaries.
+ while True:
+ line = self._input.readline()
+ mo = boundaryre.match(line)
+ if not mo:
+ self._input.unreadline(line)
+ break
+ # Recurse to parse this subpart; the input stream points
+ # at the subpart's first line.
self._input.push_eof_matcher(boundaryre.match)
for retval in self._parsegen():
if retval is NeedMoreData: