classification
Title: email: ContentManager.set_content calls nonexistent method encode() on bytes
Type: Stage: resolved
Components: email Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, joreiff, lukasz.langa, miss-islington, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2020-07-26 17:59 by joreiff, last changed 2021-08-10 07:52 by lukasz.langa. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21631 merged python-dev, 2020-07-26 18:12
PR 27686 merged miss-islington, 2021-08-09 16:45
PR 27687 merged miss-islington, 2021-08-09 16:45
Messages (9)
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?
msg376109 - (view) Author: Johannes Reiff (joreiff) * Date: 2020-08-30 15:00
It has been almost a month since the last update, so pinging as suggested in the Developer's Guide. Do I need to do something before the PR can be merged?
msg386596 - (view) Author: Johannes Reiff (joreiff) * Date: 2021-02-07 18:06
Could someone comment on the way forward? Or ideally just merge my PR (it was approved on GitHub)? I am still very much interested in this bug getting fixed.
msg399278 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-09 16:45
New changeset b33186bc43bb5aaf652dd9d093a08fdde796d499 by Johannes Reiff in branch 'main':
bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631)
https://github.com/python/cpython/commit/b33186bc43bb5aaf652dd9d093a08fdde796d499
msg399292 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-09 22:35
New changeset 395f4c7fbfb89b8724a4abf84410b5e1e374932d by Miss Islington (bot) in branch '3.9':
bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) (GH-27687)
https://github.com/python/cpython/commit/395f4c7fbfb89b8724a4abf84410b5e1e374932d
msg399297 - (view) Author: miss-islington (miss-islington) Date: 2021-08-09 23:44
New changeset a3185da26f8c818907c297d92c533deaa96f40fd by Miss Islington (bot) in branch '3.10':
bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631)
https://github.com/python/cpython/commit/a3185da26f8c818907c297d92c533deaa96f40fd
msg399301 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-08-10 07:52
Thanks, Johannes! ✨ 🍰 ✨
History
Date User Action Args
2021-08-10 07:52:58lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg399301

stage: patch review -> resolved
2021-08-09 23:44:25miss-islingtonsetmessages: + msg399297
2021-08-09 22:35:06lukasz.langasetmessages: + msg399292
2021-08-09 16:45:56miss-islingtonsetpull_requests: + pull_request26173
2021-08-09 16:45:50miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26172
2021-08-09 16:45:45lukasz.langasetnosy: + lukasz.langa
messages: + msg399278
2021-08-09 16:23:01lukasz.langasetversions: + Python 3.11, - Python 3.8
2021-02-07 18:06:52joreiffsetmessages: + msg386596
2020-08-30 15:00:39joreiffsetmessages: + msg376109
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