diff --git a/IPython/core/magics/basic.py b/IPython/core/magics/basic.py index 397df88..731038a 100644 --- a/IPython/core/magics/basic.py +++ b/IPython/core/magics/basic.py @@ -603,7 +603,7 @@ Defaulting color scheme to 'NoColor'""" hist = list(self.shell.history_manager.get_range()) if(len(hist)<=1): raise ValueError('History is empty, cannot export') - for session, execution_count, input in hist[:-1]: + for session, execution_count, source in hist[:-1]: cells.append(v4.new_code_cell( execution_count=execution_count, source=source diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index e1ec546..101a006 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -625,7 +625,7 @@ class NotebookExportMagicTests(TestCase): def test_notebook_export_json(self): _ip = get_ipython() _ip.history_manager.reset() # Clear any existing history. - cmds = [u"a=1", u"def b():\n return a**2", u"print(a, b())"] + cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"] for i, cmd in enumerate(cmds, start=1): _ip.history_manager.store_inputs(i, cmd) with TemporaryDirectory() as td: