From 74c3bfa9fe104e6f1d70c029fc08fc9dfb9ab6c1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Apr 2019 11:48:32 +0530 Subject: [PATCH] py3 fix OPDS feed generation --- src/calibre/srv/opds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/srv/opds.py b/src/calibre/srv/opds.py index 91c4b7fe98..a3e1ad637b 100644 --- a/src/calibre/srv/opds.py +++ b/src/calibre/srv/opds.py @@ -26,7 +26,7 @@ from calibre import force_unicode from calibre.srv.errors import HTTPNotFound, HTTPInternalServerError from calibre.srv.routes import endpoint from calibre.srv.utils import get_library_data, http_date, Offsets -from polyglot.builtins import iteritems, unicode_type, filter +from polyglot.builtins import iteritems, unicode_type, filter, as_bytes from polyglot.urllib import urlencode from polyglot.binary import as_hex_unicode, from_hex_unicode @@ -97,7 +97,7 @@ SUBTITLE = E.subtitle def NAVCATALOG_ENTRY(url_for, updated, title, description, query): href = url_for('/opds/navcatalog', which=as_hex_unicode(query)) - id_ = 'calibre-navcatalog:'+str(hashlib.sha1(href).hexdigest()) + id_ = 'calibre-navcatalog:' + hashlib.sha1(as_bytes(href)).hexdigest() return E.entry( TITLE(title), ID(id_),