From ac065467811b7bf4d463ea2e168da13818093859 Mon Sep 17 00:00:00 2001 From: Elad Alfassa Date: Fri, 7 Mar 2014 01:26:45 +0200 Subject: [PATCH] [wikipedia] Don't .encode() the query It's pointless, web.py already handles that --- wikipedia.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wikipedia.py b/wikipedia.py index 663d3885eb..22ed4e3e1b 100644 --- a/wikipedia.py +++ b/wikipedia.py @@ -34,7 +34,7 @@ def mw_search(server, query, num): search_url = ('http://%s/w/api.php?format=json&action=query' '&list=search&srlimit=%d&srprop=timestamp&srwhat=text' '&srsearch=') % (server, num) - search_url += query.encode('utf-8') + search_url += query query = json.loads(web.get(search_url)) if 'query' in query: query = query['query']['search'] @@ -50,7 +50,7 @@ def mw_snippet(server, query): snippet_url = ('https://'+server+'/w/api.php?format=json' '&action=query&prop=extracts&exintro&explaintext' '&exchars=300&redirects&titles=') - snippet_url += query.encode('utf-8') + snippet_url += query snippet = json.loads(web.get(snippet_url)) snippet = snippet['query']['pages']