From dab50d5cfc8655b1d9222e1f7fd326618424e984 Mon Sep 17 00:00:00 2001 From: Elad Alfassa Date: Sat, 3 May 2014 16:39:08 +0300 Subject: [PATCH] [currency] Use dont_decode with web.get() Python's xml library doesn't like unicode strings --- currency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/currency.py b/currency.py index bdd456e5b1..ed41e1d1d8 100644 --- a/currency.py +++ b/currency.py @@ -33,7 +33,7 @@ def get_rate(code): rates = json.loads(web.get('https://api.bitcoinaverage.com/ticker/all')) return 1 / rates['CAD']['24h_avg'], 'Bitcoin—24hr average' - data = web.get(base_url.format(code)) + data = web.get(base_url.format(code), dont_decode=True) xml = etree.fromstring(data) namestring = xml.find('{http://purl.org/rss/1.0/}channel/' '{http://purl.org/rss/1.0/}title').text