From 14a803229f7174e587578bf14cd42d0ce6440f57 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 Feb 2020 12:05:46 +0530 Subject: [PATCH] py3: Fix #1863160 [Wrong links in the converted azw3 file](https://bugs.launchpad.net/calibre/+bug/1863160) --- src/calibre/ebooks/mobi/writer8/skeleton.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer8/skeleton.py b/src/calibre/ebooks/mobi/writer8/skeleton.py index 1fab295273..286083331c 100644 --- a/src/calibre/ebooks/mobi/writer8/skeleton.py +++ b/src/calibre/ebooks/mobi/writer8/skeleton.py @@ -16,7 +16,7 @@ from lxml import etree from calibre import my_unichr from calibre.ebooks.oeb.base import XHTML_NS, extract from calibre.ebooks.mobi.utils import to_base, PolyglotDict -from polyglot.builtins import iteritems, unicode_type +from polyglot.builtins import iteritems, unicode_type, as_bytes CHUNK_SIZE = 8192 @@ -397,7 +397,7 @@ class Chunker(object): pos, fid = to_base(pos, min_num_digits=4), to_href(fid) return ':off:'.join((pos, fid)).encode('utf-8') - placeholder_map = {k:to_placeholder(v) for k, v in + placeholder_map = {as_bytes(k):to_placeholder(v) for k, v in iteritems(self.placeholder_map)} # Now update the links