diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-01-26 04:30:30 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-01-26 04:30:30 (GMT) |
commit | 155ceaa454ad9a623cade5ed326e6e1e70ce109d (patch) | |
tree | a670befde15514295bfa597d56d55fa9549dfa49 /Lib/test/test_email | |
parent | 7e4b9057b3180ed1b7b26dc8f9a2d2162d4e83b0 (diff) | |
download | cpython-155ceaa454ad9a623cade5ed326e6e1e70ce109d.zip cpython-155ceaa454ad9a623cade5ed326e6e1e70ce109d.tar.gz cpython-155ceaa454ad9a623cade5ed326e6e1e70ce109d.tar.bz2 |
handle headers with no key (closes #19996)
Patch by Cory Benfield.
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r-- | Lib/test/test_email/test_email.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index c3ecd0ab..227110f 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -3389,6 +3389,12 @@ class TestFeedParsers(TestEmailBase): feedparser.feed(chunk) return feedparser.close() + def test_empty_header_name_handled(self): + # Issue 19996 + msg = self.parse("First: val\n: bad\nSecond: val") + self.assertEqual(msg['First'], 'val') + self.assertEqual(msg['Second'], 'val') + def test_newlines(self): m = self.parse(['a:\nb:\rc:\r\nd:\n']) self.assertEqual(m.keys(), ['a', 'b', 'c', 'd']) |