This is the key question:
I feel that the far better solution would just be to not have the interpreter throw an error when nothing has gone wrong. Does anyone know a way I could do this? A way to completely suppress the interpreter from considering this error? Or is there a better way than the two I've suggested?
A way to achieve this with aiohttp
and aiofiles
would be to use the timeout
parameter of aiohttp.ClientSession.get
function.
See documentation of the constructor with all parameters:
timeout – a ClientTimeout settings structure, 300 seconds (5min) total timeout, 30 seconds socket connect timeout by default.
Added in version 3.3.
Changed in version 3.10.9: The default value for the sock_connect timeout has been changed to 30 seconds.