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

1
  • resolved i was not putting api/v3 at the end of my url Commented Aug 29, 2019 at 16:58

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.