Skip to content

Commit

Permalink
Fix traceback in install_wheel() when --always-copy used
Browse files Browse the repository at this point in the history
The embedded python script in this function imports tempfile, which in
turn needs to import _io.so. The munged pythonpath used for this script
does not contain this directory, causing the embedded script to fail to
import tempfile.

This commit resolves that traceback by adding the lib-dynload dirs from
sys.path to the munged pythonpath.
  • Loading branch information
terminalmage committed Nov 17, 2016
1 parent c1ef9e2 commit b989c3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,8 @@ def install_wheel(project_names, py_executable, search_dirs=None,
search_dirs = file_search_dirs()

wheels = find_wheels(['setuptools', 'pip'], search_dirs)
pythonpath = os.pathsep.join(wheels)
dynload_dirs = [d for d in sys.path if d.endswith('/lib-dynload')]
pythonpath = os.pathsep.join(wheels + dynload_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.
Expand Down

0 comments on commit b989c3b

Please sign in to comment.