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']