diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-08-22 01:13:51 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-08-22 01:13:51 (GMT) |
commit | b8c537094d52dc07434df757c4c29c0f6c6e76d4 (patch) | |
tree | 749de3324b11d8af63dbda2e096b6e8a7a9dc329 /Lib/email/message.py | |
parent | cba2e3c2e9f219043ddef0a896748f50691b3c47 (diff) | |
parent | 00ae435deef434f471e39bea3f3ab3a3e3cd90fe (diff) | |
download | cpython-b8c537094d52dc07434df757c4c29c0f6c6e76d4.zip cpython-b8c537094d52dc07434df757c4c29c0f6c6e76d4.tar.gz cpython-b8c537094d52dc07434df757c4c29c0f6c6e76d4.tar.bz2 |
Merge #18324: set_payload now correctly handles binary input.
Diffstat (limited to 'Lib/email/message.py')
-rw-r--r-- | Lib/email/message.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py index b5f7b3a..ebaf1c1 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -303,6 +303,8 @@ class Message: Optional charset sets the message's default character set. See set_charset() for details. """ + if isinstance(payload, bytes): + payload = payload.decode('ascii', 'surrogateescape') self._payload = payload if charset is not None: self.set_charset(charset) |