From: Guido van Rossum Date: Tue, 15 Jun 1999 18:06:20 +0000 (+0000) Subject: Barry Scott writes: X-Git-Tag: v1.6a1~1217 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b18448705501a5962ebd3946033fdc4b03cdf58a;p=thirdparty%2FPython%2Fcpython.git Barry Scott writes: Problem: rfc822.py in 1.5.2 final loses the quotes around quoted local-part names. The fix is to preserve the quotes around a local-part name in an address. Test: import rfc822 a = rfc822.AddrlistClass('(Comment stuff) "Quoted name"@somewhere.com') a.getaddrlist() The correct result is: [('Comment stuff', '"Quoted name"@somewhere.com')] --- diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 96a02d1c2b7a..662703beca3b 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -624,7 +624,7 @@ class AddrlistClass: aslist.append('.') self.pos = self.pos + 1 elif self.field[self.pos] == '"': - aslist.append(self.getquote()) + aslist.append('"%s"' % self.getquote()) elif self.field[self.pos] in self.atomends: break else: aslist.append(self.getatom())