From c478c978ef3211755dc1cdea5e398929b81fb7a2 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 29 Apr 2019 02:02:36 -0400 Subject: [PATCH] py3: make rb metadata reading work --- src/calibre/ebooks/metadata/rb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/rb.py b/src/calibre/ebooks/metadata/rb.py index a193ae44d9..7f5ad0b5c4 100644 --- a/src/calibre/ebooks/metadata/rb.py +++ b/src/calibre/ebooks/metadata/rb.py @@ -8,7 +8,7 @@ import sys, struct from calibre.ebooks.metadata import MetaInformation, string_to_authors from polyglot.builtins import unicode_type -MAGIC = '\xb0\x0c\xb0\x0c\x02\x00NUVO\x00\x00\x00\x00' +MAGIC = b'\xb0\x0c\xb0\x0c\x02\x00NUVO\x00\x00\x00\x00' def get_metadata(stream): @@ -37,7 +37,7 @@ def get_metadata(stream): return mi stream.seek(offset) - info = stream.read(length).splitlines() + info = stream.read(length).decode().splitlines() for line in info: if '=' not in line: continue