Serhiy Storchaka added the comment: >>> import io, email >>> bytesdata = b'\xfa\xfb\xfc\xfd\xfe\xff' >>> msg = email.mime.application.MIMEApplication(bytesdata, >>> _encoder=encoders.encode_7or8bit) >>> s = io.BytesIO() >>> g = email.generator.BytesGenerator(s) >>> g.flatten(msg) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/serhiy/py/cpython3.2/Lib/email/generator.py", line 91, in flatten self._write(msg) File "/home/serhiy/py/cpython3.2/Lib/email/generator.py", line 137, in _write self._dispatch(msg) File "/home/serhiy/py/cpython3.2/Lib/email/generator.py", line 163, in _dispatch meth(msg) File "/home/serhiy/py/cpython3.2/Lib/email/generator.py", line 393, in _handle_text if _has_surrogates(msg._payload): TypeError: can't use a string pattern on a bytes-like object
---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16564> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com