[Python-checkins] cpython (merge 3.2 -> default): Issue #14426: Correct the Date format in Expires attribute of Set-Cookie.

senthil.kumaran python-checkins at python.org
Sun May 20 06:08:49 CEST 2012


http://hg.python.org/cpython/rev/8e476cca25ff
changeset:   77066:8e476cca25ff
parent:      77062:41a9d24d075e
parent:      77064:a5fa068143eb
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sun May 20 12:06:51 2012 +0800
summary:
   Issue #14426: Correct the Date format in Expires attribute of Set-Cookie. Patch by Federico Reghenzani and Müte Invert

files:
  Lib/http/cookies.py           |  2 +-
  Lib/test/test_http_cookies.py |  8 ++++----
  2 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -301,7 +301,7 @@
     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_http_cookies.py b/Lib/test/test_http_cookies.py
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -95,13 +95,13 @@
 
         # loading 'expires'
         C = cookies.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 = cookies.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')
 
         # 'max-age'
         C = cookies.SimpleCookie('Customer="WILE_E_COYOTE"')

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list