[issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists

Sviatoslav Sydorenko report at bugs.python.org
Mon Apr 17 15:45:47 EDT 2017


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 <report at bugs.python.org>
<http://bugs.python.org/issue30088>
_______________________________________


More information about the Python-bugs-list mailing list