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 quoted-printable encoding issue
Type: behavior Stage: resolved
Components: email, Library (Lib) Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: 5803 Superseder:
Assigned To: Nosy List: barry, milap.py, python-dev, r.david.murray, timar
Priority: normal Keywords:

Created on 2014-01-09 14:21 by timar, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
email.py milap.py, 2014-01-09 14:40
Messages (5)
msg207737 - (view) Author: Andras Timar (timar) Date: 2014-01-09 14:21
Try this sample script:

# coding=utf-8
import email
import email.charset
import email.message

c = email.charset.Charset('utf-8')
c.body_encoding = email.charset.QP
m = email.message.Message()
m.set_payload("This is a Greek letter upsilon: υ", c)
print(m.as_string())

Actual result: "This is a Greek letter upsilon: =CF" 
Expected result: "This is a Greek letter upsilon: =CF=85"
msg207738 - (view) Author: Milap Bhojak (milap.py) * Date: 2014-01-09 14:40
hope it will fix that issue
msg207744 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-01-09 16:16
This is a bug in quoprimime.body_encode.  If you put a newline on the end of your string, it will work as expected.

The patch in issue 5803 does not have the bug, so I'll probably just apply that to both 3.3 and 3.4.
msg208031 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-01-13 18:31
New changeset 4c5b1932354b by R David Murray in branch '3.3':
#20206, #5803: more efficient algorithm that doesn't truncate output.
http://hg.python.org/cpython/rev/4c5b1932354b

New changeset b6c3fc21286f by R David Murray in branch 'default':
Merge #20206, #5803: more efficient algorithm that doesn't truncate output.
http://hg.python.org/cpython/rev/b6c3fc21286f
msg208034 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-01-13 18:34
Fixed.
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64405
2014-01-13 18:34:07r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg208034

stage: resolved
2014-01-13 18:31:37python-devsetnosy: + python-dev
messages: + msg208031
2014-01-09 16:16:51r.david.murraysetversions: + Python 3.3, Python 3.4, - Python 2.7
nosy: + barry, r.david.murray

messages: + msg207744

dependencies: + email/quoprimime: encode and decode are very slow on large messages
components: + email
2014-01-09 14:40:20milap.pysetfiles: + email.py
versions: + Python 2.7, - Python 3.3
nosy: + milap.py

messages: + msg207738
2014-01-09 14:21:58timarcreate