[issue36041] email: folding of quoted string in display_name violates RFC

Aaryn Tonita report at bugs.python.org
Wed Feb 20 03:32:07 EST 2019


Aaryn Tonita <aaryn at startmail.com> added the comment:

Hi David, the problem is in email._header_value_parser._refold_parse_tree.

Specifically, when the parsetree renders too long, it recursively gets newparts = list(part) (the children). When it does this to a BareQuotedString node, the child nodes are unquoted and unescaped and it just happily serializes these.

I thought I had attached a file that monkey patches the _refold_parse_tree function with a fixed version... let me try again.

----------
Added file: https://bugs.python.org/file48158/address_folding_bug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36041>
_______________________________________


More information about the Python-bugs-list mailing list