Git token access rights

28 Views Asked by At

I am trying to list through git repository with Python, but I have repositories, which I cannot even though I can see this pages via browser. Public and private repositories created by me can be accessed, but repositories assigned by other users/organizations are visible by python, that they exist, but at the moment I am trying to enter them console is saying: github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url":. It means I am missing some rights. Does it exist, that administrator needs to give the rights also to my tokens separately, so I can access the repositories? If so, how to assign the rights? If not, have you ever experienced such bug?

Code is really simple:

from github import Github, Auth

if __name__ == '__main__':
    auth = Auth.Token(GIT_ACCESS_TOKEN)
    g = Github(auth=auth)
    
    tmp = g.get_user().get_repos()
    for f in tmp:  # here I can see the repositories, that they exist
        print(f.name, f.full_name)
    final_repo = g.get_user().get_repo(REPO_NAME) # here I cannot access the specified one from the list
0

There are 0 best solutions below