Index: Lib/imaplib.py =================================================================== --- Lib/imaplib.py (revision 88101) +++ Lib/imaplib.py (working copy) @@ -1308,8 +1308,8 @@ -Mon2num = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6, - 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12} +Mon2num = {b'Jan': 1, b'Feb': 2, b'Mar': 3, b'Apr': 4, b'May': 5, b'Jun': 6, + b'Jul': 7, b'Aug': 8, b'Sep': 9, b'Oct': 10, b'Nov': 11, b'Dec': 12} def Internaldate2tuple(resp): """Convert IMAP4 INTERNALDATE to UT. @@ -1335,7 +1335,7 @@ # INTERNALDATE timezone must be subtracted to get UT zone = (zoneh*60 + zonem)*60 - if zonen == '-': + if zonen == b'-': zone = -zone tt = (year, mon, day, hour, min, sec, -1, -1, -1) Index: Lib/test/test_imaplib.py =================================================================== --- Lib/test/test_imaplib.py (revision 88101) +++ Lib/test/test_imaplib.py (working copy) @@ -23,6 +23,9 @@ class TestImaplib(unittest.TestCase): + def test_Internaldate2tuple(self): + self.assertEqual(imaplib.Internaldate2tuple(b'25 (INTERNALDATE "01-Apr-2000 19:02:23 -0700")')[0:6], (2000, 4, 1, 19, 2, 23)) + def test_that_Time2Internaldate_returns_a_result(self): # We can check only that it successfully produces a result, # not the correctness of the result itself, since the result