From 00c2ec282e1653a67bb99c5f96eb2cbf64b19ab5 Mon Sep 17 00:00:00 2001
From: Senthil Kumaran <senthil@uthcode.com>
Date: Sun, 20 May 2012 12:05:16 +0800
Subject: =?UTF-8?q?=20Issue=20#14426:=20Correct=20the=20Date=20format=20in?=
 =?UTF-8?q?=20Expires=20attribute=20of=20Set-Cookie.=20Patch=20by=20Federi?=
 =?UTF-8?q?co=20Reghenzani=20and=20M=C3=BCte=20Invert?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 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
index 93da627..2aeb8d3 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -301,7 +301,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_http_cookies.py b/Lib/test/test_http_cookies.py
index f9a98c4..1f1ca58 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -86,13 +86,13 @@ class CookieTests(unittest.TestCase):
 
         # 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"')
-- 
cgit v0.12