diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 7651e53b7f2..7e0689c4883 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -911,7 +911,7 @@ class MH(Mailbox): _unlock_file(f) finally: f.close() - for name, key_list in self.get_sequences(): + for name, key_list in self.get_sequences().iteritems(): if key in key_list: msg.add_sequence(name) return msg diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index bec51e51923..714bf252ba8 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -936,6 +936,12 @@ class TestMH(TestMailbox): self._box.remove(key1) self.assert_(self._box.get_sequences() == {'flagged':[key0]}) + def test_issue2625(self): + msg0 = mailbox.MHMessage(self._template % 0) + msg0.add_sequence('foo') + key0 = self._box.add(msg0) + refmsg0 = self._box.get_message(key0) + def test_pack(self): # Pack the contents of the mailbox msg0 = mailbox.MHMessage(self._template % 0) diff --git a/Misc/NEWS b/Misc/NEWS index 7de7b8aee70..196f5a98b20 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -202,6 +202,9 @@ Core and Builtins Library ------- +- Issue 2625: added missing iteritems() call to the for loop in + mailbox.MH.get_message(). + - Issue 5585: Add the ability to call an initializer to mulitiprocessing.manager so that users can install custonm handlers/etc.