Kaydet (Commit) b1844870 authored tarafından Guido van Rossum's avatar Guido van Rossum

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')]
üst 1e440299
......@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment