##// END OF EJS Templates
Decode data for saving notebook, allowing saving in Python 3.
Thomas Kluyver -
Show More
@@ -150,7 +150,7 b' class NotebookManager(LoggingConfigurable):'
150 raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
150 raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
151
151
152 try:
152 try:
153 nb = current.reads(data, format)
153 nb = current.reads(data.decode('utf-8'), format)
154 except:
154 except:
155 raise web.HTTPError(400, u'Invalid JSON data')
155 raise web.HTTPError(400, u'Invalid JSON data')
156
156
@@ -171,7 +171,7 b' class NotebookManager(LoggingConfigurable):'
171 raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
171 raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
172
172
173 try:
173 try:
174 nb = current.reads(data, format)
174 nb = current.reads(data.decode('utf-8'), format)
175 except:
175 except:
176 raise web.HTTPError(400, u'Invalid JSON data')
176 raise web.HTTPError(400, u'Invalid JSON data')
177
177
General Comments 0
You need to be logged in to leave comments. Login now