From fa348c876f990c16e7f9057358765f34396e7d76 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 17 Mar 2003 18:35:42 +0000 Subject: [PATCH] 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. --- Lib/email/_parseaddr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py index ef9423aadf..2b28b64304 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): -- 2.50.1