[issue11606] maxlinelen exceeded by email module's body_encode() function

R. David Murray report at bugs.python.org
Wed Mar 23 22:43:49 CET 2011


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

Michael, in general your approach looks sound and is much easier to read and comprehend than the original code (which, as the comments say, was never refined from the original quick and dirty hack).  However, rather than dynamically defining sub-functions each time body_encode is called, I've moved the body-construction logic almost completely out of body_encode into a helper object.  I think this further clarifies the algorithm.  I also used a simpler approach to end-of-list detection (enumerate).  That change is more a matter of taste, but does have the advantage of taking fewer lines of code.

If you have time to review this and double check my changes (the tests pass, at least), that would be great.  Otherwise I'll just go ahead and apply it.

----------
nosy: +barry
Added file: http://bugs.python.org/file21363/quoprimime_body_encode_algorithm.patch

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


More information about the Python-bugs-list mailing list