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 <1358016775.26.0.412297588527.issue16948@psf.upfronthosting.co.za>
In-reply-to
Content
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/message.py", line 331, in set_charset
    cte(self)
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/text.py", line 30, in __init__
    self.set_payload(_text, _charset)
  File "/usr/lib/python3.2/email/message.py", line 296, in set_payload
    self.set_charset(charset)
  File "/usr/lib/python3.2/email/message.py", line 333, in set_charset
    self._payload = charset.body_encode(self._payload)
  File "/usr/lib/python3.2/email/charset.py", line 395, in body_encode
    return email.quoprimime.body_encode(string)
  File "/usr/lib/python3.2/email/quoprimime.py", line 240, in body_encode
    if body_check(ord(c)):
  File "/usr/lib/python3.2/email/quoprimime.py", line 81, in body_check
    return chr(octet) != _QUOPRI_BODY_MAP[octet]
KeyError: 380
History
Date User Action Args
2013-01-12 18:52:55jwilksetrecipients: + jwilk
2013-01-12 18:52:55jwilksetmessageid: <1358016775.26.0.412297588527.issue16948@psf.upfronthosting.co.za>
2013-01-12 18:52:55jwilklinkissue16948 messages
2013-01-12 18:52:53jwilkcreate