8000 pipchecker - Detection of Github rate limit broken · Issue #1183 · django-extensions/django-extensions · GitHub
[go: up one dir, main page]

Skip to content
pipchecker - Detection of Github rate limit broken #1183
Closed
@WolfgangFellger

Description

@WolfgangFellger

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0