{"action":"opened","issue":{"url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/522","labels_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/522/labels{/name}","comments_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/522/comments","events_url":"https://api.github.com/repos/sigmavirus24/github3.py/issues/522/events","html_url":"https://github.com/sigmavirus24/github3.py/issues/522","id":123926208,"number":522,"title":"'422 base_tree is not a valid tree oid' when creating a tree","user":{"login":"npcode","id":1129852,"avatar_url":"https://avatars.githubusercontent.com/u/1129852?v=3","gravatar_id":"","url":"https://api.github.com/users/npcode","html_url":"https://github.com/npcode","followers_url":"https://api.github.com/users/npcode/followers","following_url":"https://api.github.com/users/npcode/following{/other_user}","gists_url":"https://api.github.com/users/npcode/gists{/gist_id}","starred_url":"https://api.github.com/users/npcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npcode/subscriptions","organizations_url":"https://api.github.com/users/npcode/orgs","repos_url":"https://api.github.com/users/npcode/repos","events_url":"https://api.github.com/users/npcode/events{/privacy}","received_events_url":"https://api.github.com/users/npcode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-26T11:55:42Z","updated_at":"2015-12-26T11:55:42Z","closed_at":null,"body":"\"422 base_tree is not a valid tree oid\" error occurs when creating a tree without base_tree. I think it should work because [the document](http://github3py.readthedocs.org/en/latest/repos.html) says `base_tree` is optional.\r\n\r\nHere is what I did:\r\n\r\n```\r\n>>> from github3 import login\r\n>>> g = login('npcode', '***')\r\n>>> repo = g.repository('npcode', 'trend')\r\n>>> sha = repo.create_blob('hello', 'utf-8')\r\n>>> blob = repo.blob(sha)\r\n>>> tree = [{'path': 'test.txt', 'mode': '100644', 'type': 'blob', 'sha': sha}]\r\n>>> repo.create_tree(tree)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/lib/python3.5/site-packages/github3/decorators.py\", line 38, in auth_wrapper\r\n    return func(self, *args, **kwargs)\r\n  File \"/usr/lib/python3.5/site-packages/github3/repos/repo.py\", line 852, in create_tree\r\n    json = self._json(self._post(url, data=data), 201)\r\n  File \"/usr/lib/python3.5/site-packages/github3/models.py\", line 100, in _json\r\n    if self._boolean(response, status_code, 404) and response.content:\r\n  File \"/usr/lib/python3.5/site-packages/github3/models.py\", line 121, in _boolean\r\n    raise GitHubError(response)\r\ngithub3.models.GitHubError: 422 base_tree is not a valid tree oid\r\n```"}}