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
50f85314
Commit
50f85314
authored
9 years ago
by
Robert Collins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23888: Handle fractional time in cookie expiry. Patch by ssh.
parent
33ca93cf
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
Lib/http/cookiejar.py
Lib/http/cookiejar.py
+1
-1
Lib/test/test_http_cookiejar.py
Lib/test/test_http_cookiejar.py
+9
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/http/cookiejar.py
View file @
50f85314
...
@@ -758,7 +758,7 @@ class Cookie:
...
@@ -758,7 +758,7 @@ class Cookie:
):
):
if version is not None: version = int(version)
if version is not None: version = int(version)
if expires is not None: expires = int(
expires
)
if expires is not None: expires = int(
float(expires)
)
if port is None and port_specified is True:
if port is None and port_specified is True:
raise ValueError("if port is None, port_specified must be false")
raise ValueError("if port is None, port_specified must be false")
...
...
This diff is collapsed.
Click to expand it.
Lib/test/test_http_cookiejar.py
View file @
50f85314
...
@@ -566,6 +566,15 @@ class CookieTests(unittest.TestCase):
...
@@ -566,6 +566,15 @@ class CookieTests(unittest.TestCase):
self
.
assertEqual
(
len
(
c
),
1
)
self
.
assertEqual
(
len
(
c
),
1
)
self
.
assertIn
(
'spam="bar"'
,
h
)
self
.
assertIn
(
'spam="bar"'
,
h
)
# test if fractional expiry is accepted
cookie
=
Cookie
(
0
,
"name"
,
"value"
,
None
,
False
,
"www.python.org"
,
True
,
False
,
"/"
,
False
,
False
,
"1444312383.018307"
,
False
,
None
,
None
,
{})
self
.
assertEqual
(
cookie
.
expires
,
1444312383
)
# XXX RFC 2965 expiry rules (some apply to V0 too)
# XXX RFC 2965 expiry rules (some apply to V0 too)
def
test_default_path
(
self
):
def
test_default_path
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Misc/NEWS
View file @
50f85314
...
@@ -66,6 +66,8 @@ Core and Builtins
...
@@ -66,6 +66,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
23888
:
Handle
fractional
time
in
cookie
expiry
.
Patch
by
ssh
.
-
Issue
#
23652
:
Make
it
possible
to
compile
the
select
module
against
the
-
Issue
#
23652
:
Make
it
possible
to
compile
the
select
module
against
the
libc
headers
from
the
Linux
Standard
Base
,
which
do
not
include
some
libc
headers
from
the
Linux
Standard
Base
,
which
do
not
include
some
EPOLL
macros
.
Patch
by
Matt
Frank
.
EPOLL
macros
.
Patch
by
Matt
Frank
.
...
...
This diff is collapsed.
Click to expand it.
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