From: Barry Warsaw Date: Mon, 17 Mar 2003 18:35:42 +0000 (+0000) Subject: getaddrlist(): Make sure this consumes all the data, and if there is X-Git-Tag: v2.3c1~1445 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa348c876f990c16e7f9057358765f34396e7d76;p=thirdparty%2FPython%2Fcpython.git getaddrlist(): Make sure this consumes all the data, and if there is no address there (perhaps because of invalid characters, it appends ('', '') to the result set. Closes mimelib SF bug # 697641. --- diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py index ef9423aadf7a..2b28b6430488 100644 --- a/Lib/email/_parseaddr.py +++ b/Lib/email/_parseaddr.py @@ -196,12 +196,12 @@ class AddrlistClass: Returns a list containing all of the addresses. """ result = [] - while True: + while self.pos < len(self.field): ad = self.getaddress() if ad: result += ad else: - break + result.append(('', '')) return result def getaddress(self):