From 1c8058fff6c171907587133f6fa4f1be1367421a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 23 Mar 2016 17:27:23 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/polish/cover.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/cover.py b/src/calibre/ebooks/oeb/polish/cover.py index baba62d9ef..4a5253343c 100644 --- a/src/calibre/ebooks/oeb/polish/cover.py +++ b/src/calibre/ebooks/oeb/polish/cover.py @@ -34,7 +34,7 @@ def set_azw3_cover(container, cover_path, report, options=None): container.insert_into_xml(guide, guide.makeelement( OPF('reference'), href=href, type='cover')) if not existing_image: - with open(cover_path, 'rb') as src, container.open(name, 'wb') as dest: + with lopen(cover_path, 'rb') as src, container.open(name, 'wb') as dest: shutil.copyfileobj(src, dest) container.dirty(container.opf_name) report(_('Cover updated') if found else _('Cover inserted'))