summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2010-02-22 18:42:07 +0000
committerAndrew M. Kuchling <amk@amk.ca>2010-02-22 18:42:07 +0000
commitb72b0eb357e9237e9de95dadda18fda433f88aac (patch)
tree03d29eaa1a8677b69ce8d67e0b9548846c621e97 /Lib/test
parent72aae73d47ed9b41867d0264fe74e03d884cabf9 (diff)
downloadcpython-git-b72b0eb357e9237e9de95dadda18fda433f88aac.tar.gz
#7627: MH.remove() would fail if the MH mailbox was locked;
it would call _unlock_file() and pass it a closed file object. Noted by Rob Austein.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_mailbox.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index c88af06137..7575ca7e65 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -979,6 +979,13 @@ class TestMH(TestMailbox):
key0 = self._box.add(msg0)
refmsg0 = self._box.get_message(key0)
+ def test_issue7627(self):
+ msg0 = mailbox.MHMessage(self._template % 0)
+ key0 = self._box.add(msg0)
+ self._box.lock()
+ self._box.remove(key0)
+ self._box.unlock()
+
def test_pack(self):
# Pack the contents of the mailbox
msg0 = mailbox.MHMessage(self._template % 0)