summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2007-01-24 20:06:41 +0000
committerAndrew M. Kuchling <amk@amk.ca>2007-01-24 20:06:41 +0000
commit391e917b1a0670349282e96ac9d5aa3014df4197 (patch)
tree77495a20dc2e4bab1c4cd85e94f893c74333339d
parent4b884a5cc22de75c5b9e2bf11ace0da83baa58fc (diff)
downloadcpython-git-391e917b1a0670349282e96ac9d5aa3014df4197.tar.gz
Strengthen warning about using lock()
-rw-r--r--Doc/lib/libmailbox.tex20
1 files changed, 12 insertions, 8 deletions
diff --git a/Doc/lib/libmailbox.tex b/Doc/lib/libmailbox.tex
index 961b05019e..24765c8d3e 100644
--- a/Doc/lib/libmailbox.tex
+++ b/Doc/lib/libmailbox.tex
@@ -58,14 +58,18 @@ skipped, though using a key from an iterator may result in a
\exception{KeyError} exception if the corresponding message is subsequently
removed.
-Be very cautious when modifying mailboxes that might also be changed
-by some other process. The safest mailbox format to use for such
-tasks is Maildir; try to avoid using single-file formats such as mbox
-for concurrent writing. If you're modifying a mailbox, no matter what
-the format, you must lock it by calling the \method{lock()} and
-\method{unlock()} methods before making any changes. Failing to lock
-the mailbox runs the risk of losing data if some other process makes
-changes to the mailbox while your Python code is running.
+\begin{notice}[warning]
+Be very cautious when modifying mailboxes that might be
+simultaneously changed by some other process. The safest mailbox
+format to use for such tasks is Maildir; try to avoid using
+single-file formats such as mbox for concurrent writing. If you're
+modifying a mailbox, you
+\emph{must} lock it by calling the \method{lock()} and
+\method{unlock()} methods \emph{before} reading any messages in the file
+or making any changes by adding or deleting a message. Failing to
+lock the mailbox runs the risk of losing messages or corrupting the entire
+mailbox.
+\end{notice}
\class{Mailbox} instances have the following methods: