{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/805","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/805/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/805/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/805","id":58068096,"number":805,"title":"uri.py : Traceback when there is a special character in the JSON return","user":{"login":"francoisfanuel","id":10754728,"avatar_url":"https://avatars.githubusercontent.com/u/10754728?v=3","gravatar_id":"","url":"https://api.github.com/users/francoisfanuel","html_url":"https://github.com/francoisfanuel","followers_url":"https://api.github.com/users/francoisfanuel/followers","following_url":"https://api.github.com/users/francoisfanuel/following{/other_user}","gists_url":"https://api.github.com/users/francoisfanuel/gists{/gist_id}","starred_url":"https://api.github.com/users/francoisfanuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francoisfanuel/subscriptions","organizations_url":"https://api.github.com/users/francoisfanuel/orgs","repos_url":"https://api.github.com/users/francoisfanuel/repos","events_url":"https://api.github.com/users/francoisfanuel/events{/privacy}","received_events_url":"https://api.github.com/users/francoisfanuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-18T13:34:49Z","updated_at":"2015-02-18T13:34:49Z","closed_at":null,"body":"##### Issue Type:\r\nBug report\r\n\r\n##### Ansible Version:\r\nansible 1.8.2\r\n\r\n##### Environment:\r\nMacOS X 10.10.2\r\n\r\n##### Summary:\r\nUsing uri module, when the return of a webservice call is a JSON with a special character in it, it fails with this error message : \"ValueError: Invalid control character at: line 1 column x (char x-1)\"\r\n\r\nExample when the return is : \r\n{\"jsonrpc\": \"2.0\", \"result\": [{\"messages\": [\"verify /sha512 (flash:test) = abe28fc99538f10f44df793ddd272ddd5484a07a8d4b9988305c68cfb4ecad76579271f5bbaaea2b7458cd7b407615e38e2ac6940fb8d760f02729548eb44695\\n\"]}], \"id\": \"toto\"}\r\n\r\nThe playbooks fails with this error : \r\nTraceback (most recent call last):\r\n  File \"/Users/francoisfanuel/.ansible/tmp/ansible-tmp-1424265104.5-7980688633469/uri\", line 2011, in <module>\r\n    main()\r\n  File \"/Users/francoisfanuel/.ansible/tmp/ansible-tmp-1424265104.5-7980688633469/uri\", line 432, in main\r\n    js = json.loads(content)\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py\", line 338, in loads\r\n    return _default_decoder.decode(s)\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\", line 365, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\", line 381, in raw_decode\r\n    obj, end = self.scan_once(s, idx)\r\nValueError: Invalid control character at: line 1 column 204 (char 203)\r\n\r\n##### Fix:\r\nIn uri.py, change the call to json.loads to:\r\n                js = json.loads(content,strict=False)\r\n\r\nOn line 432.\r\n"}}