Pygithub: Unable to create issue using oAuth token

Created on 23 Jan 2013  ·  3Comments  ·  Source: PyGithub/PyGithub

Hi,

I am trying to create an issue using library. But always get GithubException: 404 {u'message': u'Not Found'} error message . Please help

my code looks as fellow. let me know if i am doing something wrong

repo_service = Github('Token')
repo_service.get_repo('Repo Name').create_issue('test', 'TestSam', assignee=None, milestone=None, labels = None)

question

Most helpful comment

For anybody finding this in future: I was attempting the same, also with a Github Personal Token, but the token didn't have sufficient priviledges, and the Github API returns 404 then.

Adding public_repo rights to the token solved the problem, and I was then able to create new issues programatically.

airjp818

All 3 comments

It would be easier with a stack trace of the exception :-) With the information you gave, I can't know which part fails.

I assume you have the same exception with just

g = Github('Token')
g.get_repo('Repo Name')

because you don't use the full name of the repo.

Here is an example of how to create an issue on jacquev6/PyGithub:

g = Github(token)
repo = g.get_user("jacquev6").get_repo("PyGithub")  # or repo = g.get_repo("jacquev6/PyGithub")
issue = repo.create_issue("Issue title")

I hope it helps, do not hesitate to tell me if you still have problems.

(Pdb) Traceback (most recent call last):
File "/Users/app/views.py", line 162, in github
issue1 = repo.create_issue("Issue title", "issue body")
File "/Library/Python/2.7/site-packages/github/Repository.py", line 375, in create_issue
post_parameters
File "/Library/Python/2.7/site-packages/github/Requester.py", line 80, in requestAndCheck
raise GithubException.GithubException(status, output)
GithubException: 404 {u'message': u'Not Found'}

Hope this helps. Let me know how can i get additional info

For anybody finding this in future: I was attempting the same, also with a Github Personal Token, but the token didn't have sufficient priviledges, and the Github API returns 404 then.

Adding public_repo rights to the token solved the problem, and I was then able to create new issues programatically.

airjp818

Was this page helpful?
0 / 5 - 0 ratings