Skip to content

Instantly share code, notes, and snippets.

@gcmurphy
Created October 31, 2016 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcmurphy/742027539e4708dff8268ac1ea0601a3 to your computer and use it in GitHub Desktop.
Save gcmurphy/742027539e4708dff8268ac1ea0601a3 to your computer and use it in GitHub Desktop.
Stack trace when listing repositories. Reproducer below.
import github3
from os import environ as env
client = github3.GitHubEnterprise(env['GH_ENDPOINT'], token=env['GH_TOKEN'])
for repository in client.iter_all_repos():
if repository:
print("{}/{}".format(repository.owner, repository.name))
Traceback (most recent call last):
File "scripts/repository_list.py", line 24, in <module>
main()
File "scripts/repository_list.py", line 18, in main
for repository in client.iter_all_repos():
File "/Users/gm/.pyenv/versions/venv/lib/python2.7/site-packages/github3/structs.py", line 84, in __iter__
yield cls(i, self) if issubclass(cls, GitHubCore) else cls(i)
File "/Users/gm/.pyenv/versions/venv/lib/python2.7/site-packages/github3/repos/repo.py", line 121, in __init__
self.owner = User(repo.get('owner', {}), self._session)
File "/Users/gm/.pyenv/versions/venv/lib/python2.7/site-packages/github3/users.py", line 123, in __init__
super(User, self).__init__(user, session)
File "/Users/gm/.pyenv/versions/venv/lib/python2.7/site-packages/github3/models.py", line 314, in __init__
if acct.get('type'):
AttributeError: 'NoneType' object has no attribute 'get'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment