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 Viktor.Szépe
Recipients Viktor.Szépe, barry, r.david.murray
Date 2014-05-23.22:59:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400885983.53.0.980235742965.issue21567@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2014-05-23 22:59:43Viktor.Szépesetrecipients: + Viktor.Szépe, barry, r.david.murray
2014-05-23 22:59:43Viktor.Szépesetmessageid: <1400885983.53.0.980235742965.issue21567@psf.upfronthosting.co.za>
2014-05-23 22:59:43Viktor.Szépelinkissue21567 messages
2014-05-23 22:59:42Viktor.Szépecreate