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.

Author jwilk
Recipients jwilk
Date 2013-01-12.18:52:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If you try to create MIMEText object with text containing characters outside the ISO-8859-1 range,
the quoted-printable encoder fails with KeyError:

Python 3.2.3 (default, Sep 10 2012, 12:58:42) 
[GCC 4.7.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.mime.text
>>> email.mime.text.MIMEText('\u017c', 'plain', 'ISO-8859-2')
Traceback (most recent call last):
  File "/usr/lib/python3.2/email/", line 331, in set_charset
TypeError: 'str' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.2/email/mime/", line 30, in __init__
    self.set_payload(_text, _charset)
  File "/usr/lib/python3.2/email/", line 296, in set_payload
  File "/usr/lib/python3.2/email/", line 333, in set_charset
    self._payload = charset.body_encode(self._payload)
  File "/usr/lib/python3.2/email/", line 395, in body_encode
    return email.quoprimime.body_encode(string)
  File "/usr/lib/python3.2/email/", line 240, in body_encode
    if body_check(ord(c)):
  File "/usr/lib/python3.2/email/", line 81, in body_check
    return chr(octet) != _QUOPRI_BODY_MAP[octet]
KeyError: 380
Date User Action Args
2013-01-12 18:52:55jwilksetrecipients: + jwilk
2013-01-12 18:52:55jwilksetmessageid: <>
2013-01-12 18:52:55jwilklinkissue16948 messages
2013-01-12 18:52:53jwilkcreate