Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6af11a3a
Commit
6af11a3a
authored
Jan 29, 2011
by
Alexander Belopolsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10939: Fixed imaplib.Internaldate2tuple(). Thanks Joe Peterson
for the report and the patch. Reviewed by Georg Brandl.
parent
b934af42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
Lib/imaplib.py
Lib/imaplib.py
+3
-3
Lib/test/test_imaplib.py
Lib/test/test_imaplib.py
+11
-0
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Lib/imaplib.py
View file @
6af11a3a
...
...
@@ -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
)
...
...
Lib/test/test_imaplib.py
View file @
6af11a3a
...
...
@@ -23,6 +23,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
...
...
Misc/ACKS
View file @
6af11a3a
...
...
@@ -653,6 +653,7 @@ Trevor Perrin
Gabriel de Perthuis
Tim Peters
Benjamin Peterson
Joe Peterson
Chris Petrilli
Bjorn Pettersen
Geoff Philbrick
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment