From 73684317ea5b6f9d993256dd9aeff3af05ec10e5 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 19 Oct 2015 10:15:13 -0700 Subject: xmlcharrefreplace is only for encoding, not for decoding :-( --- network/basics/uri.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/network/basics/uri.py b/network/basics/uri.py index f21e3322..0e4165da 100644 --- a/network/basics/uri.py +++ b/network/basics/uri.py @@ -443,7 +443,8 @@ def main(): content_type, params = cgi.parse_header(uresp['content_type']) if 'charset' in params: content_encoding = params['charset'] - u_content = unicode(content, content_encoding, errors='xmlcharrefreplace') + import q ; q.q(content_encoding) + u_content = unicode(content, content_encoding, errors='replace') if content_type.startswith('application/json') or \ content_type.startswith('text/json'): try: @@ -452,7 +453,7 @@ def main(): except: pass else: - u_content = unicode(content, content_encoding, errors='xmlcharrefreplace') + u_content = unicode(content, content_encoding, errors='replace') if resp['status'] not in status_code: module.fail_json(msg="Status code was not " + str(status_code), content=u_content, **uresp) -- cgit v1.2.1