From 49cbf3187222b3ba10a44cfd94f7cf2ae2492234 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Tue, 9 Feb 2016 13:32:37 -0800 Subject: [PATCH] Fix more python 3 unicode issues --- channels/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/handler.py b/channels/handler.py index 7834666..910d6f1 100644 --- a/channels/handler.py +++ b/channels/handler.py @@ -34,7 +34,7 @@ class AsgiRequest(http.HttpRequest): # Path info # TODO: probably needs actual URL decoding self.path = self.message['path'].decode("ascii") - self.script_name = self.message.get('root_path', '') + self.script_name = self.message.get('root_path', b'') if self.script_name: # TODO: Better is-prefix checking, slash handling? self.path_info = self.path[len(self.script_name):] @@ -44,7 +44,7 @@ class AsgiRequest(http.HttpRequest): self.method = self.message['method'].upper() self.META = { "REQUEST_METHOD": self.method, - "QUERY_STRING": self.message.get('query_string', '').decode("ascii"), + "QUERY_STRING": self.message.get('query_string', b'').decode("ascii"), # Old code will need these for a while "wsgi.multithread": True, "wsgi.multiprocess": True,