[Patches] [ python-Patches-1514543 ] mailbox (Maildir): avoid losing messages on name clash

SourceForge.net noreply at sourceforge.net
Mon Jul 31 22:23:59 CEST 2006


Patches item #1514543, was opened at 2006-06-29 14:26
Message generated for change (Settings changed) made by akuchling
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1514543&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
>Priority: 6
Submitted By: David Watson (baikie)
>Assigned to: A.M. Kuchling (akuchling)
Summary: mailbox (Maildir): avoid losing messages on name clash

Initial Comment:
The Maildir specification says that messages should be
moved into the "new" directory using link()/unlink(),
not rename().  This isn't for compatibility with
ancient Unixes, but to avoid overwriting an existing
message if the "unique" name turns out not to be unique
after all.  (In the current implementation this can
happen if the system clock only has whole-second
resolution and deliveries are being done in
subprocesses, or the clock has been adjusted backwards,
or two machines have the same hostname.)  Similarly,
the file in "tmp" should be created O_EXCL.  This patch
implements these requirements, falling back to rename()
if link() is unavailable (where on Windows at least,
it's supposed to fail if the destination exists), and
raising ExternalClashError when the link/rename fails
due to the name already being taken in "new".


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1514543&group_id=5470


More information about the Patches mailing list