Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
391e917b
Commit
391e917b
authored
Jan 24, 2007
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strengthen warning about using lock()
parent
4b884a5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
Doc/lib/libmailbox.tex
Doc/lib/libmailbox.tex
+12
-8
No files found.
Doc/lib/libmailbox.tex
View file @
391e917b
...
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment