Show More
@@ -17,6 +17,7 Authors: | |||||
17 | #----------------------------------------------------------------------------- |
|
17 | #----------------------------------------------------------------------------- | |
18 |
|
18 | |||
19 | import datetime |
|
19 | import datetime | |
|
20 | import io | |||
20 | import os |
|
21 | import os | |
21 | import uuid |
|
22 | import uuid | |
22 | import glob |
|
23 | import glob | |
@@ -212,7 +213,7 class NotebookManager(LoggingConfigurable): | |||||
212 | if self.save_script: |
|
213 | if self.save_script: | |
213 | pypath = os.path.splitext(path)[0] + '.py' |
|
214 | pypath = os.path.splitext(path)[0] + '.py' | |
214 | try: |
|
215 | try: | |
215 | with open(pypath,'w') as f: |
|
216 | with io.open(pypath,'w', encoding='utf-8') as f: | |
216 | current.write(nb, f, u'py') |
|
217 | current.write(nb, f, u'py') | |
217 | except Exception as e: |
|
218 | except Exception as e: | |
218 | raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e) |
|
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