[issue1590744] mail message parsing glitch

R. David Murray report at bugs.python.org
Thu Mar 24 14:55:43 CET 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

I needed an airplane-trip-sized problem to work on on the way back from PyCon and the sprints, so I tried my hand at "fixing" this.  The attached patch is really just a proof of concept.  Because it is so invasive of the email package machinery I doubt that I will apply it, but it does serve to prove that it is quite practical, given the right design, to preserve the leading whitespace in message headers, and this does enable the email package to read and write the messages in the sample mbox without changing them.  I will incorporate what I learned from this exercise into the header management in email6.

On the other hand, if anyone else thinks this *is* worth tidying up an applying I could be convinced.

Note that after this patch one test fails, but that test failure is actually a buggy test that hides a bug in the header formatter (a failure to provide folding white space at the start of a continuation line).  That bug I may revisit.

----------
keywords: +patch
Added file: http://bugs.python.org/file21370/preserve_leading_whitespace.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1590744>
_______________________________________


More information about the Python-bugs-list mailing list