From 88bc6a4a913923fddd7791ca337cf6e7745d0025 2013-11-06 01:35:36 From: Thomas Kluyver Date: 2013-11-06 01:35:36 Subject: [PATCH] Pass nbformat object to write call to save .py script Closes gh-4495 --- diff --git a/IPython/html/services/notebooks/filenbmanager.py b/IPython/html/services/notebooks/filenbmanager.py index 992e9d3..3ae54ed 100644 --- a/IPython/html/services/notebooks/filenbmanager.py +++ b/IPython/html/services/notebooks/filenbmanager.py @@ -251,7 +251,7 @@ class FileNotebookManager(NotebookManager): self.log.debug("Writing script %s", py_path) try: with io.open(py_path, 'w', encoding='utf-8') as f: - current.write(model, f, u'py') + current.write(nb, f, u'py') except Exception as e: raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s %s' % (py_path, e))