{"action":"created","issue":{"url":"https://api.github.com/repos/PyGithub/PyGithub/issues/599","repository_url":"https://api.github.com/repos/PyGithub/PyGithub","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/599/labels{/name}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/599/comments","events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/599/events","html_url":"https://github.com/PyGithub/PyGithub/pull/599","id":244225635,"node_id":"MDExOlB1bGxSZXF1ZXN0MTMxNDU2MzI1","number":599,"title":"Fix encoded_input null assignment to produce valid json format","user":{"login":"kimphifersc","id":10472621,"node_id":"MDQ6VXNlcjEwNDcyNjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10472621?v=4","gravatar_id":"","url":"https://api.github.com/users/kimphifersc","html_url":"https://github.com/kimphifersc","followers_url":"https://api.github.com/users/kimphifersc/followers","following_url":"https://api.github.com/users/kimphifersc/following{/other_user}","gists_url":"https://api.github.com/users/kimphifersc/gists{/gist_id}","starred_url":"https://api.github.com/users/kimphifersc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimphifersc/subscriptions","organizations_url":"https://api.github.com/users/kimphifersc/orgs","repos_url":"https://api.github.com/users/kimphifersc/repos","events_url":"https://api.github.com/users/kimphifersc/events{/privacy}","received_events_url":"https://api.github.com/users/kimphifersc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-20T02:13:04Z","updated_at":"2018-09-07T17:00:22Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/599","html_url":"https://github.com/PyGithub/PyGithub/pull/599","diff_url":"https://github.com/PyGithub/PyGithub/pull/599.diff","patch_url":"https://github.com/PyGithub/PyGithub/pull/599.patch"},"body":"Would like to set `encoded_input = None` instead of 'null' in `Requestor.py`.  This is more consistent with python NoneType usage, and produces the correct json encoded output for the http request body.  \r\n\r\nThis PR:\r\n- updates the assignment of `encoded_input` to `NoneType`\r\n- updates checks in `Framework.py` to allow for a NoneType input var\r\n- Fixes all tests for this change, largely by updating the data files from null to None, which is commonly used in test asserts.  \r\n\r\n***Additional details on the NoneType fix***\r\nExample output in my application:\r\n```\r\n>>> github_client =  github.Github(login_or_token=pat, base_url=ghe_url)\r\n>>> org = github_client.get_organization(org_name)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"github/MainClass.py\", line 198, in get_organization\r\n    \"/orgs/\" + login\r\n  File \"github/Requester.py\", line 172, in requestJsonAndCheck\r\n    return self.__check(*self.requestJson(verb, url, parameters, headers, input, cnx))\r\n  File \"github/Requester.py\", line 180, in __check\r\n    raise self.__createException(status, responseHeaders, output)\r\ngithub.GithubException.GithubException: 400 {'data': ****retracted****}\r\n```\r\n\r\nThe root cause of my 400 error is somewhat related to a proxy in my enterprise application checking the JSON-encoded form.  The valid json type is null, not 'null'.  \r\n\r\nSince `Requestor.py` actually uses the output of `json.dumps(encoded_input)` the default value should be NoneType, because string 'null' actually produces an extra set of quotes, e.g:\r\n\r\n```\r\n>>> out = json.dumps('null')\r\n>>> print out\r\n\"null\"\r\n>>> print out[0]\r\n\"\r\n>>> out2 = json.dumps(None)\r\n>>> print out2\r\nnull\r\n>>> print out2[0]\r\nn\r\n```"},"comment":{"url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments/419502988","html_url":"https://github.com/PyGithub/PyGithub/pull/599#issuecomment-419502988","issue_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/599","id":419502988,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTUwMjk4OA==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-09-07T17:00:22Z","updated_at":"2018-09-07T17:00:22Z","author_association":"NONE","body":"This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n"}}
{"actor":{"display_login":"stale"}}