Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'NoneType' object is not subscriptable #988

Open
sophiamyang opened this issue Mar 17, 2020 · 2 comments · May be fixed by #1161
Open

TypeError: 'NoneType' object is not subscriptable #988

sophiamyang opened this issue Mar 17, 2020 · 2 comments · May be fixed by #1161
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sophiamyang
Copy link

sophiamyang commented Mar 17, 2020

Version Information

Please provide:

  • The version of Python you're using
    Python 3.7.3

  • The version of pip you used to install github3.py
    conda 4.8.2. I used conda-forge to install github3.py

  • The version of github3.py, requests, uritemplate, and dateutil installed
    github3.py 1.3.0 py_0 conda-forge
    requests 2.22.0 py37_1
    uritemplate.py 3.0.2 py_1 conda-forge
    didn't install dateutil

Minimum Reproducible Example

Please provide an example of the code that generates the error you're seeing.

repo = gh.repository('pytoolz', 'toolz') 
events = repo.issue_events() 
events = list(events)

I am trying to get all issue events for a repo. But I got TypeError, I think it's because some json records don't have all the fields. In this case, it doesn’t have user[‘avatar_url’].
image
image (1)

@omgjlk
Copy link
Collaborator

omgjlk commented Aug 12, 2020

Yeah that looks like a valid thing. It's been a while since I dug into this part of the code, but I'm guessing a get() call is needed, or some validation that the user object here is a real user object.

@omgjlk omgjlk added Bug help wanted Extra attention is needed labels Aug 12, 2020
@sigmavirus24
Copy link
Owner

a real user object

Or it'd be great if GitHub's docs were up-to-date here. That said, I think the problem is that events might not have an actor and this was a problem when events didn't have a user or something before. Support had indicated this could be reliably accessed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants