Closed
Description
I was randomly getting either:
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 102, in handle
self.check_github()
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 276, in check_github
elif frozen_commit_data["sha"] in [branch["commit"]["sha"] for branch in branch_data]:
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 276, in <listcomp>
elif frozen_commit_data["sha"] in [branch["commit"]["sha"] for branch in branch_data]:
TypeError: string indices must be integers
or
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 102, in handle
self.check_github()
File "/usr/local/lib/python3.6/site-packages/django_extensions/management/commands/pipchecker.py", line 276, in check_github
elif frozen_commit_data["sha"] in [branch["commit"]["sha"] for branch in branch_data]:
KeyError: 'sha'
when running pipchecker on Travis (something else seems to have broken there, but never mind).
The reason for this cryptic error is that in the guard clause at https://github.com/django-extensions/django-extensions/blob/master/django_extensions/management/commands/pipchecker.py#L250 , it checks message for "API Rate Limit Exceeded"
, but Github now sends the text API rate limit exceeded
(note the lowercase).
Github recommends checking the header X-RateLimit-Remaining
instead.