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
56f9a022
Commit
56f9a022
authored
Mar 21, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.1
parents
6f0e4f99
628225c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
Lib/http/cookiejar.py
Lib/http/cookiejar.py
+12
-6
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/http/cookiejar.py
View file @
56f9a022
...
@@ -29,6 +29,7 @@ __all__ = ['Cookie', 'CookieJar', 'CookiePolicy', 'DefaultCookiePolicy',
...
@@ -29,6 +29,7 @@ __all__ = ['Cookie', 'CookieJar', 'CookiePolicy', 'DefaultCookiePolicy',
'FileCookieJar'
,
'LWPCookieJar'
,
'LoadError'
,
'MozillaCookieJar'
]
'FileCookieJar'
,
'LWPCookieJar'
,
'LoadError'
,
'MozillaCookieJar'
]
import
copy
import
copy
import
datetime
import
re
import
re
import
time
import
time
import
urllib.parse
,
urllib
.
request
import
urllib.parse
,
urllib
.
request
...
@@ -97,10 +98,12 @@ def time2isoz(t=None):
...
@@ -97,10 +98,12 @@ def time2isoz(t=None):
1994-11-24 08:49:37Z
1994-11-24 08:49:37Z
"""
"""
if
t
is
None
:
t
=
time
.
time
()
if
t
is
None
:
year
,
mon
,
mday
,
hour
,
min
,
sec
=
time
.
gmtime
(
t
)[:
6
]
dt
=
datetime
.
datetime
.
utcnow
()
else
:
dt
=
datetime
.
datetime
.
utcfromtimestamp
(
t
)
return
"%04d-%02d-%02d %02d:%02d:%02dZ"
%
(
return
"%04d-%02d-%02d %02d:%02d:%02dZ"
%
(
year
,
mon
,
mday
,
hour
,
min
,
sec
)
dt
.
year
,
dt
.
month
,
dt
.
day
,
dt
.
hour
,
dt
.
minute
,
dt
.
second
)
def
time2netscape
(
t
=
None
):
def
time2netscape
(
t
=
None
):
"""Return a string representing time in seconds since epoch, t.
"""Return a string representing time in seconds since epoch, t.
...
@@ -113,10 +116,13 @@ def time2netscape(t=None):
...
@@ -113,10 +116,13 @@ def time2netscape(t=None):
Wed, DD-Mon-YYYY HH:MM:SS GMT
Wed, DD-Mon-YYYY HH:MM:SS GMT
"""
"""
if
t
is
None
:
t
=
time
.
time
()
if
t
is
None
:
year
,
mon
,
mday
,
hour
,
min
,
sec
,
wday
=
time
.
gmtime
(
t
)[:
7
]
dt
=
datetime
.
datetime
.
utcnow
()
else
:
dt
=
datetime
.
datetime
.
utcfromtimestamp
(
t
)
return
"%s %02d-%s-%04d %02d:%02d:%02d GMT"
%
(
return
"%s %02d-%s-%04d %02d:%02d:%02d GMT"
%
(
DAYS
[
wday
],
mday
,
MONTHS
[
mon
-
1
],
year
,
hour
,
min
,
sec
)
DAYS
[
dt
.
weekday
()],
dt
.
day
,
MONTHS
[
dt
.
month
-
1
],
dt
.
year
,
dt
.
hour
,
dt
.
minute
,
dt
.
second
)
UTC_ZONES
=
{
"GMT"
:
None
,
"UTC"
:
None
,
"UT"
:
None
,
"Z"
:
None
}
UTC_ZONES
=
{
"GMT"
:
None
,
"UTC"
:
None
,
"UT"
:
None
,
"Z"
:
None
}
...
...
Misc/NEWS
View file @
56f9a022
...
@@ -49,6 +49,9 @@ Core and Builtins
...
@@ -49,6 +49,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
5537
:
Fix
time2isoz
()
and
time2netscape
()
functions
of
httplib
.
cookiejar
for
expiration
year
greater
than
2038
on
32
-
bit
systems
.
-
Issue
#
11563
:
Connection
:
close
header
is
sent
by
requests
using
URLOpener
-
Issue
#
11563
:
Connection
:
close
header
is
sent
by
requests
using
URLOpener
class
which
helps
in
closing
of
sockets
after
connection
is
over
.
Patch
class
which
helps
in
closing
of
sockets
after
connection
is
over
.
Patch
contributions
by
Jeff
McNeil
and
Nadeem
Vawda
.
contributions
by
Jeff
McNeil
and
Nadeem
Vawda
.
...
...
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