diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -552,6 +552,15 @@ msg._payload = x self.assertEqual(msg.get_payload(decode=True), x) + def test_binary_quopri_payload(self): + # Although not documented, this is supposed to work. + msg = Message() + msg['content-type'] = 'text/plain; charset=latin-1' + msg['content-transfer-encoding'] = 'quoted-printable' + msg.set_payload(b'foo=e6=96=87bar') + self.assertEqual(msg.get_payload(decode=True), + b'foo\xe6\x96\x87bar') + # Issue 1078919 def test_ascii_add_header(self): msg = Message()