Show More
@@ -25,7 +25,7 b' from zmq.utils import jsonapi' | |||||
25 |
|
25 | |||
26 | from IPython.kernel.zmq.session import Session |
|
26 | from IPython.kernel.zmq.session import Session | |
27 | from IPython.utils.jsonutil import date_default |
|
27 | from IPython.utils.jsonutil import date_default | |
28 | from IPython.utils.py3compat import PY3 |
|
28 | from IPython.utils.py3compat import PY3, cast_unicode | |
29 |
|
29 | |||
30 | from .handlers import IPythonHandler |
|
30 | from .handlers import IPythonHandler | |
31 |
|
31 | |||
@@ -83,7 +83,7 b' class ZMQStreamHandler(websocket.WebSocketHandler):' | |||||
83 | class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler): |
|
83 | class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler): | |
84 |
|
84 | |||
85 | def open(self, kernel_id): |
|
85 | def open(self, kernel_id): | |
86 |
self.kernel_id = kernel_id |
|
86 | self.kernel_id = cast_unicode(kernel_id, 'ascii') | |
87 | self.session = Session(config=self.config) |
|
87 | self.session = Session(config=self.config) | |
88 | self.save_on_message = self.on_message |
|
88 | self.save_on_message = self.on_message | |
89 | self.on_message = self.on_first_message |
|
89 | self.on_message = self.on_first_message | |
@@ -97,7 +97,7 b' class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler):' | |||||
97 | msg = msg.encode('utf8', 'replace') |
|
97 | msg = msg.encode('utf8', 'replace') | |
98 | try: |
|
98 | try: | |
99 | identity, msg = msg.split(':', 1) |
|
99 | identity, msg = msg.split(':', 1) | |
100 |
self.session.session = identity |
|
100 | self.session.session = cast_unicode(identity, 'ascii') | |
101 | except Exception: |
|
101 | except Exception: | |
102 | logging.error("First ws message didn't have the form 'identity:[cookie]' - %r", msg) |
|
102 | logging.error("First ws message didn't have the form 'identity:[cookie]' - %r", msg) | |
103 |
|
103 |
General Comments 0
You need to be logged in to leave comments.
Login now