mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
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:
commit
b9504d1f1f
@ -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')
|
||||||
|
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user