mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix spurious warning when reading EPUB metadata
This commit is contained in:
parent
46b9a7a325
commit
dce8ea7719
@ -92,11 +92,11 @@ class OCFReader(OCF):
|
||||
|
||||
def __init__(self):
|
||||
try:
|
||||
mimetype = self.open('mimetype').read().rstrip()
|
||||
mimetype = self.open('mimetype').read().decode('utf-8').rstrip()
|
||||
if mimetype != OCF.MIMETYPE:
|
||||
print('WARNING: Invalid mimetype declaration', mimetype)
|
||||
except:
|
||||
print('WARNING: Epub doesn\'t contain a mimetype declaration')
|
||||
print('WARNING: Epub doesn\'t contain a valid mimetype declaration')
|
||||
|
||||
try:
|
||||
with closing(self.open(OCF.CONTAINER_PATH)) as f:
|
||||
|
Loading…
x
Reference in New Issue
Block a user