mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
SF bug #1347874; FeedParser does not comply with RFC2822.
Change headerRE as suggested in the bug report, so that single character headers are accepted. Test case added too. Will backport to Python 2.4.
This commit is contained in:
parent
20bad74d63
commit
6153201274
2 changed files with 11 additions and 2 deletions
|
@ -2467,6 +2467,15 @@ Here's the message body
|
|||
msg = email.message_from_string(m)
|
||||
eq(len(msg.keys()), 0)
|
||||
|
||||
def test_rfc2822_one_character_header(self):
|
||||
eq = self.assertEqual
|
||||
m = 'A: first header\nB: second header\nCC: third header\n\nbody'
|
||||
msg = email.message_from_string(m)
|
||||
headers = msg.keys()
|
||||
headers.sort()
|
||||
eq(headers, ['A', 'B', 'CC'])
|
||||
eq(msg.get_payload(), 'body')
|
||||
|
||||
|
||||
|
||||
class TestBase64(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue