[Python-checkins] cpython (merge 3.4 -> default): merge 3.4 (#22986)

benjamin.peterson python-checkins at python.org
Sat Jan 17 02:46:56 CET 2015


https://hg.python.org/cpython/rev/d3671e6ba106
changeset:   94189:d3671e6ba106
parent:      94187:031fc0231f3d
parent:      94188:0d8380c493ad
user:        Benjamin Peterson <benjamin at python.org>
date:        Fri Jan 16 20:46:37 2015 -0500
summary:
  merge 3.4 (#22986)

files:
  Lib/http/cookies.py           |  4 ++--
  Lib/test/test_http_cookies.py |  4 ++--
  Misc/NEWS                     |  3 +++
  3 files changed, 7 insertions(+), 4 deletions(-)


diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -330,8 +330,8 @@
         "comment"  : "Comment",
         "domain"   : "Domain",
         "max-age"  : "Max-Age",
-        "secure"   : "secure",
-        "httponly" : "httponly",
+        "secure"   : "Secure",
+        "httponly" : "HttpOnly",
         "version"  : "Version",
     }
 
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
@@ -114,7 +114,7 @@
         C['Customer']['secure'] = True
         C['Customer']['httponly'] = True
         self.assertEqual(C.output(),
-            'Set-Cookie: Customer="WILE_E_COYOTE"; httponly; secure')
+            'Set-Cookie: Customer="WILE_E_COYOTE"; HttpOnly; Secure')
 
     def test_secure_httponly_false_if_not_present(self):
         C = cookies.SimpleCookie()
@@ -145,7 +145,7 @@
         C = cookies.SimpleCookie()
         C.load('eggs  =  scrambled  ;  secure  ;  path  =  bar   ; foo=foo   ')
         self.assertEqual(C.output(),
-            'Set-Cookie: eggs=scrambled; Path=bar; secure\r\nSet-Cookie: foo=foo')
+            'Set-Cookie: eggs=scrambled; Path=bar; Secure\r\nSet-Cookie: foo=foo')
 
     def test_quoted_meta(self):
         # Try cookie with quoted meta-data
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -203,6 +203,9 @@
 Library
 -------
 
+- Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure"
+  as they are written in the standard.
+
 - Issue #23063: In the disutils' check command, fix parsing of reST with code or
   code-block directives.
 

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


More information about the Python-checkins mailing list