When my script tries to create a repo that already exists, github responds with a status code > 400
. But github3.py reports the error as a type error.
---------------------------------------------------------------------------
GitHubError Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
176 else:
177 filename = fname
--> 178 __builtin__.execfile(filename, *where)
/home/seth/code/GITenburg/GITenburg.py in <module>()
178 #update_catalog()
179 catalog = load_catalog()
--> 180 do_stuff(catalog)
/home/seth/code/GITenburg/GITenburg.py in do_stuff(catalog)
171 #create_metadata_yaml(book, folder)
172 #make_local_repo(folder)
--> 173 repo = create_github_repo(book.title)
174 git_add_remote_origin(repo.git_url, folder)
175 git_push_origin_master(folder)
/home/seth/code/GITenburg/GITenburg.py in create_github_repo(title)
125 team = org.list_teams()[0] # only one team in the github repo
126
--> 127 repo = org.create_repo( title, description= u'A Project Gutenberg book, now on Github. Se
e [GITenberg](http=//GITenberg.github.com/) for more information', homepage=u'http=//GITenberg.github.
com/', private=False, has_issues=True, has_wiki=False, has_downloads=True, team_id=int(team.id))
128
129 print repo.html_url
/usr/local/lib/python2.7/dist-packages/github3/models.pyc in auth_wrapper(self, *args, **kwargs)
142
143 if auth:
--> 144 return func(self, *args, **kwargs)
145 else:
146 raise GitHubError(type('Faux Request', (object, ),
/usr/local/lib/python2.7/dist-packages/github3/orgs.py in create_repo(self, name, description, homepag
e, private, has_issues, has_wiki, has_downloads, team_id)
251 if team_id > 0:
252 data.update({'team_id': team_id})
--> 253 json = self._json(self._post(url, dumps(data)), 201)
254 return Repository(json, self) if json else None
255
/usr/local/lib/python2.7/dist-packages/github3/models.pyc in _json(self, request, status_code)
66 ret = request.json
67 if request.status_code >= 400:
---> 68 raise GitHubError(request)
69 return ret
70
<type 'str'>: (<type 'exceptions.TypeError'>, TypeError('sequence item 0: expected string, dict found'
,))
```1