Skip to content

Commit f579c17

Browse files
myintmwilliamson
authored andcommitted
Keep symlinks as symlinks when installing
Without this, "pip install" crashes when encountering symlinks that point to external paths. The culprit is "shutil.copytree()", which throws an error in such cases if the "symlinks" parameter is not set to "True". This fixes #1006.
1 parent 048c976 commit f579c17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pip/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def unpack_file_url(link, location):
359359
# delete the location since shutil will create it again :(
360360
if os.path.isdir(location):
361361
rmtree(location)
362-
shutil.copytree(source, location)
362+
shutil.copytree(source, location, symlinks=True)
363363
else:
364364
unpack_file(source, location, content_type, link)
365365

0 commit comments

Comments
 (0)