mirror of https://github.com/python/cpython
a6fdb31b67
* Fix for email.generator.Generator with whitespace between encoded words. email.generator.Generator currently does not handle whitespace between encoded words correctly when the encoded words span multiple lines. The current generator will create an encoded word for each line. If the end of the line happens to correspond with the end real word in the plaintext, the generator will place an unencoded space at the start of the subsequent lines to represent the whitespace between the plaintext words. A compliant decoder will strip all the whitespace from between two encoded words which leads to missing spaces in the round-tripped output. The fix for this is to make sure that whitespace between two encoded words ends up inside of one or the other of the encoded words. This fix places the space inside of the second encoded word. A second problem happens with continuation lines. A continuation line that starts with whitespace and is followed by a non-encoded word is fine because the newline between such continuation lines is defined as condensing to a single space character. When the continuation line starts with whitespace followed by an encoded word, however, the RFCs specify that the word is run together with the encoded word on the previous line. This is because normal words are filded on syntactic breaks by encoded words are not. The solution to this is to add the whitespace to the start of the encoded word on the continuation line. Test cases are from #92081 * Rename a variable so it's not confused with the final variable. |
||
---|---|---|
.. | ||
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 |