shazow/urllib3 — Issue #23: HTTPConnectionPool.urlopen does not use local timeout on SocketTimeout
Author: ruudud
Created: 2011-12-18 13:17:55+00:00
State: open

On `SocketTimeout`, a `TimeoutError` is raised with `self.timeout` as part of the exception in `urlopen()`, but when this is not set, you get a `TypeError: float argument required, not NoneType`.

When the `timeout` parameter is overriden locally in the function call, the exception should take this in to concideration as well.

To reproduce:

>>> from urllib3.connectionpool import connection_from_url
>>> con = connection_from_url('http://doesnotexists.com')
>>> con.urlopen('GET', 'http://doesnotexists.com', retries=0, assert_same_host=False, timeout=1.0)
Traceback (most recent call last):
File "", line 1, in
File "urllib3/connectionpool.py", line 353, in urlopen
self.timeout)
TypeError: float argument required, not NoneType