You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-08-09.13:11:33.727>created_at=<Date2021-08-09.11:49:52.449>labels= ['invalid', 'type-bug', '3.8', 'expert-email']
title='email.message_from_bytes not working on BytesIO() object'updated_at=<Date2021-08-09.13:11:33.725>user='https://bugs.python.org/cd311'
$ python testparser.py
type(filecontent)= <class 'bytes'>
Traceback (most recent call last):
File "testparser.py", line 16, in <module>
mailobj = email.message_from_bytes(fp)
File "/usr/lib/python3.8/email/__init__.py", line 46, in message_from_bytesreturn BytesParser(*args, **kws).parsebytes(s)
File "/usr/lib/python3.8/email/parser.py", line 122, in parsebytes
text = text.decode('ASCII', errors='surrogateescape')
AttributeError: '_io.BytesIO' object has no attribute 'decode'
This is a python 3.8.10 on an Ubuntu 20.04 LTS installed from the packages.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: