{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/web3.py/issues/862","repository_url":"https://api.github.com/repos/ethereum/web3.py","labels_url":"https://api.github.com/repos/ethereum/web3.py/issues/862/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/web3.py/issues/862/comments","events_url":"https://api.github.com/repos/ethereum/web3.py/issues/862/events","html_url":"https://github.com/ethereum/web3.py/issues/862","id":325786449,"number":862,"title":"ValueError when using IPCProvider","user":{"login":"medvedev1088","id":930603,"avatar_url":"https://avatars2.githubusercontent.com/u/930603?v=4","gravatar_id":"","url":"https://api.github.com/users/medvedev1088","html_url":"https://github.com/medvedev1088","followers_url":"https://api.github.com/users/medvedev1088/followers","following_url":"https://api.github.com/users/medvedev1088/following{/other_user}","gists_url":"https://api.github.com/users/medvedev1088/gists{/gist_id}","starred_url":"https://api.github.com/users/medvedev1088/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medvedev1088/subscriptions","organizations_url":"https://api.github.com/users/medvedev1088/orgs","repos_url":"https://api.github.com/users/medvedev1088/repos","events_url":"https://api.github.com/users/medvedev1088/events{/privacy}","received_events_url":"https://api.github.com/users/medvedev1088/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-23T16:37:43Z","updated_at":"2018-05-24T08:11:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"* Version: 4.2.1\r\n* Python: 2.7/3.4/3.5\r\n* OS: osx/linux/win\r\n\r\n\r\n### What was wrong?\r\n\r\nWhen using IPCProvider sometimes ValueError is encountered if the response is incomplete. Looks like in this pull request https://github.com/ethereum/web3.py/pull/785/files the author forgot to add `except ValueError` to IPCProvider  https://github.com/ethereum/web3.py/blob/master/web3/providers/ipc.py#L176\r\n\r\n### How can it be fixed?\r\n\r\nAdd `except ValueError` to IPCProvider.make_request https://github.com/ethereum/web3.py/blob/master/web3/providers/ipc.py#L176\r\n"},"comment":{"url":"https://api.github.com/repos/ethereum/web3.py/issues/comments/391627977","html_url":"https://github.com/ethereum/web3.py/issues/862#issuecomment-391627977","issue_url":"https://api.github.com/repos/ethereum/web3.py/issues/862","id":391627977,"user":{"login":"boneyard93501","id":4523011,"avatar_url":"https://avatars1.githubusercontent.com/u/4523011?v=4","gravatar_id":"","url":"https://api.github.com/users/boneyard93501","html_url":"https://github.com/boneyard93501","followers_url":"https://api.github.com/users/boneyard93501/followers","following_url":"https://api.github.com/users/boneyard93501/following{/other_user}","gists_url":"https://api.github.com/users/boneyard93501/gists{/gist_id}","starred_url":"https://api.github.com/users/boneyard93501/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boneyard93501/subscriptions","organizations_url":"https://api.github.com/users/boneyard93501/orgs","repos_url":"https://api.github.com/users/boneyard93501/repos","events_url":"https://api.github.com/users/boneyard93501/events{/privacy}","received_events_url":"https://api.github.com/users/boneyard93501/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T08:11:20Z","updated_at":"2018-05-24T08:11:20Z","author_association":"CONTRIBUTOR","body":"i'm having a bit of trouble reproducing the issue.\r\nfor, say,\r\n```bash\r\ncurl -X POST -H \"Content-Type: application/json\" --data '{\"jsonrpc\":\"2.0\",\"method\":\"net_listening\",\"params\":[],\"id\":67}'\r\n```\r\na complete result would be `{\"jsonrpc\":\"2.0\",\"result\":true,\"id\":67}` and an incomplete result would be`{\"result\":true,\"id\":67}` assuming an incomplete response is one where one or more of the json-rpc required key-value pairs is missing.\r\n``` python\r\n>>> web3.__version__\r\n'4.2.1'\r\n>>> incomplete_res = b'{result\":true,\"id\":67}'\r\n>>> # passes the has_valid_json_rpc_ending check and\r\n>>> IPCProvider().decode_rpc_response(incomplete_response)\r\n{'result': True, 'id': 67}\r\n```\r\nwhich checks out. if instead we're looking at a structurally invalid json response other than invalid rpc endings:\r\n``` python\r\n>>> web3.__version__\r\n'4.2.1'\r\n>>> invalid_response = b'{\"result\":true,\"id\"}'\r\n>>> IPCProvider().decode_rpc_response(invalid_response)\r\nTraceback (most recent call last):\r\n  File \"/Users/93501/localDev/source-code/forks/web3.py/web3/utils/encoding.py\", line 254, in json_decode\r\n    decoded = json.loads(json_str)\r\n  File \"/Users/93501/.pyenv/versions/3.6.4/lib/python3.6/json/__init__.py\", line 354, in loads\r\n    return _default_decoder.decode(s)\r\n  File \"/Users/93501/.pyenv/versions/3.6.4/lib/python3.6/json/decoder.py\", line 339, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File \"/Users/93501/.pyenv/versions/3.6.4/lib/python3.6/json/decoder.py\", line 355, in raw_decode\r\n    obj, end = self.scan_once(s, idx)\r\njson.decoder.JSONDecodeError: Expecting ':' delimiter: line 1 column 20 (char 19)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/Users/93501/localDev/source-code/forks/web3.py/web3/providers/base.py\", line 63, in decode_rpc_response\r\n    return FriendlyJsonSerde().json_decode(text_response)\r\n  File \"/Users/93501/localDev/source-code/forks/web3.py/web3/utils/encoding.py\", line 258, in json_decode\r\n    raise ValueError(err_msg)\r\nValueError: Could not decode '{\"result\":true,\"id\"}' because of Expecting ':' delimiter: line 1 column 20 (char 19).\r\n>>>\r\n```\r\n\r\nis raising the stacked Exception the issue?\r\n "}}
{"actor":{"display_login":"boneyard93501"}}