Karthikeyan Singaravelan <[email protected]> added the comment:
There is a behavior change with my fix. 7bit is returned for
Content-Transfer-Encoding before commit and skipping the heuristic if line is
empty to avoid ValueError will return quoted-printable for
Content-Transfer-Encoding. This is a behavior change even if the ValueError is
fixed. I would like to confirm which is the correct behavior and to be
documented appropriately.
Test Case in test_contentmanager.py :
def test_set_text_plain_empty_content_heuristics(self):
m = self._make_message()
content = ""
raw_data_manager.set_content(m, content)
self.assertEqual(str(m), textwrap.dedent("""\
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
"""))
self.assertEqual(m.get_payload(decode=True).decode('utf-8'), "\n")
self.assertEqual(m.get_content(), "\n")
----------
nosy: +maxking
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41206>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com