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
So I think I finally figured out what causes the mysterious issue where the script hangs (and thus your i3 statusbar is frozen and you're late because your clock is wrong), even though we're using the timeout parameter for requests.get(). The issue is that in some situations, it's not the HTTP request that is timing out, but the DNS lookup. In particular, this happens when I am connected to my home network, but the modem is unable to connect to the internet. I noticed that running python weather.py <woeid> without --wrap-i3-status under such circumstances isn't even interruptible with SIGINT.
So I think I finally figured out what causes the mysterious issue where the script hangs (and thus your i3 statusbar is frozen and you're late because your clock is wrong), even though we're using the
timeout
parameter forrequests.get()
. The issue is that in some situations, it's not the HTTP request that is timing out, but the DNS lookup. In particular, this happens when I am connected to my home network, but the modem is unable to connect to the internet. I noticed that runningpython weather.py <woeid>
without--wrap-i3-status
under such circumstances isn't even interruptible withSIGINT
.It appears that someone else ran into this issue: https://github.com/kennethreitz/requests/issues/2347
Which was deemed as an issue with
urllib3
: http://bugs.python.org/issue22889Which does not have a clear resolution in terms of what clients of
requests
should do, other than callingrequests
from a separate thread.@kalgynirae What are your thoughts on this? The Python issue above mentions working around this with
asyncio
, with which I am not familiar.The text was updated successfully, but these errors were encountered: