Merge pull request #4563 from takluyver/i4562

Specify encoding for reading notebook file. and a few other calls to io.open with missing encoding
This commit is contained in:
Min RK 2013-11-20 14:29:18 -08:00
commit b9504d1f1f
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:
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')

View File

@ -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')