This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email.encoders are broken
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: r.david.murray Nosy List: eric.araujo, python-dev, r.david.murray, sdaoden
Priority: normal Keywords: patch

Created on 2011-04-06 11:04 by sdaoden, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_email.1.diff sdaoden, 2011-04-06 11:04 review
Messages (8)
msg133120 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-04-06 11:04
This is what one gets if using a BytesParser() generated message:


encoders.encode_7or8bit(msg)
AttributeError: 'list' object has no attribute 'decode'

encoders.encode_base64(msg)
TypeError: expected bytes, not list

encoders.encode_quopri(msg)
TypeError: 'list' does not support the buffer interface


I'll attach a diff against 3.3 test_email.py which adds stupid
tests (there is really no assertNoRaises()).
Maybe they should also be extended so that it is actually tested
wether the generated content is also correct.
msg144205 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-09-17 16:19
I think this is historic either?
As far as i remember you solved it as part of another issue...
msg144219 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-09-17 20:06
I may have, but I'd prefer to check before closing the issue.  (I'm deep in another project right now, but I'll review all these open bugs this fall some time).
msg156121 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-17 02:06
New changeset 1be426a555ca by R David Murray in branch '3.2':
#11780: document that email.encoders throw TypeError on multipart messages.
http://hg.python.org/cpython/rev/1be426a555ca

New changeset 060eda590fa0 by R David Murray in branch 'default':
Merge #11780: document that email.encoders throw TypeError on multipart messages.
http://hg.python.org/cpython/rev/060eda590fa0

New changeset c894e2ea9ff7 by R David Murray in branch '2.7':
#11780: document that email.encoders throw TypeError on multipart messages.
http://hg.python.org/cpython/rev/c894e2ea9ff7
msg156122 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-17 02:08
Nope, those errors are correct.  The encodings functions do not apply to Multipart messages.  I've updated the docs to reflect that.
msg156123 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-03-17 02:08
I think it’s best to always say that exceptions are raised, and keep “throw” for the generator method.  It’s consistent and avoids confusion.
msg156124 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-17 02:11
New changeset 195b67c26ce7 by R David Murray in branch '3.2':
#11780: s/throw/raise/
http://hg.python.org/cpython/rev/195b67c26ce7

New changeset 63c46a8547fb by R David Murray in branch 'default':
Merge #11780: s/throw/raise/
http://hg.python.org/cpython/rev/63c46a8547fb

New changeset 55993cd25564 by R David Murray in branch '2.7':
#11780: s/throw/raise/
http://hg.python.org/cpython/rev/55993cd25564
msg156125 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-03-17 02:11
Thanks, fixed.
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55989
2012-03-17 02:11:50r.david.murraysetmessages: + msg156125
2012-03-17 02:11:41python-devsetmessages: + msg156124
2012-03-17 02:08:24eric.araujosetnosy: + eric.araujo
messages: + msg156123
2012-03-17 02:08:03r.david.murraysetstatus: open -> closed

components: + Documentation, - Library (Lib)
versions: + Python 2.7
messages: + msg156122
type: behavior
resolution: fixed
stage: resolved
2012-03-17 02:06:24python-devsetnosy: + python-dev
messages: + msg156121
2011-09-17 20:06:07r.david.murraysetstatus: closed -> open

messages: + msg144219
2011-09-17 16:19:07sdaodensetstatus: open -> closed

messages: + msg144205
2011-04-06 11:28:59r.david.murraysetassignee: r.david.murray

nosy: + r.david.murray
2011-04-06 11:04:56sdaodencreate