##// END OF EJS Templates
nbjson.writes always returns unicode
MinRK -
Show More
@@ -24,6 +24,8 b' from .rwbase import ('
24 24 NotebookReader, NotebookWriter, restore_bytes, rejoin_lines, split_lines
25 25 )
26 26
27 from IPython.utils import py3compat
28
27 29 #-----------------------------------------------------------------------------
28 30 # Code
29 31 #-----------------------------------------------------------------------------
@@ -56,7 +58,7 b' class JSONWriter(NotebookWriter):'
56 58 kwargs['separators'] = (',',': ')
57 59 if kwargs.pop('split_lines', True):
58 60 nb = split_lines(copy.deepcopy(nb))
59 return json.dumps(nb, **kwargs)
61 return py3compat.str_to_unicode(json.dumps(nb, **kwargs), 'utf-8')
60 62
61 63
62 64 _reader = JSONReader()
General Comments 0
You need to be logged in to leave comments. Login now