From 79c27df217bbc3eab5ec3757e964289d2471db03 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Wed, 20 Nov 2013 10:50:04 -0800 Subject: [PATCH] Specify encoding in remainining instances of io.open --- IPython/html/services/notebooks/tests/test_notebooks_api.py | 3 ++- IPython/html/services/sessions/tests/test_sessions_api.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IPython/html/services/notebooks/tests/test_notebooks_api.py b/IPython/html/services/notebooks/tests/test_notebooks_api.py index 33238bc60..ceee22c48 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 0d31fa766..896f4cdaf 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')