diff --git a/Lib/email/message.py b/Lib/email/message.py index a14cca56b3745a..46bb8c21942af8 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -294,7 +294,7 @@ def get_payload(self, i=None, decode=False): try: bpayload = payload.encode('ascii', 'surrogateescape') try: - payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace') + payload = bpayload.decode(self.get_content_charset('ascii'), 'replace') except LookupError: payload = bpayload.decode('ascii', 'replace') except UnicodeEncodeError: diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index d9af05c306eb30..65ddbabcaa1997 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -4181,6 +4181,21 @@ def test_8bit_in_uuencode_body(self): self.assertEqual(msg.get_payload(decode=True), '<,.V