Aw: Re: Python 3 how to convert a list of bytes objects to a list of strings?

Karsten Hilbert Karsten.Hilbert at gmx.net
Fri Aug 28 09:19:18 EDT 2020


> I want to transport the message into my mbox and Python 3 won't do it
> without knowing how it's encoded whereas Python 2 just stuffed it in
> there 'as is'.
>
> I want Python 3's mailbox class to juyst put what I tell it (even if
> mis-formatted or mis-encoded) into the mbox.

I guess using the mailbox class already implies that you do _not_
want to "simply put the msgs into an mbox file" but rather want
the class to do what it was designed for: "put proper msgs properly
into an mbox file". We can't have it both ways I fear. If we
simply want to stuff a file with bytes and call that mbox we
should do so: drop the bytes into a file and call it an mbox file.

Karsten


More information about the Python-list mailing list