Specify encoding in remainining instances of io.open

This commit is contained in:
Thomas Kluyver 2013-11-20 10:50:04 -08:00
parent 06e23487cc
commit 79c27df217
2 changed files with 4 additions and 2 deletions

View File

@ -108,7 +108,8 @@ class APITest(NotebookTestBase):
for d, name in self.dirs_nbs: for d, name in self.dirs_nbs:
d = d.replace('/', os.sep) 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) nb = new_notebook(name=name)
write(nb, f, format='ipynb') write(nb, f, format='ipynb')

View File

@ -59,7 +59,8 @@ class SessionAPITest(NotebookTestBase):
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise 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') nb = new_notebook(name='nb1')
write(nb, f, format='ipynb') write(nb, f, format='ipynb')