From 609e4134ff2c5ff70eab22f9828faceef6e88390 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sun, 2 Oct 2011 16:19:30 +0100 Subject: [PATCH] Decode data for saving notebook, allowing saving in Python 3. --- IPython/frontend/html/notebook/notebookmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPython/frontend/html/notebook/notebookmanager.py b/IPython/frontend/html/notebook/notebookmanager.py index 8c413f000..6aed5a4bb 100644 --- a/IPython/frontend/html/notebook/notebookmanager.py +++ b/IPython/frontend/html/notebook/notebookmanager.py @@ -150,7 +150,7 @@ class NotebookManager(LoggingConfigurable): raise web.HTTPError(415, u'Invalid notebook format: %s' % format) try: - nb = current.reads(data, format) + nb = current.reads(data.decode('utf-8'), format) except: 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) try: - nb = current.reads(data, format) + nb = current.reads(data.decode('utf-8'), format) except: raise web.HTTPError(400, u'Invalid JSON data')