mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: make rb metadata reading work
This commit is contained in:
parent
42cb67abb3
commit
c478c978ef
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user