Skip to content

Commit

Permalink
[currency] Use dont_decode with web.get()
Browse files Browse the repository at this point in the history
Python's xml library doesn't like unicode strings
  • Loading branch information
Elad Alfassa committed May 3, 2014
1 parent 062b712 commit dab50d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dab50d5

Please sign in to comment.