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

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


http://hg.python.org/cpython/rev/1db41c410f63
changeset:   77063:1db41c410f63
branch:      2.7
parent:      77058:4641d8d99a7d
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sun May 20 12:02:44 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/Cookie.py           |  2 +-
  Lib/test/test_cookie.py |  8 ++++----
  Misc/NEWS               |  3 +++
  3 files changed, 8 insertions(+), 5 deletions(-)


diff --git a/Lib/Cookie.py b/Lib/Cookie.py
--- a/Lib/Cookie.py
+++ b/Lib/Cookie.py
@@ -390,7 +390,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_cookie.py b/Lib/test/test_cookie.py
--- a/Lib/test/test_cookie.py
+++ b/Lib/test/test_cookie.py
@@ -64,13 +64,13 @@
 
         # 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
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -64,6 +64,9 @@
 Library
 -------
 
+- Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
+  Header in Cookie.py.
+
 - Issue #14721: Send proper header, Content-length: 0 when the body is an empty
   string ''. Initial Patch contributed by Arve Knudsen.
 

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


More information about the Python-checkins mailing list