summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-22 01:21:54 (GMT)
committerBrett Cannon <brett@python.org>2012-04-22 01:21:54 (GMT)
commit27f29d8483b16e0dbf9164ff82eff768151b8822 (patch)
tree75ad37ba64a5ab7b741671fe1b6a7379832b63e5 /Lib
parent0d05a7698b3c66579c87b2bfc5b9e043c1064a93 (diff)
parentf75822879b1a1530ba839a904ed8bffb96744feb (diff)
downloadcpython-27f29d8483b16e0dbf9164ff82eff768151b8822.zip
cpython-27f29d8483b16e0dbf9164ff82eff768151b8822.tar.gz
cpython-27f29d8483b16e0dbf9164ff82eff768151b8822.tar.bz2
merge
Diffstat (limited to 'Lib')
-rw-r--r--Lib/http/cookies.py2
-rw-r--r--Lib/test/test_http_cookies.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index 93da627..d73f79a 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -159,7 +159,7 @@ class CookieError(Exception):
# _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
index f9a98c4..a56a42d 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -34,6 +34,15 @@ class CookieTests(unittest.TestCase):
'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: