@ -67,7 +67,7 @@ class APITest(NotebookTestBase):
with io.open(pjoin(nbdir, 'foo', 'testnb.ipynb'), 'w',
encoding='utf-8') as f:
write(f, nb, version=4)
write(nb, f, version=4)
self.nbconvert_api = NbconvertAPI(self.base_url())
@ -303,7 +303,7 @@ class FileContentsManager(ContentsManager):
nb['metadata']['name'] = u''
with atomic_writing(os_path, encoding='utf-8') as f:
nbformat.write(f, nb, version=nbformat.NO_CONVERT)
nbformat.write(nb, f, version=nbformat.NO_CONVERT)
def _save_file(self, os_path, model, name='', path=''):
"""save a non-notebook file"""
@ -144,7 +144,7 @@ class APITest(NotebookTestBase):
with io.open(pjoin(nbdir, d, '%s.ipynb' % name), 'w',
nb = new_notebook()
# create a text file
with io.open(pjoin(nbdir, d, '%s.txt' % name), 'w',
@ -64,7 +64,7 @@ class SessionAPITest(NotebookTestBase):
with io.open(pjoin(nbdir, 'foo', 'nb1.ipynb'), 'w',
self.sess_api = SessionAPI(self.base_url())
@ -74,7 +74,7 @@ class FilesTest(NotebookTestBase):
with io.open(pjoin(nbdir, 'testnb.ipynb'), 'w',
with io.open(pjoin(nbdir, 'test.bin'), 'wb') as f:
f.write(b'\xff' + os.urandom(5))