diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 28e0370..f15c818 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -911,7 +911,7 @@ def _run_edit_test(arg_s, exp_filename=None, if exp_filename is not None: nt.assert_equal(exp_filename, filename) if exp_contents is not None: - with io.open(filename, 'r') as f: + with io.open(filename, 'r', encoding='utf-8') as f: contents = f.read() nt.assert_equal(exp_contents, contents) if exp_lineno != -1: diff --git a/IPython/html/services/notebooks/tests/test_notebooks_api.py b/IPython/html/services/notebooks/tests/test_notebooks_api.py index 33238bc..ceee22c 100644 --- a/IPython/html/services/notebooks/tests/test_notebooks_api.py +++ b/IPython/html/services/notebooks/tests/test_notebooks_api.py @@ -108,7 +108,8 @@ class APITest(NotebookTestBase): for d, name in self.dirs_nbs: d = d.replace('/', os.sep) - with io.open(pjoin(nbdir, d, '%s.ipynb' % name), 'w') as f: + with io.open(pjoin(nbdir, d, '%s.ipynb' % name), 'w', + encoding='utf-8') as f: nb = new_notebook(name=name) write(nb, f, format='ipynb') diff --git a/IPython/html/services/sessions/tests/test_sessions_api.py b/IPython/html/services/sessions/tests/test_sessions_api.py index 0d31fa7..896f4cd 100644 --- a/IPython/html/services/sessions/tests/test_sessions_api.py +++ b/IPython/html/services/sessions/tests/test_sessions_api.py @@ -59,7 +59,8 @@ class SessionAPITest(NotebookTestBase): if e.errno != errno.EEXIST: raise - with io.open(pjoin(nbdir, 'foo', 'nb1.ipynb'), 'w') as f: + with io.open(pjoin(nbdir, 'foo', 'nb1.ipynb'), 'w', + encoding='utf-8') as f: nb = new_notebook(name='nb1') write(nb, f, format='ipynb')