From df072f7cae6fb71bb944a1b34dd2e4e3f2b40c9f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 11 Apr 2019 01:46:28 -0400 Subject: [PATCH] py3: encode string before writing ebook mimetypes to the container Fixes saving books in the editor. --- src/calibre/ebooks/oeb/polish/container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/container.py b/src/calibre/ebooks/oeb/polish/container.py index ba4ce390a2..be2803b737 100644 --- a/src/calibre/ebooks/oeb/polish/container.py +++ b/src/calibre/ebooks/oeb/polish/container.py @@ -1360,7 +1360,7 @@ class EpubContainer(Container): else: from calibre.ebooks.tweak import zip_rebuilder with lopen(join(self.root, 'mimetype'), 'wb') as f: - f.write(guess_type('a.epub')) + f.write(guess_type('a.epub').encode('utf-8')) zip_rebuilder(self.root, outpath) for name, data in iteritems(restore_fonts): with self.open(name, 'wb') as f: