From ebfc43138f7bcd215ec2d1f699627fb93968123e Mon Sep 17 00:00:00 2001 From: Jon Shao Date: Sun, 9 Feb 2014 22:59:38 -0500 Subject: [PATCH] Fixed: Decoding XML breaks ElementTree See http://stackoverflow.com/questions/12349728/elementtree-and-unicode --- flask_oauth.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/flask_oauth.py b/flask_oauth.py index b21105a..f5fa536 100644 --- a/flask_oauth.py +++ b/flask_oauth.py @@ -40,12 +40,7 @@ def parse_response(resp, content, strict=False): if ct in ('application/json', 'text/javascript'): return json.loads(content) elif ct in ('application/xml', 'text/xml'): - # technically, text/xml is ascii based but because many - # implementations get that wrong and utf-8 is a superset - # of utf-8 anyways, so there is not much harm in assuming - # utf-8 here - charset = options.get('charset', 'utf-8') - return get_etree().fromstring(content.decode(charset)) + return get_etree().fromstring(content) elif ct != 'application/x-www-form-urlencoded': if strict: return content