##// END OF EJS Templates
cast writes to unicode before write
MinRK -
Show More
@@ -174,13 +174,9 b" def write(nb, fp, format='DEPRECATED', **kwargs):"
174 The notebook to write.
174 The notebook to write.
175 fp : file
175 fp : file
176 Any file-like object with a write method.
176 Any file-like object with a write method.
177 format : (u'json', u'ipynb', u'py')
178 The format to write the notebook in.
179
180 Returns
181 -------
182 s : unicode
183 The notebook string.
184 """
177 """
185 return fp.write(writes(nb, **kwargs))
178 s = writes(nb, **kwargs)
179 if isinstance(s, bytes):
180 s = s.decode('utf8')
181 return fp.write(s)
186
182
General Comments 0
You need to be logged in to leave comments. Login now