Commit 161c0a50 authored by Julien Muchembled's avatar Julien Muchembled

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.
parent a64fcd48
...@@ -768,7 +768,7 @@ class PackageIndex(Environment): ...@@ -768,7 +768,7 @@ class PackageIndex(Environment):
'down, %s' % 'down, %s' %
(url, v.line) (url, v.line)
) )
except http_client.HTTPException as v: except (http_client.HTTPException, socket.error) as v:
if warning: if warning:
self.warn(warning, v) self.warn(warning, v)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment