{"action":"created","issue":{"url":"https://api.github.com/repos/requests/requests/issues/4908","repository_url":"https://api.github.com/repos/requests/requests","labels_url":"https://api.github.com/repos/requests/requests/issues/4908/labels{/name}","comments_url":"https://api.github.com/repos/requests/requests/issues/4908/comments","events_url":"https://api.github.com/repos/requests/requests/issues/4908/events","html_url":"https://github.com/requests/requests/issues/4908","id":390582776,"node_id":"MDU6SXNzdWUzOTA1ODI3NzY=","number":4908,"title":"From `Expecting value: line 1 column 1 (char 0)` to `Response content not in json format`","user":{"login":"SebastianoF","id":8709755,"node_id":"MDQ6VXNlcjg3MDk3NTU=","avatar_url":"https://avatars1.githubusercontent.com/u/8709755?v=4","gravatar_id":"","url":"https://api.github.com/users/SebastianoF","html_url":"https://github.com/SebastianoF","followers_url":"https://api.github.com/users/SebastianoF/followers","following_url":"https://api.github.com/users/SebastianoF/following{/other_user}","gists_url":"https://api.github.com/users/SebastianoF/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianoF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianoF/subscriptions","organizations_url":"https://api.github.com/users/SebastianoF/orgs","repos_url":"https://api.github.com/users/SebastianoF/repos","events_url":"https://api.github.com/users/SebastianoF/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianoF/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-13T09:12:07Z","updated_at":"2018-12-13T14:05:27Z","closed_at":"2018-12-13T14:05:27Z","author_association":"NONE","body":"Hi!\r\nPlease run \r\n```\r\nimport requests\r\n\r\nr = requests.get('http://httpbin.org/status/200')\r\nr.status_code\r\nr.json()\r\n```\r\nThe answer is:\r\n```\r\n200\r\nJSONDecodeError:  Expecting value: line 1 column 1 (char 0)\r\n```\r\nI do not think it is informative and maybe it could contain something like:\r\n`Json: Response content is not in the json format`\r\n\r\nDo you think it is a good idea to wrap line 892 of requests/models.py into something like:\r\n\r\n```\r\ntry: \r\n    return complexjson.loads(self.text, **kwargs)  # current line 892\r\nexcept JSONDecodeError:\r\n    print('Response content is not in the json format')\r\n```\r\n?\r\n\r\n## System Information\r\n```\r\n(py3)  ~/ $ python -m requests.help\r\n{\r\n  \"chardet\": {\r\n    \"version\": \"3.0.4\"\r\n  },\r\n  \"cryptography\": {\r\n    \"version\": \"\"\r\n  },\r\n  \"idna\": {\r\n    \"version\": \"2.6\"\r\n  },\r\n  \"implementation\": {\r\n    \"name\": \"CPython\",\r\n    \"version\": \"3.6.6\"\r\n  },\r\n  \"platform\": {\r\n    \"release\": \"4.15.0-39-generic\",\r\n    \"system\": \"Linux\"\r\n  },\r\n  \"pyOpenSSL\": {\r\n    \"openssl_version\": \"\",\r\n    \"version\": null\r\n  },\r\n  \"requests\": {\r\n    \"version\": \"2.18.4\"\r\n  },\r\n  \"system_ssl\": {\r\n    \"version\": \"1010007f\"\r\n  },\r\n  \"urllib3\": {\r\n    \"version\": \"1.22\"\r\n  },\r\n  \"using_pyopenssl\": false\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/requests/requests/issues/comments/446979583","html_url":"https://github.com/requests/requests/issues/4908#issuecomment-446979583","issue_url":"https://api.github.com/repos/requests/requests/issues/4908","id":446979583,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njk3OTU4Mw==","user":{"login":"sigmavirus24","id":240830,"node_id":"MDQ6VXNlcjI0MDgzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/240830?v=4","gravatar_id":"","url":"https://api.github.com/users/sigmavirus24","html_url":"https://github.com/sigmavirus24","followers_url":"https://api.github.com/users/sigmavirus24/followers","following_url":"https://api.github.com/users/sigmavirus24/following{/other_user}","gists_url":"https://api.github.com/users/sigmavirus24/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmavirus24/subscriptions","organizations_url":"https://api.github.com/users/sigmavirus24/orgs","repos_url":"https://api.github.com/users/sigmavirus24/repos","events_url":"https://api.github.com/users/sigmavirus24/events{/privacy}","received_events_url":"https://api.github.com/users/sigmavirus24/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T14:05:27Z","updated_at":"2018-12-13T14:05:27Z","author_association":"MEMBER","body":"If you inspect the response headers, it's not returning JSON so you shouldn't be unconditionally calling `.json()` on the response."}}
{"actor":{"display_login":"sigmavirus24"}}