]> granicus.if.org Git - python/commitdiff
Add missing iteritems() call to the for loop in mailbox.MH.get_message().
authorR. David Murray <rdmurray@bitdance.com>
Thu, 2 Apr 2009 14:05:35 +0000 (14:05 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Thu, 2 Apr 2009 14:05:35 +0000 (14:05 +0000)
Fixes issue2625.

Lib/mailbox.py
Lib/test/test_mailbox.py
Misc/NEWS

index 7651e53b7f2c15e0ece7f159fb0b3c292788ed2d..7e0689c48830619892023e61f93ef72686bb4b77 100755 (executable)
@@ -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
index bec51e51923c664a702c45a00e00d549b201f593..714bf252ba81cb535995c56ec621915c40cfddf8 100644 (file)
@@ -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)
index 7de7b8aee706a1625dcba06ca3a6691af5def724..196f5a98b20b4c68ed37f9d02a6e28d3079fa633 100644 (file)
--- 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.