mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Merge pull request #801 from takluyver/py3-notebook
Gets the notebook working under Python3.
This commit is contained in:
commit
eba1a8c796
@ -172,7 +172,7 @@ class ZMQStreamHandler(websocket.WebSocketHandler):
|
|||||||
|
|
||||||
class AuthenticatedZMQStreamHandler(ZMQStreamHandler):
|
class AuthenticatedZMQStreamHandler(ZMQStreamHandler):
|
||||||
def open(self, kernel_id):
|
def open(self, kernel_id):
|
||||||
self.kernel_id = kernel_id
|
self.kernel_id = kernel_id.decode('ascii')
|
||||||
self.session = Session()
|
self.session = Session()
|
||||||
self.save_on_message = self.on_message
|
self.save_on_message = self.on_message
|
||||||
self.on_message = self.on_first_message
|
self.on_message = self.on_first_message
|
||||||
|
@ -150,7 +150,7 @@ class NotebookManager(LoggingConfigurable):
|
|||||||
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
|
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
nb = current.reads(data, format)
|
nb = current.reads(data.decode('utf-8'), format)
|
||||||
except:
|
except:
|
||||||
raise web.HTTPError(400, u'Invalid JSON data')
|
raise web.HTTPError(400, u'Invalid JSON data')
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ class NotebookManager(LoggingConfigurable):
|
|||||||
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
|
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
nb = current.reads(data, format)
|
nb = current.reads(data.decode('utf-8'), format)
|
||||||
except:
|
except:
|
||||||
raise web.HTTPError(400, u'Invalid JSON data')
|
raise web.HTTPError(400, u'Invalid JSON data')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user