-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir #1163
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
bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir #1163
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
@the-knights-who-say-ni I've signed it, it just hasn't got checked yet. |
Please open an issue on the bug tracker for discussion and sign the CLA. This isn't trivial PR like fixing a typo. |
@serhiy-storchaka http://bugs.python.org/issue30088 Plz revisit this PR in 1 US business day (I think). The doc says that the CLA is checked manually. |
@webknjaz a small point that the title should be |
(CLA signed: http://bugs.python.org/user17410) |
cc @maxking |
From the conversation on BPO, it seems like this is wrong behaviour and if we are operating on a directory expecting it to be a Maildir, it should already have subdirectories created. And I agree with the reasoning. If there is a more specific Doc change that needs to be made to make the current behaviour more easy to understand, that can be a separate PR. @csabella I think we can close the PR and maybe the associated Issue. |
Make sure that if base maildir directory exists, all mandatory subfolders are also created if mailbox.Maildir initialized with create=True argument
* Bonus: use new assertRaisesRegex instead of deprecated name
This reverts commit aff2caa.
This reverts commit 3059564.
This reverts commit 9a42867.
This reverts commit 26f16a2.
This reverts commit a451dc7.
This reverts commit 55f1670.
e2059dc
to
f7aa474
Compare
@maxking hi, i've tried to do the suggested docs clarification on this. |
Thanks @webknjaz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
…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>
GH-14749 is a backport of this pull request to the 3.8 branch. |
…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>
GH-14750 is a backport of this pull request to the 3.7 branch. |
…lbox.Maildir (GH-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>
…lbox.Maildir (GH-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>
…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
…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
Hi,
I've faced an issue w/
mailbox.Maildir()
. The case is following:tempfile.TemporaryDirectory()
, so it's emptymailbox.Maildir()
cur
,tmp
ornew
) during interaction with MaildirExpected 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