From 3ac43cacf0a888f14f40e1e22a7223d5ba415c77 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 2 Jan 2016 09:18:22 -0800 Subject: [PATCH] Change to unicode channel names --- daphne/http_protocol.py | 4 ++-- daphne/ws_protocol.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/daphne/http_protocol.py b/daphne/http_protocol.py index be3cf26..3b840f5 100755 --- a/daphne/http_protocol.py +++ b/daphne/http_protocol.py @@ -25,7 +25,7 @@ class WebRequest(http.Request): # Easy factory link self.factory = self.channel.factory # Make a name for our reply channel - self.reply_channel = self.factory.channel_layer.new_channel(b"!http.response.?") + self.reply_channel = self.factory.channel_layer.new_channel("!http.response.?") # Tell factory we're that channel's client self.last_keepalive = time.time() self.factory.reply_protocols[self.reply_channel] = self @@ -66,7 +66,7 @@ class WebRequest(http.Request): else: # Send request message logging.debug("HTTP %s request for %s", self.method, self.reply_channel) - self.factory.channel_layer.send(b"http.request", { + self.factory.channel_layer.send("http.request", { "reply_channel": self.reply_channel, "method": self.method, "get": self.get, diff --git a/daphne/ws_protocol.py b/daphne/ws_protocol.py index 0b6f9cb..2915b88 100755 --- a/daphne/ws_protocol.py +++ b/daphne/ws_protocol.py @@ -1,7 +1,8 @@ +from __future__ import unicode_literals + import time from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory - from django.http import parse_cookie