summaryrefslogtreecommitdiff
path: root/Lib/rfc822.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-11-13 21:30:37 +0000
committerBarry Warsaw <barry@python.org>2001-11-13 21:30:37 +0000
commit3a461d58ab3d3f234f354559fbf5856eed86565f (patch)
tree3b7beb1073a2bdf701408e9e18a730bee1a5ee16 /Lib/rfc822.py
parentc0f61aa67d84eb75592a0d6ad387179cfdecd435 (diff)
downloadcpython-3a461d58ab3d3f234f354559fbf5856eed86565f.tar.gz
Fix for bug #481221, getaddrlist() failing on long addresses.
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r--Lib/rfc822.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 0019949588..9ad2f8f84f 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."""