[issue44870] email.message_from_bytes not working on BytesIO() object

2021-08-09 Thread Eric V. Smith
Eric V. Smith added the comment: Use filecontent.getvalue(): https://docs.python.org/3/library/io.html#io.BytesIO.getvalue -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue44870] email.message_from_bytes not working on BytesIO() object

2021-08-09 Thread Christian Degenkolb
New submission from Christian Degenkolb : Hi, the following minimal working example of the problem from io import BytesIO from os import read import email fp = BytesIO() with open('mail.eml', 'rb') as f: filecontent = f.read() print("type(filecontent)= ", type(filecontent)) fp