summaryrefslogtreecommitdiffstats
path: root/Lib/email/_parseaddr.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-03-17 18:35:42 (GMT)
committerBarry Warsaw <barry@python.org>2003-03-17 18:35:42 (GMT)
commitfa348c876f990c16e7f9057358765f34396e7d76 (patch)
tree2cba27629a39a21c5a6cd7b54323824b59ba709e /Lib/email/_parseaddr.py
parentc2ca32d9aef458067d61706158673d8a0920722c (diff)
downloadcpython-fa348c876f990c16e7f9057358765f34396e7d76.zip
cpython-fa348c876f990c16e7f9057358765f34396e7d76.tar.gz
cpython-fa348c876f990c16e7f9057358765f34396e7d76.tar.bz2
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/_parseaddr.py')
-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 ef9423a..2b28b64 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):