Issue #10939: Fixed imaplib.Internaldate2tuple(). Thanks Joe Peterson

for the report and the patch.  Reviewed by Georg Brandl.
This commit is contained in:
Alexander Belopolsky 2011-01-29 17:19:08 +00:00
parent ac039aee4d
commit 19e0a9e511
3 changed files with 15 additions and 3 deletions

View file

@ -1308,8 +1308,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):
"""Parse an IMAP4 INTERNALDATE string.
@ -1336,7 +1336,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)