From dce8ea7719ca0cc06b4e8542e1a5acb2e0dc75ab Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 10 Apr 2019 15:10:28 +0530 Subject: [PATCH] py3: Fix spurious warning when reading EPUB metadata --- src/calibre/ebooks/metadata/epub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/epub.py b/src/calibre/ebooks/metadata/epub.py index 39fd5390fa..1828a76639 100644 --- a/src/calibre/ebooks/metadata/epub.py +++ b/src/calibre/ebooks/metadata/epub.py @@ -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: