Commit d5ba0c53 authored by Xavier Thompson's avatar Xavier Thompson

Avoid considering sys.path for distributions

When looking up a distribution to install an egg, keep strictly to
the provided index-url and find-links and do not use distributions
that are already on sys.path.

This change was introduced because of a situation where installing
an egg failed due to a bad distribution somehow available inside a
virtual environment. Could not remember how to reproduce.
parent e08d51e6
...@@ -149,7 +149,11 @@ def _get_index(index_url, find_links, allow_hosts=('*',)): ...@@ -149,7 +149,11 @@ def _get_index(index_url, find_links, allow_hosts=('*',)):
index_url = default_index_url index_url = default_index_url
if index_url.startswith('file://'): if index_url.startswith('file://'):
index_url = index_url[7:] index_url = index_url[7:]
index = AllowHostsPackageIndex(index_url, hosts=allow_hosts) index = AllowHostsPackageIndex(
index_url,
hosts=allow_hosts,
search_path=[], # never look at sys.path
)
if find_links: if find_links:
index.add_find_links(find_links) index.add_find_links(find_links)
......
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