Skip to content

Commit

Permalink
Specify UTF-8 encoding for saving notebook as script.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jan 30, 2012
1 parent ddeaebc commit 3a5bb53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IPython/frontend/html/notebook/notebookmanager.py
Expand Up @@ -213,7 +213,7 @@ def save_notebook_object(self, notebook_id, nb):
if self.save_script: if self.save_script:
pypath = os.path.splitext(path)[0] + '.py' pypath = os.path.splitext(path)[0] + '.py'
try: try:
with io.open(pypath,'w') as f: with io.open(pypath,'w', encoding='utf-8') as f:
current.write(nb, f, u'py') current.write(nb, f, u'py')
except Exception as e: except Exception as e:
raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e) raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e)
Expand Down

0 comments on commit 3a5bb53

Please sign in to comment.