From 85378356dbadece340f83ea450325522379da09c Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 18 Apr 2019 02:28:53 -0400 Subject: [PATCH] py3: cannot decode the result of urlencode() It is already both a str, and reduced to url-friendly ascii. --- src/calibre/gui2/store/stores/amazon_au_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_ca_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_de_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_es_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_fr_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_in_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_it_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_plugin.py | 2 +- src/calibre/gui2/store/stores/amazon_uk_plugin.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/calibre/gui2/store/stores/amazon_au_plugin.py b/src/calibre/gui2/store/stores/amazon_au_plugin.py index ff697eb2cc..61a4387ed4 100644 --- a/src/calibre/gui2/store/stores/amazon_au_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_au_plugin.py @@ -47,7 +47,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_ca_plugin.py b/src/calibre/gui2/store/stores/amazon_ca_plugin.py index 2f06e574cd..6f4dd4794d 100644 --- a/src/calibre/gui2/store/stores/amazon_ca_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_ca_plugin.py @@ -47,7 +47,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_de_plugin.py b/src/calibre/gui2/store/stores/amazon_de_plugin.py index 1b798c3b83..5979e82c8c 100644 --- a/src/calibre/gui2/store/stores/amazon_de_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_de_plugin.py @@ -49,7 +49,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_es_plugin.py b/src/calibre/gui2/store/stores/amazon_es_plugin.py index 5d5ce09808..f95bcc4010 100644 --- a/src/calibre/gui2/store/stores/amazon_es_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_es_plugin.py @@ -49,7 +49,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_fr_plugin.py b/src/calibre/gui2/store/stores/amazon_fr_plugin.py index c1318416f5..3594af9499 100644 --- a/src/calibre/gui2/store/stores/amazon_fr_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_fr_plugin.py @@ -49,7 +49,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_in_plugin.py b/src/calibre/gui2/store/stores/amazon_in_plugin.py index 4c83efc097..c659696fa2 100644 --- a/src/calibre/gui2/store/stores/amazon_in_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_in_plugin.py @@ -47,7 +47,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_it_plugin.py b/src/calibre/gui2/store/stores/amazon_it_plugin.py index 326a74d372..922e9c524c 100644 --- a/src/calibre/gui2/store/stores/amazon_it_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_it_plugin.py @@ -49,7 +49,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_plugin.py b/src/calibre/gui2/store/stores/amazon_plugin.py index 162439f8c9..8e6dfee91b 100644 --- a/src/calibre/gui2/store/stores/amazon_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_plugin.py @@ -47,7 +47,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results diff --git a/src/calibre/gui2/store/stores/amazon_uk_plugin.py b/src/calibre/gui2/store/stores/amazon_uk_plugin.py index 38197e270e..fb04a61c84 100644 --- a/src/calibre/gui2/store/stores/amazon_uk_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_uk_plugin.py @@ -47,7 +47,7 @@ def search_amazon(query, max_results=10, timeout=60, x = x.encode('utf-8') return x uquery = {asbytes(k):asbytes(v) for k, v in uquery.items()} - url = base_url + '?' + urlencode(uquery).decode('ascii') + url = base_url + '?' + urlencode(uquery) br = browser(user_agent=get_user_agent()) counter = max_results