Permalink
Browse files

Decode data for saving notebook, allowing saving in Python 3.

  • Loading branch information...
1 parent 0aab55d commit c87e30135fdff4329d0ab680754ce76b05630c46 @takluyver committed Oct 2, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 IPython/frontend/html/notebook/notebookmanager.py
@@ -150,7 +150,7 @@ def save_new_notebook(self, data, name=None, format=u'json'):
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 @@ def save_notebook(self, notebook_id, data, name=None, format=u'json'):
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')

0 comments on commit c87e301

Please sign in to comment.