W. Trevor King added the comment:

In email._header_value_parser._Folded.append_if_fits, if I shift:

            if token.has_fws:
                ws = token.pop_leading_fws()
                if ws is not None:
                    self.stickyspace += str(ws)
                    stickyspace_len += len(ws)
                token._fold(self)
                return True

to:

            if token.has_fws:
                ws = token.pop_leading_fws()
                if ws is not None:
                    self.stickyspace += str(ws)
                    stickyspace_len += len(ws)
                    token._fold(self)
                    return True

I can avoid the recursion.

The problem seems to be that the "a aaaa…aaa" token/part contains folding white 
space, but doesn't *start* with folding whitespace.  Maybe the folding should 
try to split on existing FWS, instead of just trying to pop leading FWS?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22684>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to