Aug-12-2018, 01:47 PM
Hi all
Here is a snapshot of my code:
Kind Regards,
Peter
I tried:
Br, Peter
Here is a snapshot of my code:
for num in data[0].split(): typ, data = mail.fetch(num,'(RFC822)') for response_part in data: if isinstance(response_part, tuple): msg = email.message_from_string(response_part[1])Error comes from:
msg = email.message_from_string(response_part[1])Error message:
TypeError: initial_value must be str or None, not bytesHave been looking at google for an hour now, and Ive tried playing around with the is.BytesIO and StringIO but I just cant get it working. The problem seems to have something to do with the difference between Python 2 and 3.
Kind Regards,
Peter
I tried:
msg = io.StringIO(email.message_from_string(response_part[1]))Doesn't help
Br, Peter