Fix bpo-36041: fix folding of quoted string in display_name violates RFC · Pull Request #12054 · python/cpython

added 2 commits

February 26, 2019 14:21
For display names that are longer than the policy's maximum line length,
the folding process removes the quotes from the display name which
may violate the structure of an address header if the content of the
display name is specifically formed.
Since the _refold_parse_tree is context unaware, the function is unable
to determine if we can directly encode the text into the header. In the
language of RFC 5322, _refold_parse_tree is unaware if it is folding a
structured header or an unstructured header.

Since a quoted string will always be acceptable for both header types,
when a quoted string needs to be refolded (because it would make the
line overflow) prepare quoted children instead of the usual semantic
children of the BareQuotedString.

@ghost ghost changed the title bpo-36041 Fix bug 36041: folding of quoted string in display_name violates RFC

Feb 27, 2019

@ghost ghost changed the title Fix bug 36041: folding of quoted string in display_name violates RFC bug 36041: fix folding of quoted string in display_name violates RFC

Feb 27, 2019

@ghost ghost changed the title bug 36041: fix folding of quoted string in display_name violates RFC Fix bpo-36041: fix folding of quoted string in display_name violates RFC

Feb 27, 2019

@ghost ghost closed this by deleting the head repository

Oct 18, 2023

This pull request was closed.