python-github3 icon indicating copy to clipboard operation
python-github3 copied to clipboard

Adding a collaborator to a repo returns pygithub3.exceptions.BadRequest: 400 - Problems parsing JSON

Open hhebbo opened this issue 8 years ago • 0 comments

I'm trying to add a collaborator to a repo with:

gh.repos.collaborators.add("collaborator-name", "name", "repo")

but I'm getting:

pygithub3.exceptions.BadRequest: 400 - Problems parsing JSON

Here is the full stack:

Traceback (most recent call last):
  File "./test.py", line 8, in <module>
    collaborators = gh.repos.collaborators.add("collaborator-name", "name", "repo")
  File "/Library/Python/2.7/site-packages/pygithub3/services/repos/collaborators.py", line 40, in add
    return self._put(request)
  File "/Library/Python/2.7/site-packages/pygithub3/services/base.py", line 129, in _put
    response = self._client.put(request, data=input_data, **kwargs)
  File "/Library/Python/2.7/site-packages/pygithub3/core/client.py", line 100, in put
    response = self.request('put', request, **kwargs)
  File "/Library/Python/2.7/site-packages/pygithub3/core/client.py", line 71, in wrapper
    return func(self, verb, request, **kwargs)
  File "/Library/Python/2.7/site-packages/pygithub3/core/client.py", line 81, in request
    GithubError(response).process()
  File "/Library/Python/2.7/site-packages/pygithub3/core/errors.py", line 35, in process
    raise raise_error()
  File "/Library/Python/2.7/site-packages/pygithub3/core/errors.py", line 23, in error_400
    raise BadRequest("400 - %s" % self.debug.get('message'))
pygithub3.exceptions.BadRequest: 400 - Problems parsing JSON

I tried deleting and listing, they both work fine, but adding doesn't work. Could you please advice? Thanks.

hhebbo avatar Aug 15 '17 14:08 hhebbo