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
7cf66996
Commit
7cf66996
authored
Jun 15, 2012
by
Petri Lehtinen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#15036: Make a repeated changes and flushes work with single-file mailboxes
parent
5ec84cd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
Lib/mailbox.py
Lib/mailbox.py
+1
-0
Lib/test/test_mailbox.py
Lib/test/test_mailbox.py
+11
-0
Misc/NEWS
Misc/NEWS
+4
-0
No files found.
Lib/mailbox.py
View file @
7cf66996
...
...
@@ -649,6 +649,7 @@ class _singlefileMailbox(Mailbox):
new_file
.
write
(
buffer
)
new_toc
[
key
]
=
(
new_start
,
new_file
.
tell
())
self
.
_post_message_hook
(
new_file
)
self
.
_file_length
=
new_file
.
tell
()
except
:
new_file
.
close
()
os
.
remove
(
new_file
.
name
)
...
...
Lib/test/test_mailbox.py
View file @
7cf66996
...
...
@@ -386,6 +386,17 @@ class TestMailbox(TestBase):
# Write changes to disk
self
.
_test_flush_or_close
(
self
.
_box
.
flush
,
True
)
def
test_popitem_and_flush_twice
(
self
):
# See #15036.
self
.
_box
.
add
(
self
.
_template
%
0
)
self
.
_box
.
add
(
self
.
_template
%
1
)
self
.
_box
.
flush
()
self
.
_box
.
popitem
()
self
.
_box
.
flush
()
self
.
_box
.
popitem
()
self
.
_box
.
flush
()
def
test_lock_unlock
(
self
):
# Lock and unlock the mailbox
self
.
assertFalse
(
os
.
path
.
exists
(
self
.
_get_lock_path
()))
...
...
Misc/NEWS
View file @
7cf66996
...
...
@@ -67,6 +67,10 @@ Core and Builtins
Library
-------
-
Issue
#
15036
:
Allow
removing
or
changing
multiple
items
in
single
-
file
mailboxes
(
mbox
,
MMDF
,
Babyl
)
flushing
the
mailbox
between
the
changes
.
-
Issue
#
10133
:
Make
multiprocessing
deallocate
buffer
if
socket
read
fails
.
Patch
by
Hallvard
B
Furuseth
.
...
...
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