Author barry
Recipients Sharebear, barry, christian.heimes, cjw296, loewis, michaelanckaert, nanjekyejoannah, r.david.murray
Date 2020-10-20.00:06:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603152395.39.0.948601203562.issue1823@roundup.psfhosted.org>
In-reply-to
Content
Actually, I think I am going to close this as won't fix, for two reasons.

First, this only potentially affects the legacy API, and second, in Python 3, the error you get when you do it like the original repro example seems obvious to me.

```
>>> mp = MIMEMultipart()
>>> t = MIMEText('sample text')
>>> mp.attach(t)
>>> mp.set_charset('utf-8')
Traceback (most recent call last):
  File "/Users/barry/projects/python/cpython/Lib/email/message.py", line 356, 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 "/Users/barry/projects/python/cpython/Lib/email/message.py", line 364, in set_charset
    payload = payload.encode('ascii', 'surrogateescape')
AttributeError: 'list' object has no attribute 'encode'
```
History
Date User Action Args
2020-10-20 00:06:35barrysetrecipients: + barry, loewis, christian.heimes, cjw296, Sharebear, r.david.murray, michaelanckaert, nanjekyejoannah
2020-10-20 00:06:35barrysetmessageid: <1603152395.39.0.948601203562.issue1823@roundup.psfhosted.org>
2020-10-20 00:06:35barrylinkissue1823 messages
2020-10-20 00:06:35barrycreate