Closed daviddavis closed 1 year ago
By default, the timeout for urlopen is socket._GLOBAL_DEFAULT_TIMEOUT which is None (meaning that the request never times out):
https://docs.python.org/3/library/socket.html#socket.getdefaulttimeout
This change sets the timeout to 30 but also adds a timeout variable users can set.
To test, simply run nc -l 8080 and then use this example but set the url to "http://localhost:8080".
nc -l 8080
would you mind adding the regression test as well?
By default, the timeout for urlopen is socket._GLOBAL_DEFAULT_TIMEOUT which is None (meaning that the request never times out):
https://docs.python.org/3/library/socket.html#socket.getdefaulttimeout
This change sets the timeout to 30 but also adds a timeout variable users can set.