2

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:

using username and password

g = Github("user", "password")

or using an access token

g = Github("access_token")

Github Enterprise with custom hostname

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'}

G J
  • 33
  • 6

2 Answers2

1

resolved i was not putting api/v3 at the end of my url

G J
  • 33
  • 6
0

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.

lxRbckl
  • 1
  • 1