diff options
author | R David Murray <rdmurray@bitdance.com> | 2016-09-07 21:46:55 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2016-09-07 21:46:55 (GMT) |
commit | 1badd2816361354f5e69d234b4ff3315f5f590cc (patch) | |
tree | becb75e793dfd3ea3e0b49865a34023768b4ba0d /Lib/test/test_email/test_email.py | |
parent | d0600ed524acb8b05b78d7399e8de136090703a0 (diff) | |
parent | dc1650ca062a99d41a029a6645dc72fd7d820c94 (diff) | |
download | cpython-1badd2816361354f5e69d234b4ff3315f5f590cc.zip cpython-1badd2816361354f5e69d234b4ff3315f5f590cc.tar.gz cpython-1badd2816361354f5e69d234b4ff3315f5f590cc.tar.bz2 |
Merge: #22233: Only split headers on \r and/or \n, per email RFCs.
Diffstat (limited to 'Lib/test/test_email/test_email.py')
-rw-r--r-- | Lib/test/test_email/test_email.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 85fccf9..30ea77f 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -3484,10 +3484,12 @@ class TestFeedParsers(TestEmailBase): self.assertEqual(m.keys(), ['a', 'b']) m = self.parse(['a:\r', '\nb:\n']) self.assertEqual(m.keys(), ['a', 'b']) + + # Only CR and LF should break header fields m = self.parse(['a:\x85b:\u2028c:\n']) - self.assertEqual(m.items(), [('a', '\x85'), ('b', '\u2028'), ('c', '')]) + self.assertEqual(m.items(), [('a', '\x85b:\u2028c:')]) m = self.parse(['a:\r', 'b:\x85', 'c:\n']) - self.assertEqual(m.items(), [('a', ''), ('b', '\x85'), ('c', '')]) + self.assertEqual(m.items(), [('a', ''), ('b', '\x85c:')]) def test_long_lines(self): # Expected peak memory use on 32-bit platform: 6*N*M bytes. |