##// END OF EJS Templates
Save notebook as script using unicode file handle....
Thomas Kluyver -
Show More
@@ -17,6 +17,7 b' Authors:'
17 17 #-----------------------------------------------------------------------------
18 18
19 19 import datetime
20 import io
20 21 import os
21 22 import uuid
22 23 import glob
@@ -212,7 +213,7 b' class NotebookManager(LoggingConfigurable):'
212 213 if self.save_script:
213 214 pypath = os.path.splitext(path)[0] + '.py'
214 215 try:
215 with open(pypath,'w') as f:
216 with io.open(pypath,'w') as f:
216 217 current.write(nb, f, u'py')
217 218 except Exception as e:
218 219 raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e)
General Comments 0
You need to be logged in to leave comments. Login now