Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b184487

Browse files
committed
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')]
1 parent 1e44029 commit b184487

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/rfc822.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def getaddrspec(self):
624624
aslist.append('.')
625625
self.pos = self.pos + 1
626626
elif self.field[self.pos] == '"':
627-
aslist.append(self.getquote())
627+
aslist.append('"%s"' % self.getquote())
628628
elif self.field[self.pos] in self.atomends:
629629
break
630630
else: aslist.append(self.getatom())

0 commit comments

Comments
 (0)