summaryrefslogtreecommitdiff
path: root/Lib/email
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-03-17 18:35:42 +0000
committerBarry Warsaw <barry@python.org>2003-03-17 18:35:42 +0000
commitfa348c876f990c16e7f9057358765f34396e7d76 (patch)
tree2cba27629a39a21c5a6cd7b54323824b59ba709e /Lib/email
parentc2ca32d9aef458067d61706158673d8a0920722c (diff)
downloadcpython-git-fa348c876f990c16e7f9057358765f34396e7d76.tar.gz
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.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/_parseaddr.py4
1 files 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):