Skip to content

[3.7] bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir (GH-1163) #14750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2019

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 13, 2019

Hi,

I've faced an issue w/ mailbox.Maildir(). The case is following:

  1. I create a folder with tempfile.TemporaryDirectory(), so it's empty
  2. I pass that folder path as an argument when instantiating mailbox.Maildir()
  3. Then I receive an exception happening because "there's no such file or directory" (namely cur, tmp or new) during interaction with Maildir

Expected result: subdirs are created during Maildir() instance creation.

Actual result: subdirs are assumed as existing which leads to exceptions during use.

Workaround: remove the actual dir before passing the path to Maildir(). It will be created automatically with all subdirs needed.

Fix: This PR. Basically it adds creation of subdirs regardless of whether the base dir existed before.

https://bugs.python.org/issue30088
(cherry picked from commit e441847)

Co-authored-by: Sviatoslav Sydorenko wk@sydorenko.org.ua

https://bugs.python.org/issue30088

…lbox.Maildir (pythonGH-1163)

Hi,

I've faced an issue w/ `mailbox.Maildir()`. The case is following:
1. I create a folder with `tempfile.TemporaryDirectory()`, so it's empty
2. I pass that folder path as an argument when instantiating `mailbox.Maildir()`
3. Then I receive an exception happening because "there's no such file or directory" (namely `cur`, `tmp` or `new`) during interaction with Maildir

**Expected result:** subdirs are created during `Maildir()` instance creation.

**Actual result:** subdirs are assumed as existing which leads to exceptions during use.

**Workaround:** remove the actual dir before passing the path to `Maildir()`. It will be created automatically with all subdirs needed.

**Fix:** This PR. Basically it adds creation of subdirs regardless of whether the base dir existed before.

https://bugs.python.org/issue30088
(cherry picked from commit e441847)

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
@miss-islington
Copy link
Contributor Author

@webknjaz: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit d152414 into python:3.7 Jul 13, 2019
@miss-islington miss-islington deleted the backport-e441847-3.7 branch July 13, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants