summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-20 00:30:38 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-20 00:30:38 (GMT)
commitf66263c20a7b1f2226cd876b0ffcfbe07bd74abb (patch)
tree69d197e5b37c4f97f831451424bbbe1f643c15b2 /Lib
parent99603b0c1edb4b8ca2a30fa90470170b959321ee (diff)
downloadcpython-f66263c20a7b1f2226cd876b0ffcfbe07bd74abb.zip
cpython-f66263c20a7b1f2226cd876b0ffcfbe07bd74abb.tar.gz
cpython-f66263c20a7b1f2226cd876b0ffcfbe07bd74abb.tar.bz2
Fix test_cookie.py.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/Cookie.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/Cookie.py b/Lib/Cookie.py
index ca559e8..83f30d5 100644
--- a/Lib/Cookie.py
+++ b/Lib/Cookie.py
@@ -161,8 +161,8 @@ strange-looking cookie values, however.)
7
>>> C["string"].value
'seven'
- >>> C.output().replace('p0', 'p1') # Hack for pickling differences
- 'Set-Cookie: number="I7\\012."\r\nSet-Cookie: string="Vseven\\012p1\\012."'
+ >>> C.output()
+ 'Set-Cookie: number="L7\\012."\r\nSet-Cookie: string="Vseven\\012p0\\012."'
Be warned, however, if SerialCookie cannot de-serialize a value (because
it isn't a valid pickle'd object), IT WILL RAISE AN EXCEPTION.
@@ -186,7 +186,7 @@ as a string.
>>> C["string"].value
'seven'
>>> C.output()
- 'Set-Cookie: number="I7\\012."\r\nSet-Cookie: string=seven'
+ 'Set-Cookie: number="L7\\012."\r\nSet-Cookie: string=seven'
Backwards Compatibility
@@ -676,7 +676,7 @@ class SerialCookie(BaseCookie):
# This could raise an exception!
return loads( _unquote(val).encode('latin-1') ), val
def value_encode(self, val):
- return val, _quote( dumps(val).decode('latin-1') )
+ return val, _quote( dumps(val, 0).decode('latin-1') )
# end SerialCookie
class SmartCookie(BaseCookie):
@@ -707,7 +707,7 @@ class SmartCookie(BaseCookie):
if isinstance(val, str):
return val, _quote(val)
else:
- return val, _quote( dumps(val).decode('latin-1') )
+ return val, _quote( dumps(val, 0).decode('latin-1') )
# end SmartCookie