Reputation: 33
I am new to using pyGithub and I want to do some updates to issues in an enterprise repository using a python script. I am struggling to get it to connect. I have used similar to this:g=Github(base_url="https://sctigerteam.github.com/api/v3",login_or_token=
tried these 3 ways:
g = Github("user", "password")
g = Github("access_token")
g = Github(base_url="https://{hostname}/api/v3", login_or_token="access_token")
and none work even though i put in the correct uid/password or access token
g=Github(base_url="https://orgname.github.com/api/v3",login_or_token=""xxxxxxxx" repo = g.get_repo("urlfortherepo")
I get this error and I give it the correct access token because I copy it straight for github. also I do not think I understand the base_url requirements:
raise self.__createException(status, responseHeaders, output)
github.GithubException.BadCredentialsException: 401 {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}
Upvotes: 2
Views: 2205
Reputation: 1
I ran into a similar issue, but instead it was because I had published the token I was using to GitHub, and so GitHub disabled my token.
Creating a new one fixed this issue.
Upvotes: 0