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

2011-03-24 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

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

2011-03-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 37ba11d806c5 by R David Murray in branch '3.1': #11606: improved body_encode algorithm, no longer produces overlong lines http://hg.python.org/cpython/rev/37ba11d806c5 New changeset b801d55a9979 by R David Murray in branch '3.2': Merge #11606: impr

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

2011-03-24 Thread R. David Murray
R. David Murray added the comment: I turns out that issue 5803 has a patch that also fixes this bug, and the algorithm used there is even more efficient than the one you've developed here. However, it is also not compatible with the email5 version of quoprimime. It could be adapted, but I t

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

2011-03-24 Thread Michael Henry
Michael Henry added the comment: David, Your patch looks fine to me. I like putting the logic is a separate class as you've done. I looked in itertools for something to perform the job of the each_last() generator I'd had in my patch, but I didn't see anything. I like the idea of encapsulati

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

2011-03-23 Thread R. David Murray
R. David Murray 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 ea

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

2011-03-19 Thread R. David Murray
Changes by R. David Murray : -- assignee: -> r.david.murray stage: -> patch review type: -> behavior versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker _

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

2011-03-19 Thread Michael Henry
New submission from Michael Henry : The email module's body_encode() function (found in quoprimime.py) can generate oversized encoded lines that exceed the maximum line length specified by the maxlinelen parameter. The attached test case 'test_encode_trailing_space_at_maxlinelen' demonstrates the