Commits

Jason R. Coombs  committed 5a2ab0f

Python 3 requires JSON string be unicode

  • Participants
  • Parent commits 4238497
  • Tags 1103.4.5

Comments (0)

Files changed (1)

File pmxbot/commands.py

 	BASE_URL = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&'
 	url = BASE_URL + urllib.urlencode({'q': rest.encode('utf-8').strip()})
 	raw_res = urllib.urlopen(url).read()
-	results = json.loads(raw_res)
+	results = json.loads(raw_res.decode('utf-8'))
 	hit1 = results['responseData']['results'][0]
 	return ' - '.join((
 		urllib.unquote(hit1['url']),