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
20be53e5
Commit
20be53e5
authored
Mar 14, 2016
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR
parent
f2b9a398
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Lib/http/cookiejar.py
Lib/http/cookiejar.py
+4
-1
Lib/test/test_http_cookiejar.py
Lib/test/test_http_cookiejar.py
+4
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/http/cookiejar.py
View file @
20be53e5
...
...
@@ -143,6 +143,10 @@ def offset_from_tz_string(tz):
return
offset
def
_str2time
(
day
,
mon
,
yr
,
hr
,
min
,
sec
,
tz
):
yr
=
int
(
yr
)
if
yr
>
datetime
.
MAXYEAR
:
return
None
# translate month name to number
# month numbers start with 1 (January)
try
:
...
...
@@ -163,7 +167,6 @@ def _str2time(day, mon, yr, hr, min, sec, tz):
if
min
is
None
:
min
=
0
if
sec
is
None
:
sec
=
0
yr
=
int
(
yr
)
day
=
int
(
day
)
hr
=
int
(
hr
)
min
=
int
(
min
)
...
...
Lib/test/test_http_cookiejar.py
View file @
20be53e5
...
...
@@ -91,6 +91,10 @@ class DateTimeTests(unittest.TestCase):
'01-01-1980 25:00:00'
,
'01-01-1980 00:61:00'
,
'01-01-1980 00:00:62'
,
'08-Oct-3697739'
,
'08-01-3697739'
,
'09 Feb 19942632 22:23:32 GMT'
,
'Wed, 09 Feb 1994834 22:23:32 GMT'
,
]:
self
.
assertIsNone
(
http2time
(
test
),
"http2time(%s) is not None
\
n
"
...
...
Misc/NEWS
View file @
20be53e5
...
...
@@ -91,6 +91,9 @@ Core and Builtins
Library
-------
- Issue #16181: cookiejar.http2time() now returns None if year is higher than
datetime.MAXYEAR.
- Issue #26513: Fixes platform module detection of Windows Server
- Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by
...
...
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