summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-05-20 04:02:44 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-05-20 04:02:44 (GMT)
commitf439a366308f64927d54e03272e8294463b68880 (patch)
tree728c2dcb8711605be6be82161954ef25cdd5a6c7 /Lib
parent7961bb304370dddd896877155bc13e2828525195 (diff)
downloadcpython-f439a366308f64927d54e03272e8294463b68880.zip
cpython-f439a366308f64927d54e03272e8294463b68880.tar.gz
cpython-f439a366308f64927d54e03272e8294463b68880.tar.bz2
Issue #14426: Correct the Date format in Expires attribute of Set-Cookie. Patch by Federico Reghenzani and Müte Invert
Diffstat (limited to 'Lib')
-rw-r--r--Lib/Cookie.py2
-rw-r--r--Lib/test/test_cookie.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/Lib/Cookie.py b/Lib/Cookie.py
index 323450b..616377c 100644
--- a/Lib/Cookie.py
+++ b/Lib/Cookie.py
@@ -390,7 +390,7 @@ def _getdate(future=0, weekdayname=_weekdayname, monthname=_monthname):
from time import gmtime, time
now = time()
year, month, day, hh, mm, ss, wd, y, z = gmtime(now + future)
- return "%s, %02d-%3s-%4d %02d:%02d:%02d GMT" % \
+ return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % \
(weekdayname[wd], day, monthname[month], year, hh, mm, ss)
diff --git a/Lib/test/test_cookie.py b/Lib/test/test_cookie.py
index d09398d..1fb9b7d 100644
--- a/Lib/test/test_cookie.py
+++ b/Lib/test/test_cookie.py
@@ -64,13 +64,13 @@ class CookieTests(unittest.TestCase):
# loading 'expires'
C = Cookie.SimpleCookie()
- C.load('Customer="W"; expires=Wed, 01-Jan-2010 00:00:00 GMT')
+ C.load('Customer="W"; expires=Wed, 01 Jan 2010 00:00:00 GMT')
self.assertEqual(C['Customer']['expires'],
- 'Wed, 01-Jan-2010 00:00:00 GMT')
+ 'Wed, 01 Jan 2010 00:00:00 GMT')
C = Cookie.SimpleCookie()
- C.load('Customer="W"; expires=Wed, 01-Jan-98 00:00:00 GMT')
+ C.load('Customer="W"; expires=Wed, 01 Jan 98 00:00:00 GMT')
self.assertEqual(C['Customer']['expires'],
- 'Wed, 01-Jan-98 00:00:00 GMT')
+ 'Wed, 01 Jan 98 00:00:00 GMT')
def test_extended_encode(self):
# Issue 9824: some browsers don't follow the standard; we now