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()