PyGithub / PyGithub/PyGithub

Demo example fails

Open
#2,220 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.8k
Forks
1.9k
Avg merge
17m
Merged PRs (30d)
2

Description

Following fails:

from github import Github

# Github Enterprise with custom hostname
g = Github(
    base_url="https://github.boschdevcloud.com/api/v3",
    login_or_token="MY_TOKEN",
)

u = g.get_user()
print(u)  # AuthenticatedUser(login=None)

for repo in u.get_repos():  # socket.gaierror: [Errno 8] nodename nor servname provided, or not known
    print(repo.name)

I'm not understanding why this fails; but even if I'm doing something wrong error message could be improved.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Python example using Github, get_user(), and get_repos(), then trace the socket.gaierror raised with the custom GitHub Enterprise base_url. Determine whether the example uses the URL correctly or whether the failure needs a clearer error message; the issue is complete when the cause and expected behavior are clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.