lundi 30 mars 2020

Python urllib.request.urlopen() only return when given 'timeout' parameter, otherwise freeze forever

I'd encountered a strange problem when using urllib.request.urlopen function. When I call the function without given the timeout parameter, it just freeze forever (or really really long time), but once I provide the timeout parameter, eg. timeout = 1, the function just return exactly after the interval of timeout without any problem.

As shown in the gif below. (I was using Ipython prompt)

screen record scene of the problem




Aucun commentaire:

Enregistrer un commentaire