Skip to content

TypeError: 'NoneType' object is not subscriptable #988

Open
@sophiamyang

Description

@sophiamyang

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions