mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
#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.
This commit is contained in:
parent
72aae73d47
commit
b72b0eb357
2 changed files with 9 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue