From 1edab4b8182dcd7268d1fc26f8fd4e2f9c38541e Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 18 Apr 2019 02:59:22 -0400 Subject: [PATCH] py3: store plugins always receive bytes query ... and cannot be further encoded. When interpolating into strings, however, they do need to decode it. --- src/calibre/gui2/store/stores/bn_plugin.py | 2 +- src/calibre/gui2/store/stores/woblink_plugin.py | 2 +- src/calibre/gui2/store/stores/wolnelektury_plugin.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/store/stores/bn_plugin.py b/src/calibre/gui2/store/stores/bn_plugin.py index 30164199b9..bc4a3cd4da 100644 --- a/src/calibre/gui2/store/stores/bn_plugin.py +++ b/src/calibre/gui2/store/stores/bn_plugin.py @@ -40,7 +40,7 @@ class BNStore(BasicStoreConfig, StorePlugin): d.exec_() def search(self, query, max_results=10, timeout=60): - url = 'http://www.barnesandnoble.com/s/%s?keyword=%s&store=ebook&view=list' % (query.replace(' ', '-'), quote_plus(query)) + url = 'http://www.barnesandnoble.com/s/%s?keyword=%s&store=ebook&view=list' % (query.decode('utf-8').replace(' ', '-'), quote_plus(query)) br = browser() diff --git a/src/calibre/gui2/store/stores/woblink_plugin.py b/src/calibre/gui2/store/stores/woblink_plugin.py index 258a12a0cf..9258813d95 100644 --- a/src/calibre/gui2/store/stores/woblink_plugin.py +++ b/src/calibre/gui2/store/stores/woblink_plugin.py @@ -36,7 +36,7 @@ def as_base64(data): def search(query, max_results=10, timeout=60): - url = 'http://woblink.com/publication/ajax?mode=none&query=' + quote_plus(query.encode('utf-8')) + url = 'http://woblink.com/publication/ajax?mode=none&query=' + quote_plus(query) if max_results > 10: if max_results > 20: url += '&limit=30' diff --git a/src/calibre/gui2/store/stores/wolnelektury_plugin.py b/src/calibre/gui2/store/stores/wolnelektury_plugin.py index 18358d61b6..317791b194 100644 --- a/src/calibre/gui2/store/stores/wolnelektury_plugin.py +++ b/src/calibre/gui2/store/stores/wolnelektury_plugin.py @@ -44,7 +44,7 @@ class WolneLekturyStore(BasicStoreConfig, StorePlugin): d.exec_() def search(self, query, max_results=10, timeout=60): - url = 'http://wolnelektury.pl/szukaj?q=' + quote_plus(query.encode('utf-8')) + url = 'http://wolnelektury.pl/szukaj?q=' + quote_plus(query) br = browser()