mirror of
https://github.com/python/cpython.git
synced 2024-11-27 03:45:08 +08:00
ed81971e6b
The header-folder of the new email API has a long standing known buglet where if the first token is longer than max_line_length, it puts that token on the next line. It turns out there is also a *parsing* bug when parsing such a header: the space prefixing that first, non-empty line gets preserved and tacked on to the start of the header value, which is not the expected behavior per the RFCs. The bug arises from the fact that the parser assumed that there would be at least one token on the line with the header, which is going to be true for probably every email producer other than the python email library with its folding buglet. Clearly, though, this is a case that needs to be handled correctly. The fix is simple: strip the blanks off the start of the whole value, not just the first physical line of the value. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> |
||
---|---|---|
.. | ||
mime | ||
__init__.py | ||
_encoded_words.py | ||
_header_value_parser.py | ||
_parseaddr.py | ||
_policybase.py | ||
architecture.rst | ||
base64mime.py | ||
charset.py | ||
contentmanager.py | ||
encoders.py | ||
errors.py | ||
feedparser.py | ||
generator.py | ||
header.py | ||
headerregistry.py | ||
iterators.py | ||
message.py | ||
parser.py | ||
policy.py | ||
quoprimime.py | ||
utils.py |