mirror of
https://github.com/python/cpython.git
synced 2025-09-19 15:10:58 +00:00
Tests for message/external-body and for duplicate boundary lines.
This commit is contained in:
parent
b067e6287b
commit
486cb0ac2a
1 changed files with 12 additions and 3 deletions
|
@ -306,9 +306,18 @@ class FeedParser:
|
||||||
capturing_preamble = False
|
capturing_preamble = False
|
||||||
self._input.unreadline(line)
|
self._input.unreadline(line)
|
||||||
continue
|
continue
|
||||||
# We saw a boundary separating two parts. Recurse to
|
# We saw a boundary separating two parts. Consume any
|
||||||
# parse this subpart; the input stream points at the
|
# multiple boundary lines that may be following. Our
|
||||||
# subpart's first line.
|
# 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)
|
self._input.push_eof_matcher(boundaryre.match)
|
||||||
for retval in self._parsegen():
|
for retval in self._parsegen():
|
||||||
if retval is NeedMoreData:
|
if retval is NeedMoreData:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue