Hide a confusing "getresponse() got an unexpected keyword argument 'buffering'" error
Hide a confusing "getresponse() got an unexpected keyword argument 'buffering'" error

Remove the TypeError from the exception chain in Python 3; otherwise it
looks like a programming error was the cause. A quick google search of
the above phrase shows I was not the only one confused by this.

Here is how a connection timeout looks like before this patch:

urllib3.PoolManager().request('GET', 'google.com:81', retries=False, timeout=1)

    Traceback (most recent call last):
    File "/home/ran/src/urllib3/urllib3/connectionpool.py", line 385, in _make_request
        httplib_response = conn.getresponse(buffering=True)
    TypeError: getresponse() got an unexpected keyword argument 'buffering'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/home/ran/src/urllib3/urllib3/connectionpool.py", line 387, in _make_request
        httplib_response = conn.getresponse()
    File "/usr/lib/python3.5/http/client.py", line 1174, in getresponse
        response.begin()
    File "/usr/lib/python3.5/http/client.py", line 282, in begin
        version, status, reason = self._read_status()
    File "/usr/lib/python3.5/http/client.py", line 243, in _read_status
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    File "/usr/lib/python3.5/socket.py", line 575, in readinto
        return self._sock.recv_into(b)
    socket.timeout: timed out

    [snip]

After, the first part is gone, and only the real cause is shown.

In Python2, exceptions are not chained automatically so there is no
difference.

Lukasa/urllib3,sigmavirus24/urllib3,haikuginger/urllib3,sigmavirus24/urllib3,Disassem/urllib3,Lukasa/urllib3,urllib3/urllib3,Disassem/urllib3,haikuginger/urllib3,urllib3/urllib3