Skip to content

Commit 596d71a

Browse files
author
Hans Hörberg
committed
Fix for python 3
1 parent 57f7569 commit 596d71a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example/sp-wsgi/sp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def __init__(self):
167167

168168
def get_user(self, environ):
169169
cookie = environ.get("HTTP_COOKIE", '')
170-
170+
cookie = cookie.decode("UTF-8")
171171
logger.debug("Cookie: %s" % cookie)
172172
if cookie:
173173
cookie_obj = SimpleCookie(cookie)
@@ -205,7 +205,7 @@ def set_cookie(self, user):
205205
cookie[self.cookie_name]['path'] = "/"
206206
cookie[self.cookie_name]["expires"] = _expiration(480)
207207
logger.debug("Cookie expires: %s" % cookie[self.cookie_name]["expires"])
208-
return cookie.output().split(": ", 1)
208+
return cookie.output().encode("UTF-8").split(": ", 1)
209209

210210

211211
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)