mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
#19063: fix set_payload handling of non-ASCII string input.
This version of the fix raises an error instead of accepting the invalid input (ie: if a non-ASCII string is used but no charset is specified).
This commit is contained in:
parent
34bd9fc59a
commit
50bfbb9903
6 changed files with 85 additions and 38 deletions
|
@ -208,12 +208,11 @@ class TestRawDataManager(TestEmailBase):
|
|||
"Basìc tëxt.\n")
|
||||
|
||||
def test_get_text_plain_utf8_base64_recoverable_bad_CTE_data(self):
|
||||
m = self._str_msg(textwrap.dedent("""\
|
||||
m = self._bytes_msg(textwrap.dedent("""\
|
||||
Content-Type: text/plain; charset="utf8"
|
||||
Content-Transfer-Encoding: base64
|
||||
|
||||
QmFzw6xjIHTDq3h0Lgo\xFF=
|
||||
"""))
|
||||
QmFzw6xjIHTDq3h0Lgo""").encode('ascii') + b'\xFF=\n')
|
||||
self.assertEqual(raw_data_manager.get_content(m, errors='ignore'),
|
||||
"Basìc tëxt.\n")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue