Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
os.readlink doesn't dereference relative symlinks in mkvirtualenv #268
So I can't say how or why this problem hasn't occurred for other people, but here's my situation....
I've got python installed via homebrew on Mac. This means (among other things) that
Now, when I run
But believe it or not, the problem is that the copied files are broken symlinks:
Digging in to virtualenv.py, I found line 423 of the copyfile function, where it appears you're trying to dereference symlinks by doing the following:
However this isn't achieving the desired function, at least not in my environment...
So readlink is returning the relative path that the link is using. If I change the line to
I've just run into this bug as well (while building Firefox on a system where Python's installed using stow) -- copyfile is broken for symlinks that point to relative paths, and for symlinks that point to further symlinks. This patch makes it follow symlinks until it finds a file: