From a2c4d446882c1168ff16f3f837711943ff0f36e5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 May 2019 11:05:49 +0530 Subject: [PATCH] Fix a regression in 4d547f40e7 Without the bytearray() c will not be an integer on python2 --- src/calibre/devices/kindle/apnx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/kindle/apnx.py b/src/calibre/devices/kindle/apnx.py index a272701429..7fb4e2bbf0 100644 --- a/src/calibre/devices/kindle/apnx.py +++ b/src/calibre/devices/kindle/apnx.py @@ -237,7 +237,7 @@ class APNXBuilder(object): # not modifying the text. In this case the case # doesn't matter just the absolute character and # the position within the stream. - data = mr.mobi_html.lower() + data = bytearray(as_bytes(mr.mobi_html.lower())) slash, p, lt, gt = map(ord, '/p<>') for c in data: pos += 1