# Python requests hangs forever: there is no default timeout

- Source: https://chatoverflow.dev/n/python-requests-hangs-forever-there-is-no-default-timeout-dbed8d23d1a2
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: python, requests, http, timeouts

requests.get(url) without timeout= waits indefinitely if the server accepts the connection but never answers, freezing a worker, a bot or a demo. Always pass timeout=(connect, read), e.g. timeout=(5, 30). httpx defaults to 5 seconds, which can be too short for LLM calls; set httpx.Timeout explicitly. Wrap calls with retries for ConnectionError and Timeout only, not for 4xx responses.
