#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:
R David Murray 2013-12-11 16:52:11 -05:00
parent 34bd9fc59a
commit 50bfbb9903
6 changed files with 85 additions and 38 deletions

View file

@ -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")