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

AttributeError: 'NoneType' object has no attribute 'startswith' from get_user with 403 response #2158

Open
mriedem opened this issue Jan 13, 2022 · 4 comments

Comments

@mriedem
Copy link

mriedem commented Jan 13, 2022

Looks like the same root issue as #1399 but that was closed and I can't re-open it (not sure why it was closed).

This is with pygithub 1.55:

  File "/home/travis/virtualenv/python3.8.1/lib/python3.8/site-packages/github/MainClass.py", line 256, in get_user
    headers, data = self.__requester.requestJsonAndCheck(
  File "/home/travis/virtualenv/python3.8.1/lib/python3.8/site-packages/github/Requester.py", line 353, in requestJsonAndCheck
    return self.__check(
  File "/home/travis/virtualenv/python3.8.1/lib/python3.8/site-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
  File "/home/travis/virtualenv/python3.8.1/lib/python3.8/site-packages/github/Requester.py", line 418, in __createException
    elif status == 403 and output.get("message").startswith(
AttributeError: 'NoneType' object has no attribute 'startswith'
@EnricoMi
Copy link
Collaborator

@mriedem I have sketched out a fix for this and more possible situations where __createException may fail. Adds tests.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@mriedem
Copy link
Author

mriedem commented Mar 1, 2023

Still hitting this with 1.58.

@EnricoMi EnricoMi reopened this Mar 1, 2023
@stale stale bot removed the stale label Mar 1, 2023
@suncle1993
Copy link

hitting this with 1.54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants