Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f66263c2
Commit
f66263c2
authored
Jul 20, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test_cookie.py.
parent
99603b0c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Lib/Cookie.py
Lib/Cookie.py
+5
-5
No files found.
Lib/Cookie.py
View file @
f66263c2
...
@@ -161,8 +161,8 @@ strange-looking cookie values, however.)
...
@@ -161,8 +161,8 @@ strange-looking cookie values, however.)
7
7
>>> C["string"].value
>>> C["string"].value
'seven'
'seven'
>>> C.output()
.replace('p0', 'p1') # Hack for pickling differences
>>> C.output()
'Set-Cookie: number="
I7\\012."\r\nSet-Cookie: string="Vseven\\012p1
\\012."'
'Set-Cookie: number="
L7\\012."\r\nSet-Cookie: string="Vseven\\012p0
\\012."'
Be warned, however, if SerialCookie cannot de-serialize a value (because
Be warned, however, if SerialCookie cannot de-serialize a value (because
it isn't a valid pickle'd object), IT WILL RAISE AN EXCEPTION.
it isn't a valid pickle'd object), IT WILL RAISE AN EXCEPTION.
...
@@ -186,7 +186,7 @@ as a string.
...
@@ -186,7 +186,7 @@ as a string.
>>> C["string"].value
>>> C["string"].value
'seven'
'seven'
>>> C.output()
>>> C.output()
'Set-Cookie: number="
I
7\\012."\r\nSet-Cookie: string=seven'
'Set-Cookie: number="
L
7\\012."\r\nSet-Cookie: string=seven'
Backwards Compatibility
Backwards Compatibility
...
@@ -676,7 +676,7 @@ class SerialCookie(BaseCookie):
...
@@ -676,7 +676,7 @@ class SerialCookie(BaseCookie):
# This could raise an exception!
# This could raise an exception!
return
loads
(
_unquote
(
val
).
encode
(
'latin-1'
)
),
val
return
loads
(
_unquote
(
val
).
encode
(
'latin-1'
)
),
val
def
value_encode
(
self
,
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
# end SerialCookie
class
SmartCookie
(
BaseCookie
):
class
SmartCookie
(
BaseCookie
):
...
@@ -707,7 +707,7 @@ class SmartCookie(BaseCookie):
...
@@ -707,7 +707,7 @@ class SmartCookie(BaseCookie):
if
isinstance
(
val
,
str
):
if
isinstance
(
val
,
str
):
return
val
,
_quote
(
val
)
return
val
,
_quote
(
val
)
else
:
else
:
return
val
,
_quote
(
dumps
(
val
).
decode
(
'latin-1'
)
)
return
val
,
_quote
(
dumps
(
val
,
0
).
decode
(
'latin-1'
)
)
# end SmartCookie
# end SmartCookie
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment