Skip to content

Exception upon 429 response code #195

Description

@oripka

The variable retry_after is not converted into a number before passing it into the sleep() function. This causes an error when a 429 response code with the retry-after header is received. time.sleep(int(retry_after)) might be enough to deal with this.

[/usr/local/lib/python3.7/dist-packages/wikidataintegrator/wdi_core.py](https://localhost:8080/#) in execute_sparql_query(query, prefix, endpoint, user_agent, as_dataframe, max_retries, retry_after)
    131                     retry_after = response.headers["retry-after"]
    132                 print("service unavailable. sleeping for {} seconds".format(retry_after))
--> 133                 time.sleep(retry_after)
    134                 continue
    135             response.raise_for_status()

TypeError: an integer is required (got type str)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions