diff options
-rw-r--r-- | Lib/imaplib.py | 6 | ||||
-rw-r--r-- | Lib/test/test_imaplib.py | 11 | ||||
-rw-r--r-- | Misc/ACKS | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 77806db..fc1e20a 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1266,8 +1266,8 @@ class _Authenticator: -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. @@ -1293,7 +1293,7 @@ def Internaldate2tuple(resp): # 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) diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 1ab28c5..39984c5 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -26,6 +26,17 @@ CERTFILE = None class TestImaplib(unittest.TestCase): + def test_Internaldate2tuple(self): + tt = imaplib.Internaldate2tuple( + b'25 (INTERNALDATE "01-Jan-1970 00:00:00 +0000")') + self.assertEqual(time.mktime(tt), 0) + tt = imaplib.Internaldate2tuple( + b'25 (INTERNALDATE "01-Jan-1970 11:30:00 +1130")') + self.assertEqual(time.mktime(tt), 0) + tt = imaplib.Internaldate2tuple( + b'25 (INTERNALDATE "31-Dec-1969 12:30:00 -1130")') + self.assertEqual(time.mktime(tt), 0) + 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 @@ -611,6 +611,7 @@ Trevor Perrin Gabriel de Perthuis Tim Peters Benjamin Peterson +Joe Peterson Chris Petrilli Bjorn Pettersen Geoff Philbrick |