-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix unpack directory contains symlinks on py3k #813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
exc = None; | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A try
with run_pip()
and finally
with the removes looks better, and no except
statement, like other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
After reading issues list I've seen this PR fix #611 |
shutil.copytree(source, location) | ||
# The py3k version of `shutil.copytree` fails when symlinks point on | ||
# directories. So `symlinks` argument must be True | ||
shutil.copytree(source, location, symlinks=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does symlinks=True work on Windows? Specifically, I assume copytree doesn't fail if symlinks=True is set, and if symlinks are present, what is the behaviour? Note that creating symlinks on Windows requires an elevated process, which most Python processes won't be...
Symlinks on Windows are rare, so the main issue here is that this change doesn't stop the normal (non-symlink) case working on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shutil.copytree
on py2
http://hg.python.org/cpython/file/2.7/Lib/shutil.py#l145
shutil.copytree
on py3
http://hg.python.org/cpython/file/3.3/Lib/shutil.py#l259
The shutil.copytree
function on py3 don't care about if the file pointed by a symlink is a directory or a file. It passed to copy_function
(copy2
by default) and so fails with a directory.
symlinks=True
is same as follow_symlinks=False
With this fix all symlinks on the source directory are not followed. It break the current behaviour indeed. So for keep the current behaviour we need to do that: alquerci@66a0cef2e11fe1f057c68ba716a55978b0e982ec
What is the better behaviour in your mind?
closing this, so we can focus on #1311 . |
Hello,
On python3 installation fail when the source directory contains symlinks.
See: https://api.travis-ci.org/jobs/4900020/log.txt?deansi=true
Before apply this fix tests fails on py32 and py33. https://travis-ci.org/alquerci/pip/builds/4980091
Symbolic links are not followed.