Message268438
FWIW in the HTTP bug <https://bugs.python.org/issue24363#msg244676>, David said “when seeing a line that doesn't look like a header the error recovery is to treat that line as the beginning of the body (ie: assume the blank line is missing).” I have no experience with email and RFC 5322 header handling, but it does make more sense to me to handle this as a defect in the header section, _not_ a genuine transition to the body (same as desired for the HTTP case).
Here is a patch that revives MalformedHeaderDefect (see Issue 14925), and continues parsing the rest of the header section instead of starting the body. But I am not sure how safe this change is. I did have to fix one unrelated set of tests (see headertest_msg in the Test8BitBytesHandling class) that did not include a blank line and was relying on the old behaviour. |
|
Date |
User |
Action |
Args |
2016-06-13 12:59:00 | martin.panter | set | recipients:
+ martin.panter, barry, msapiro, r.david.murray |
2016-06-13 12:58:57 | martin.panter | set | messageid: <1465822737.98.0.674119687358.issue26686@psf.upfronthosting.co.za> |
2016-06-13 12:58:57 | martin.panter | link | issue26686 messages |
2016-06-13 12:58:57 | martin.panter | create | |
|