Barry A. Warsaw <ba...@python.org> added the comment:
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' ``` ---------- resolution: -> wont fix stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue1823> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com