diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-10-19 10:15:13 -0700 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-10-19 10:16:21 -0700 |
commit | 73684317ea5b6f9d993256dd9aeff3af05ec10e5 (patch) | |
tree | faa8c0263432362828b3f85a1a0e3436efaf6281 | |
parent | 133ef8c87c0950f3d83e1494e04b1eafb0c542b0 (diff) | |
download | ansible-modules-core-73684317ea5b6f9d993256dd9aeff3af05ec10e5.tar.gz |
xmlcharrefreplace is only for encoding, not for decoding :-(
-rw-r--r-- | network/basics/uri.py | 5 |
1 files 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) |