From: Josh Brown Date: Mon, 23 Mar 2015 05:01:48 +0000 (+1100) Subject: Minor Patch TypeError thrown X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b5317ea088b26e386c53e6a4f55558915467bb5;p=services%2Fpython-requests.git Minor Patch TypeError thrown --- diff --git a/AUTHORS.rst b/AUTHORS.rst index 8a40bd9..10f48cb 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -160,4 +160,5 @@ Patches and Suggestions - Scott Sadler (`@ssadler `_) - Arthur Darcet (`@arthurdarcet `_) - Ulrich Petri (`@ulope `_) -- Muhammad Yasoob Ullah Khalid (`@yasoob `_) \ No newline at end of file +- Muhammad Yasoob Ullah Khalid (`@yasoob `_) +- Josh Brown (`@Montycarlo `_) diff --git a/requests/packages/urllib3/connectionpool.py b/requests/packages/urllib3/connectionpool.py index 0085345..bc80462 100644 --- a/requests/packages/urllib3/connectionpool.py +++ b/requests/packages/urllib3/connectionpool.py @@ -311,8 +311,14 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): # Catch possible read timeouts thrown as SSL errors. If not the # case, rethrow the original. We need to do this because of: # http://bugs.python.org/issue10272 - if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python 2.6 - raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) + # Wrapped in a try/catch because python 2.7 throws TypeError, + # SSLError doesn't override __str__ + try: + if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python 2.6 + raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) + except TypeError: + raise err + def _make_request(self, conn, method, url, timeout=_Default, **httplib_request_kw):