How to iterate through maildir messages in python 3?

Chris Green cl at isbd.net
Thu Jun 24 15:06:09 EDT 2021


In python 2 one can do:-

   for msg in maildir: 
          print msg      # or whatever you want to do with the message


However in python 3 this produces "TypeError: string argument
expected, got 'bytes'".

How should one iterate over a maildir in python3?


(I've been here before but this problem is subtly different from the
one I had before and I can't find the answer)


-- 
Chris Green
·


More information about the Python-list mailing list