Title: email: ContentManager.set_content calls nonexistent method encode() on bytes
Type: Stage: patch review
Components: email Versions: Python 3.10, Python 3.9, Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, joreiff, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2020-07-26 17:59 by joreiff, last changed 2020-08-01 19:39 by joreiff.

Pull Requests
URL Status Linked Edit
PR 21631 open python-dev, 2020-07-26 18:12
Messages (3)
msg374337 - (view) Author: Johannes Reiff (joreiff) * Date: 2020-07-26 17:59
If assigning binary content to an EmailMessage via set_content(), the function email.contentmanager.set_bytes_content() is called. This function fails when choosing the 7bit transfer encoding because of a call to data.decode('ascii').
msg374641 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2020-07-31 13:17
The fix looks good to me.  Don't know how I made that mistake, and obviously I didn't write a test for it...
msg374667 - (view) Author: Johannes Reiff (joreiff) * Date: 2020-08-01 19:39
Thanks! Is there anything I need to do regarding the Python 3.8 and 3.9 backports?
Date User Action Args
2020-08-01 19:39:43joreiffsetmessages: + msg374667
2020-07-31 13:17:59r.david.murraysetmessages: + msg374641
2020-07-26 18:12:12python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request20772
stage: patch review
2020-07-26 17:59:16joreiffcreate