From 38efc4e7bc702d5b474364f89ee7b951ff158df9 2011-10-20 21:43:46 From: Thomas Kluyver Date: 2011-10-20 21:43:46 Subject: [PATCH] Minor tweak to nbformat, still not passing test on Python 3. --- 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)