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

brett.cannon python-checkins at python.org
Sun Apr 22 03:22:04 CEST 2012


http://hg.python.org/cpython/rev/79f55cf917fd
changeset: 76460:79f55cf917fd
parent: 76459:b8cd8dd7006a
parent: 76458:943e0520476f
user: Brett Cannon <brett at python.org>
date: Sat Apr 21 21:21:54 2012 -0400
summary:
 merge
files:
 Lib/http/cookies.py | 2 +-
 Lib/test/test_http_cookies.py | 9 +++++++++
 Misc/NEWS | 2 ++
 3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -159,7 +159,7 @@
 # _LegalChars is the list of chars which don't require "'s
 # _Translator hash-table for fast quoting
 #
-_LegalChars = string.ascii_letters + string.digits + "!#$%&'*+-.^_`|~"
+_LegalChars = string.ascii_letters + string.digits + "!#$%&'*+-.^_`|~:"
 _Translator = {
 '000円' : '\000円', '001円' : '\001円', '002円' : '\002円',
 '003円' : '\003円', '004円' : '\004円', '005円' : '\005円',
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
@@ -34,6 +34,15 @@
 'dict': {'keebler' : 'E=mc2'},
 'repr': "<SimpleCookie: keebler='E=mc2'>",
 'output': 'Set-Cookie: keebler=E=mc2'},
+
+ # Cookies with ':' character in their name. Though not mentioned in
+ # RFC, servers / browsers allow it.
+
+ {'data': 'key:term=value:term',
+ 'dict': {'key:term' : 'value:term'},
+ 'repr': "<SimpleCookie: key:term='value:term'>",
+ 'output': 'Set-Cookie: key:term=value:term'},
+
 ]
 
 for case in cases:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,8 @@
 Library
 -------
 
+- Issue #2193: Allow ":" character in Cookie NAME values.
+
 - Issue #14629: tokenizer.detect_encoding will specify the filename in the
 SyntaxError exception if found at readline.__self__.name.
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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