From: Barry Warsaw Date: Tue, 11 May 2004 18:10:15 +0000 (+0000) Subject: _parsegen(): Watch out for empty epilogues. X-Git-Tag: v2.4a1~400 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b44cd64d7a05b2f31c927e2b784789a8094a270;p=thirdparty%2FPython%2Fcpython.git _parsegen(): Watch out for empty epilogues. --- diff --git a/Lib/email/FeedParser.py b/Lib/email/FeedParser.py index 806277f08210..c980f9a328df 100644 --- a/Lib/email/FeedParser.py +++ b/Lib/email/FeedParser.py @@ -365,10 +365,11 @@ class FeedParser: # Any CRLF at the front of the epilogue is not technically part of # the epilogue. Also, watch out for an empty string epilogue, # which means a single newline. - firstline = epilogue[0] - bolmo = NLCRE_bol.match(firstline) - if bolmo: - epilogue[0] = firstline[len(bolmo.group(0)):] + if epilogue: + firstline = epilogue[0] + bolmo = NLCRE_bol.match(firstline) + if bolmo: + epilogue[0] = firstline[len(bolmo.group(0)):] self._cur.epilogue = EMPTYSTRING.join(epilogue) return # Otherwise, it's some non-multipart type, so the entire rest of the