How to iterate through maildir messages in python 3?

Chris Green cl at isbd.net
Fri Jun 25 08:58:46 EDT 2021


Gilmeh Serda <gilmeh.serdah at nothing.here.invalid> wrote:
> On Fri, 25 Jun 2021 09:19:49 +0100, Chris Green wrote:
> 
> > TypeError: string argument expected, got 'bytes'
> 
> couple things comes to mind:
> 
> 1. find py2 as archive, put it somewhere and run it from that
> 
Hmm!  :-)

> 2. convert the bytes to str (find and replace)
> 
How?  It's failing at "for msg in maildir:", you can't change it to
"for str(msg) in maildir" (well you can but it gives a syntax error).

> 3. run the py2>py3 conversion script
> 
That does nothing, says "No files need to be modified"

-- 
Chris Green
·


More information about the Python-list mailing list