You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this documentation describing timeout configuration, at the end of the section, it states: All fields are floats, None or 0 disables a particular timeout check, see the ClientTimeout reference for defaults and additional details.
After some testing, this holds true if fields are None. However, it doesn't if these fields are set to 0. Setting these fields to 0 results in a timeout upon request. The doc should be updated to reflect this.
To Reproduce
Make a request to some URL with the following timeout object:
aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host [URL]....
Logs/tracebacks
Traceback (most recent call last):
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
conn =awaitself._connector.connect(
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/connector.py", line 535, in connect
proto =awaitself._create_connection(req, traces, timeout)
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto =awaitself._create_direct_connection(req, traces, timeout)
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/connector.py", line 999, in _create_direct_connection
hosts =await asyncio.shield(host_resolved)
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
conn =awaitself._connector.connect(
File "/home/andreas/.local/lib/python3.8/site-packages/async_timeout/__init__.py", line 45, in __exit__self._do_exit(exc_type)
File "/home/andreas/.local/lib/python3.8/site-packages/async_timeout/__init__.py", line 92, in _do_exitraise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "hit_bdProfile.py", line 43, in <module>
loop.run_until_complete(coroutine)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_completereturn future.result()
File "hit_bdProfile.py", line 29, in make_requestasyncwith session.request(
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/client.py", line 1117, in __aenter__self._resp =awaitself._coro
File "/home/andreas/.local/lib/python3.8/site-packages/aiohttp/client.py", line 524, in _requestraise ServerTimeoutError(
aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host [URL]...
Describe the bug
In this documentation describing timeout configuration, at the end of the section, it states:
All fields are floats, None or 0 disables a particular timeout check, see the ClientTimeout reference for defaults and additional details.
After some testing, this holds true if fields are
None
. However, it doesn't if these fields are set to 0. Setting these fields to 0 results in a timeout upon request. The doc should be updated to reflect this.To Reproduce
Make a request to some URL with the following timeout object:
timeout = aiohttp.ClientTimeout( total=0, sock_connect=0, connect=0, sock_read=0 )
Expected behavior
aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host [URL]....
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Windows 10, running through WSL1
Related component
Client
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: