Skip to content

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 b815669 into python:3.8 Jul 13, 2019
@miss-islington miss-islington deleted the backport-e441847-3.8 branch July 13, 2019 14:59
@miss-islington
Copy link
Contributor Author

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

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