diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 9eca611..e93ff0b 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2506,13 +2506,12 @@ class InteractiveShell(SingletonConfigurable): """generator for sequence of code blocks to run""" if fname.endswith('.ipynb'): from nbformat import read - with io_open(fname) as f: - nb = read(f, as_version=4) - if not nb.cells: - return - for cell in nb.cells: - if cell.cell_type == 'code': - yield cell.source + nb = read(fname, as_version=4) + if not nb.cells: + return + for cell in nb.cells: + if cell.cell_type == 'code': + yield cell.source else: with open(fname) as f: yield f.read()