[issue4079] urllib.requst.Request 'timeout' attribute needs to have a default

Terry J. Reedy report at bugs.python.org
Fri Dec 24 15:36:47 EST 2021


Terry J. Reedy <tjreedy at udel.edu> added the comment:

urllib2 became urllib.request in 3.x.  In 2.6, 'timeout' became a parameter of both urlopen and OpenerDirector.open.  In both cases the default was and is the 'global default timeout setting'.  So 'timeout' has a default.

Both functions take a Request object in lieu of a url.  I see no indication that the Request object itself ever has a timeout attribute, at least not in .__init__.  It certainly does not now.  It seems that the idea was that timeouts are a property of an open action, not of the reusable Request object that wraps a url.


CacheFTPHandler.setTimeout() is for FTP handlers.

So it seems that this should be closed as either 'not a bug' or 'out of date'.

----------
nosy: +terry.reedy
title: new urllib2.Request 'timeout' attribute needs to have a default -> urllib.requst.Request 'timeout' attribute needs to have a default
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue4079>
_______________________________________


More information about the Python-bugs-list mailing list