From aee761ae14609350f0bbeff8d941a6ee08ee3f0e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Apr 2019 17:40:31 +0530 Subject: [PATCH] py3: Fix find_opf() not working in EPUB input --- src/calibre/ebooks/conversion/plugins/epub_input.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/conversion/plugins/epub_input.py b/src/calibre/ebooks/conversion/plugins/epub_input.py index 2bd81761fd..ae609769c5 100644 --- a/src/calibre/ebooks/conversion/plugins/epub_input.py +++ b/src/calibre/ebooks/conversion/plugins/epub_input.py @@ -237,7 +237,7 @@ class EPUBInput(InputFormatPlugin): if k.endswith(attr): return v try: - with open('META-INF/container.xml') as f: + with open('META-INF/container.xml', 'rb') as f: root = etree.fromstring(f.read()) for r in root.xpath('//*[local-name()="rootfile"]'): if attr(r, 'media-type') != "application/oebps-package+xml": @@ -248,7 +248,7 @@ class EPUBInput(InputFormatPlugin): path = os.path.join(os.getcwdu(), *path.split('/')) if os.path.exists(path): return path - except: + except Exception: import traceback traceback.print_exc()