mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail addresses. E.g. "Foo ((Foo Bar)) <foo@example.com>" Fixes for both rfc822.py and email package. This patch needs to be back ported to Python 2.3 for email 2.5.
This commit is contained in:
parent
09612281ef
commit
dbcc8d9b24
5 changed files with 24 additions and 0 deletions
|
@ -45,6 +45,10 @@ class MessageTestCase(unittest.TestCase):
|
|||
print 'extra parsed address:', repr(n), repr(a)
|
||||
continue
|
||||
i = i + 1
|
||||
self.assertEqual(mn, n,
|
||||
"Un-expected name: %s != %s" % (`mn`, `n`))
|
||||
self.assertEqual(ma, a,
|
||||
"Un-expected address: %s != %s" % (`ma`, `a`))
|
||||
if mn == n and ma == a:
|
||||
pass
|
||||
else:
|
||||
|
@ -129,6 +133,12 @@ class MessageTestCase(unittest.TestCase):
|
|||
'To: person@dom.ain (User J. Person)\n\n',
|
||||
[('User J. Person', 'person@dom.ain')])
|
||||
|
||||
def test_doublecomment(self):
|
||||
# The RFC allows comments within comments in an email addr
|
||||
self.check(
|
||||
'To: person@dom.ain ((User J. Person)), John Doe <foo@bar.com>\n\n',
|
||||
[('User J. Person', 'person@dom.ain'), ('John Doe', 'foo@bar.com')])
|
||||
|
||||
def test_twisted(self):
|
||||
# This one is just twisted. I don't know what the proper
|
||||
# result should be, but it shouldn't be to infloop, which is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue