pypa/virtualenv — pull request #590 by jurko-gospodnetic (2014-04-05 23:14:52+00:00)
Title: fix calling pip with findlinks dirs containing spaces in their paths

When running the virtualenv.py script located in a dir containing spaces in its path, or when specifying an '--extra-search-dir' path containing spaces, virtualenv would construct invalid findlinks parameter value for pip. This parameter expects to contain a space separated list and so does not allow individual items contained in it to contain spaces. The issue has been fixed by not passing it direct paths for dirs containing spaces. Such dirs are now represented by local 'file://' URLs, URL quoted so they no longer contain spaces, i.e. with space characters converted to '%20'.

A related test case included.

The new code could be refactored further and used generic utility functions extracted into some more general utility module, but that, if done, should really be done by or under guidance by someone more familiar with the project's organization than I am.