django-planet
June 22, 2022

How to Patch Requests to Have a Default Timeout

published by Adam Johnson
in blog Adam Johnson
original entry How to Patch Requests to Have a Default Timeout

Python’s requests package is very popular. Even if you don’t use it directly, it’s highly likely one of your dependencies does.

One wrinkle in requests’ design is that it has no default timeout. This means that requests can hang forever if the remote server doesn’t respond …