mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
_parse_headers(): Strip a trailing newline from the envelope header. Closes
SF #951088.
This commit is contained in:
parent
6f3b033774
commit
c29db26529
1 changed files with 4 additions and 0 deletions
|
|
@ -404,6 +404,10 @@ class FeedParser:
|
||||||
# Check for envelope header, i.e. unix-from
|
# Check for envelope header, i.e. unix-from
|
||||||
if line.startswith('From '):
|
if line.startswith('From '):
|
||||||
if lineno == 0:
|
if lineno == 0:
|
||||||
|
# Strip off the trailing newline
|
||||||
|
mo = NLCRE_eol.search(line)
|
||||||
|
if mo:
|
||||||
|
line = line[:-len(mo.group(0))]
|
||||||
self._cur.set_unixfrom(line)
|
self._cur.set_unixfrom(line)
|
||||||
continue
|
continue
|
||||||
elif lineno == len(lines) - 1:
|
elif lineno == len(lines) - 1:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue