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

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


http://hg.python.org/cpython/rev/a5fa068143eb
changeset: 77064:a5fa068143eb
branch: 3.2
parent: 77055:7cdc1392173f
user: Senthil Kumaran <senthil at uthcode.com>
date: Sun May 20 12:05:16 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
@@ -86,13 +86,13 @@
 
 # loading 'expires'
 C = cookies.SimpleCookie()
- C.load('Customer="W"; expires=Wed, 01-Jan-2010 00:00:00 GMT')
+ C.load('Customer="W"; expires=2010年1月01日 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

AltStyle によって変換されたページ (->オリジナル) /