summaryrefslogtreecommitdiffstats
path: root/Lib/email/test
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2006-01-17 05:58:08 (GMT)
committerBarry Warsaw <barry@python.org>2006-01-17 05:58:08 (GMT)
commit615320127428bc97c1e1dd96cf4ac5c8f407554c (patch)
tree2723d3bd37fc10c461e84038c0bf6fc4829277cc /Lib/email/test
parent20bad74d6394a0e9ee82d776b8e4b93de352214a (diff)
downloadcpython-615320127428bc97c1e1dd96cf4ac5c8f407554c.zip
cpython-615320127428bc97c1e1dd96cf4ac5c8f407554c.tar.gz
cpython-615320127428bc97c1e1dd96cf4ac5c8f407554c.tar.bz2
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.
Diffstat (limited to 'Lib/email/test')
-rw-r--r--Lib/email/test/test_email.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index c78e2fd..c22603d 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -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):