[issue21567] cannot create multipart alternative message with us-ascii charset

Viktor Szépe report at bugs.python.org
Sat May 24 00:59:43 CEST 2014


New submission from Viktor Szépe:

Python 2.7.6 (default, May 22 2014, 00:19:36)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.mime.multipart import MIMEMultipart
>>> new_msg = MIMEMultipart('alternative')
>>> new_msg.set_charset('us-ascii')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python/lib/python2.7/email/message.py", line 268, in set_charset
    cte(self)
  File "/opt/python/lib/python2.7/email/encoders.py", line 73, in encode_7or8bit
    orig.encode('ascii')
AttributeError: 'list' object has no attribute 'encode'
>>>


I know it is not necessary.
How come that
new_msg.set_charset('us-ascii')
works?

----------
components: email
messages: 219009
nosy: Viktor.Szépe, barry, r.david.murray
priority: normal
severity: normal
status: open
title: cannot create multipart alternative message with us-ascii charset
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21567>
_______________________________________


More information about the Python-bugs-list mailing list