diff --git a/IPython/nbformat/v2/nbjson.py b/IPython/nbformat/v2/nbjson.py index fb6e812..249439f 100644 --- a/IPython/nbformat/v2/nbjson.py +++ b/IPython/nbformat/v2/nbjson.py @@ -28,7 +28,7 @@ import json class BytesEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, bytes): - return unicode(encodestring(bytes)) + return encodestring(obj).decode('ascii') return json.JSONEncoder.default(self, obj)