How to iterate through maildir messages in python 3?

Chris Green cl at isbd.net
Sun Jun 27 03:35:29 EDT 2021


Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On Fri, 25 Jun 2021 09:19:49 +0100, Chris Green <cl at isbd.net> declaimed the
> following:
> 
> >
> >Here's the full program where I'm encountering the error (yes, I
> >should have posted this first time around) :-
> >
> >    #!/usr/bin/python3
> >
> >    import mailbox
> >    import sys
> >    import email
> >
> >
> >    #    open the existing maildir and the target mbox file
> >    maildir = mailbox.Maildir(sys.argv [-2], email.message_from_file)
> 
>         Is there some reason you are overriding whatever the default "factory"
> is for Maildir?
> 
Only that it was 'as copied' off the blog where I found it.  As you
can see elsewhere in the thread that was exactly the problem, simply
removing the email.message_from_file fixed the error.

-- 
Chris Green
·


More information about the Python-list mailing list