summaryrefslogtreecommitdiff
path: root/Lib/email/_parseaddr.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2007-03-12 03:20:01 +0000
committerBarry Warsaw <barry@python.org>2007-03-12 03:20:01 +0000
commitcbbc3f19c157a1b464f0faa8a396777040e96c8e (patch)
tree84ea284742abbf5abef1c0086a72d2e9ae54a1b0 /Lib/email/_parseaddr.py
parent071d1ae1362e4444a28c66d9e49e36776efdd3a3 (diff)
downloadcpython-git-cbbc3f19c157a1b464f0faa8a396777040e96c8e.tar.gz
Tokio Kikuchi's fix for SF bug #1629369; folding whitespace allowed in the
display name of an email address, e.g. Foo \tBar <foo@example.com> Test case added by Barry.
Diffstat (limited to 'Lib/email/_parseaddr.py')
-rw-r--r--Lib/email/_parseaddr.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py
index a08c43e7f4..791d8928eb 100644
--- a/Lib/email/_parseaddr.py
+++ b/Lib/email/_parseaddr.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2006 Python Software Foundation
+# Copyright (C) 2002-2007 Python Software Foundation
# Contact: email-sig@python.org
"""Email address parsing code.
@@ -172,6 +172,7 @@ class AddrlistClass:
self.pos = 0
self.LWS = ' \t'
self.CR = '\r\n'
+ self.FWS = self.LWS + self.CR
self.atomends = self.specials + self.LWS + self.CR
# Note that RFC 2822 now specifies `.' as obs-phrase, meaning that it
# is obsolete syntax. RFC 2822 requires that we recognize obsolete
@@ -418,7 +419,7 @@ class AddrlistClass:
plist = []
while self.pos < len(self.field):
- if self.field[self.pos] in self.LWS:
+ if self.field[self.pos] in self.FWS:
self.pos += 1
elif self.field[self.pos] == '"':
plist.append(self.getquote())