[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.
Backport candidate.
diff --git a/Misc/NEWS b/Misc/NEWS
index 3aa5ff3..354a7b0 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -100,6 +100,10 @@
weren't passing the message factory on to newly created Maildir/MH
objects.
+- Patch #1514543: In the Maildir clash, report errors if there's
+ a name clash instead of possibly losing a message. (Patch by David
+ Watson.)
+
- Patch #1514544: Try to ensure that messages/indexes have been physically
written to disk after calling .flush() or .close(). (Patch by David
Watson.)