From 161c0a5072f6049f6e4790969a387e9aae41ad52 Mon Sep 17 00:00:00 2001 From: Julien Muchembled Date: Mon, 14 Nov 2016 00:25:57 +0100 Subject: package_index: fix bug not catching some network timeouts There are already so many exceptions catched, like socket errors (e.g. failure in name resolution) or HTTP errors. Depending on when a timeout occurs, it is either catched (URLError during the SSL handshake) or not (socket.error while getting a HTTP response). When used by buildout, this fixes random failures when running in newest mode (which is the default case), or when the requested version is available in the download-cache. --- setuptools/package_index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/package_index.py') diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 024fab98..d80d43bc 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -768,7 +768,7 @@ class PackageIndex(Environment): 'down, %s' % (url, v.line) ) - except http_client.HTTPException as v: + except (http_client.HTTPException, socket.error) as v: if warning: self.warn(warning, v) else: -- cgit v1.2.3