diff options
author | Donald Stufft <donald@stufft.io> | 2016-01-19 15:30:50 -0500 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2016-01-19 15:30:50 -0500 |
commit | 9225d2bd76e7c5f16697def04d296f8d38b12b0d (patch) | |
tree | 1e2b98df2f06ddb9b96d04ed8e19c55df6423d0f /virtualenv.py | |
parent | ee5acce072f76a665f0e396af36da535e255a5d3 (diff) | |
parent | 6650bc642f24f0b08eba967015e2980fb9f3f9b7 (diff) | |
download | virtualenv-9225d2bd76e7c5f16697def04d296f8d38b12b0d.tar.gz |
Merge pull request #830 from kankri/develop
PIP_FIND_LINKS doesn't cope with spaces, work around with file:// URLs.
Diffstat (limited to 'virtualenv.py')
-rwxr-xr-x | virtualenv.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/virtualenv.py b/virtualenv.py index 7102af0..9b03bec 100755 --- a/virtualenv.py +++ b/virtualenv.py @@ -821,7 +821,20 @@ def install_wheel(project_names, py_executable, search_dirs=None, wheels = find_wheels(['setuptools', 'pip'], search_dirs) pythonpath = os.pathsep.join(wheels) - findlinks = ' '.join(search_dirs) + + # PIP_FIND_LINKS uses space as the path separator and thus cannot have paths + # with spaces in them. Convert any of those to local file:// URL form. + try: + from urlparse import urljoin + from urllib import pathname2url + except ImportError: + from urllib.parse import urljoin + from urllib.request import pathname2url + def space_path2url(p): + if ' ' not in p: + return p + return urljoin('file:', pathname2url(os.path.abspath(p))) + findlinks = ' '.join(space_path2url(d) for d in search_dirs) cmd = [ py_executable, '-c', |