From: Barry Warsaw Date: Mon, 10 May 2004 14:48:30 +0000 (+0000) Subject: _parse_headers(): Strip a trailing newline from the envelope header. Closes X-Git-Tag: v2.4a1~411 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c29db265296b3c31b1f102fced2773ed468ab639;p=python _parse_headers(): Strip a trailing newline from the envelope header. Closes SF #951088. --- diff --git a/Lib/email/FeedParser.py b/Lib/email/FeedParser.py index 0bb92712ae..806277f082 100644 --- a/Lib/email/FeedParser.py +++ b/Lib/email/FeedParser.py @@ -404,6 +404,10 @@ class FeedParser: # Check for envelope header, i.e. unix-from if line.startswith('From '): 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) continue elif lineno == len(lines) - 1: