py3: Fix find_opf() not working in EPUB input

This commit is contained in:
Kovid Goyal 2019-04-19 17:40:31 +05:30
parent 423e061719
commit aee761ae14
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

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