From 503d0e0113e1abd0fd24680d6a2002ffc0c6c147 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Oct 2023 07:40:27 +0530 Subject: [PATCH] Also decode bytes in comparable_price() --- src/calibre/gui2/store/search/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/store/search/models.py b/src/calibre/gui2/store/search/models.py index eada2f8359..5dffa9a283 100644 --- a/src/calibre/gui2/store/search/models.py +++ b/src/calibre/gui2/store/search/models.py @@ -22,6 +22,8 @@ from calibre.utils.search_query_parser import SearchQueryParser def comparable_price(text): if isinstance(text, (int, float)): text = str(text) + if isinstance(text, bytes): + text = text.decode('utf-8', 'ignore') text = text or '' # this keep thousand and fraction separators match = re.search(r'(?:\d|[,.](?=\d))(?:\d*(?:[,.\' ](?=\d))?)+', text)