mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Specify UTF-8 encoding for saving notebook as script.
This commit is contained in:
parent
53b10b861c
commit
abd3989bb6
@ -213,7 +213,7 @@ class NotebookManager(LoggingConfigurable):
|
||||
if self.save_script:
|
||||
pypath = os.path.splitext(path)[0] + '.py'
|
||||
try:
|
||||
with io.open(pypath,'w') as f:
|
||||
with io.open(pypath,'w', encoding='utf-8') as f:
|
||||
current.write(nb, f, u'py')
|
||||
except Exception as e:
|
||||
raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e)
|
||||
|
Loading…
Reference in New Issue
Block a user