[issue44637] Quoting issue on header Reply-To

Julien Castiaux report at bugs.python.org
Thu Jul 15 09:15:28 EDT 2021


Julien Castiaux <julien.castiaux at gmail.com> added the comment:

Hello David,

I'm working in the same company as Baptiste and I'm trying to solve the problem. The issue is indeed related to the folding algorithm, the DBQUOTE character is lost in the parse_tree AST thus when the folding algo split the children to find a sweat spot to split the line it doesn't re-introduce the DBQUOTE and instead inject the content of the BareQuotedString right away.

I'm working on a fix which consist of adding two DBQUOTE, one at the beginning and one at the end, of the BareQuotedString token when it is created (_header_value_parser.py at get_bare_quoted_string()). I was inspired by how the angles < and > are injected around the AddrSpec token in a AngleAddr token.

Right now my fix isn't correct, there are some unittest falling. I'm trying to get it working and hopefully get back to you with a nice pull-request :)

Regards,
Julien

----------

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


More information about the Python-bugs-list mailing list