From: Barry Warsaw Date: Tue, 13 Nov 2001 21:30:37 +0000 (+0000) Subject: Fix for bug #481221, getaddrlist() failing on long addresses. X-Git-Tag: v2.2.1c1~779 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1fd282f137952644a8c2a0330e3379e27a40582;p=thirdparty%2FPython%2Fcpython.git Fix for bug #481221, getaddrlist() failing on long addresses. --- diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 00199495885e..9ad2f8f84f1c 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -546,10 +546,14 @@ class AddrlistClass: Returns a list containing all of the addresses. """ - ad = self.getaddress() - if ad: - return ad + self.getaddrlist() - else: return [] + result = [] + while 1: + ad = self.getaddress() + if ad: + result += ad + else: + break + return result def getaddress(self): """Parse the next address."""