From 8ed3a725f33d98b3d9c1e3c69e987ed67ce381ea Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Tue, 5 Nov 2013 17:35:36 -0800 Subject: [PATCH] Pass nbformat object to write call to save .py script Closes gh-4495 --- IPython/html/services/notebooks/filenbmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/html/services/notebooks/filenbmanager.py b/IPython/html/services/notebooks/filenbmanager.py index 992e9d39c..3ae54ed6a 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))