Sviatoslav Sydorenko added the comment:

> create a Maildir folder in a temporary directory:
> 
>     with tempfile.TemporaryDirectory() as tmpdir:
>         with mailbox.Maildir(os.path.join(tmpdir, 'mail'), create=True) as 
> box:
>             ...

Yeah, I came up with the same solution. It just seems weird to me.

The doc says "If create is True, the mailbox is created if it does not exist.". 
So it operates the term mailbox, not a folder.

I would assume that a valid mailbox [1] is the whole **valid** directory 
structure with subfolders. If the corresponding subdirs are missing the folder 
should not be considered as a valid maildir, right?

Given above, I think the documentation doesn't clearly promise the same 
behavior that the code does. Shouldn't this be fixed? (Either docs, or code)

[1] http://www.qmail.org/man/man5/maildir.html

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30088>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to