[Patch #1514543] mailbox (Maildir): avoid losing messages on name clash
Two changes:
Where possible, use link()/remove() to move files into a directory; this
makes it easier to avoid overwriting an existing file.
Use _create_carefully() to create files in tmp/, which uses O_EXCL.
diff --git a/Misc/NEWS b/Misc/NEWS
index d91e64d..d41d7cc 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -140,6 +140,10 @@
- Bug #1575506: mailbox.py: Single-file mailboxes didn't re-lock
properly in their flush() method.
+- Patch #1514543: mailbox.py: In the Maildir class, report errors if there's
+ a filename clash instead of possibly losing a message. (Patch by David
+ Watson.)
+
- Patch #1514544: mailbox.py: Try to ensure that messages/indexes have
been physically written to disk after calling .flush() or
.close(). (Patch by David Watson.)