From 95c3e37fef9217d95d6c213aea38bd8ccac64ae6 Mon Sep 17 00:00:00 2001 From: Elad Alfassa Date: Sat, 1 Mar 2014 21:59:15 +0200 Subject: [PATCH] [web,movie] Unicode and Python3 fixes web.py now makes sure to quote url parameters before passing them to urllib. This commit also fixes movie.py to properly handle unicode, fixes web.quote to properly handle unicode and python3 andfixes web.urlencode for python3. Thanks to Erethon on freenode for showing me the url issue. --- movie.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/movie.py b/movie.py index 76f03a56fd..5e098a6265 100644 --- a/movie.py +++ b/movie.py @@ -22,9 +22,8 @@ def movie(bot, trigger): word = trigger.group(2).rstrip() word = word.replace(" ", "+") uri = "http://www.imdbapi.com/?t=" + word - u = web.get_urllib_object(uri, 30) - data = json.load(u) # data is a Dict containing all the information we need - u.close() + u = web.get(uri, 30) + data = json.loads(u.decode()) # data is a Dict containing all the information we need if data['Response'] == 'False': if 'Error' in data: message = '[MOVIE] %s' % data['Error']