mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Specify encoding in remainining instances of io.open
This commit is contained in:
parent
06e23487cc
commit
79c27df217
@ -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