Issue 4491: email.Header.decode_header() doesn't work if encoded-word was separeted by CRLF (original) (raw)

email.Header.decode_header() doesn't work if encoded-word was separeted by CRLF.

For exmaple, decode_header('=?iso-8859-1?q?hello?=\r\n world.') returns [('=?iso-8859-1?q?hello?=\r\n world.', None)], not [('hello', 'iso-8859-1'), (' world.', None)].

This bug was caused by rev.54371, bug #1582282. I attached a patch to fix problem and test-case.