From 6e0526cea36ece02f0fb1500822f478e18bd2ba1 Mon Sep 17 00:00:00 2001 From: Jiri Kuncar Date: Thu, 23 Nov 2017 13:31:32 +0100 Subject: [PATCH] notebook: fix encoding during save --- renga/notebook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renga/notebook.py b/renga/notebook.py index 7982a2f473..9e15ca188c 100644 --- a/renga/notebook.py +++ b/renga/notebook.py @@ -240,7 +240,9 @@ def _save_notebook(self, path, nb): file_ = self._resolve_path(path)._obj with file_.open('w') as fp: - fp.write(nbformat.writes(nb, version=nbformat.NO_CONVERT)) + fp.write( + nbformat.writes(nb, version=nbformat.NO_CONVERT).encode( + 'utf-8')) def _resolve_path(self, path): """Return a resource based on the specified path."""