diff --git a/Lib/mailbox.py b/Lib/mailbox.py index ab915edea74..909285bd98b 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -907,7 +907,7 @@ def get_message(self, key): _unlock_file(f) finally: f.close() - for name, key_list in self.get_sequences(): + for name, key_list in self.get_sequences().items(): 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 182838118d1..28b93221691 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -931,6 +931,12 @@ def test_sequences(self): self._box.remove(key1) self.assertEqual(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 c7b203dd88f..465c9d0abec 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -58,6 +58,9 @@ Core and Builtins Library ------- +- Issue 2625: added missing items() call to the for loop in + mailbox.MH.get_message(). + - Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat error substitutions from non-strict codec error callbacks in incrementalencoder and StreamWriter.