urlencode requires a tuple and not an iterable.

This commit is contained in:
Jason R. Coombs 2016-09-03 12:06:12 -04:00
parent 029a0c4288
commit b69b312692

View File

@ -46,7 +46,7 @@ class Client(object):
) )
data = itertools.chain(params, data.items(), kwargs.items()) data = itertools.chain(params, data.items(), kwargs.items())
query = urllib.parse.urlencode(data) query = urllib.parse.urlencode(tuple(data))
url = 'https://api.wolframalpha.com/v2/query?' + query url = 'https://api.wolframalpha.com/v2/query?' + query
resp = urllib.request.urlopen(url) resp = urllib.request.urlopen(url)
assert resp.headers.get_content_type() == 'text/xml' assert resp.headers.get_content_type() == 'text/xml'