-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip uninstall fails on symlinks to directories #40
Comments
Do you have an example package that installs symbolic links? I would like to
|
I came across this issue while developing synaptiks. It is a python These common files are symlinked into the directory of the specific handbook,
/usr/share/doc/kde/html/en/common I've not invented this system, and I'm in no position to change it, so I have My guess is, that pip applies
|
Ok, it looks like pip moves the 'files to be removed' into a temp location, I am going to work up a patch and test package to see if my hypothesis
|
Also what version of pip are you running?
|
0.8.2
|
Looks like you where pretty much right. It seems pip is calling Per the docs os.path.realpath(): "Return the canonical path of the specified filename, eliminating any symbolic Not sure how to work around this. Maybe pip needs "yet another flag" to
|
I'm using pip 0.8.2.
|
I have added a --disable-followlinks flag to the uninstall command in my fork You can clone from here: hg clone https://[email protected]/khightower/pip -b pip- Example output: I have created a symbolic link under the nose installation Running pip uninstall
packages/nose-1.0.0-py2.7.egg-info/installed-files.txt
info
Notice how '/testdir' shows up in the list of directories to be removed. Running pip uninstall using --disable-followlinks
packages/nose-1.0.0-py2.7.egg-info/installed-files.txt
info
Notice how '/testdir' does not show up in the list of directories to be
|
Does And to be honest, I dislike this solution. The target users of my application Imho,
|
The proposed solution only removes the symlink. I agree with that pip should
|
I agree with Sebastian that we should fix this without the need for an Thanks Sebastian for the report, and Kelsey for your work on a patch!
|
I have rerun the tests again; this time inside a virtualenv. Looks like pip Running with pip uninstall nose
info
Notice the line: Not removing or modifying (outside of prefix): Running with pip uninstall nose --disable-followlinks
info
Notice now that the full path to the symlink is expanded. Looks like when
|
Looks like I was getting tripped up on the "is_local" check pip does during
virtualenv.
My new patch removes the call to os.path.realpath when normalizing a path; in After Running the testsPip only removes the symlink leaving the content it points to untouched. I get Link to changesetChanges can be found in fork under the uninstall-fails-on-symlinks-to- https://bitbucket.org/khightower/pip/changeset/31571bc08c73
|
/uninstall-fails-on-symlinks-to-directories.patch
|
If uninstalling a python package, which installs symbolic links to directories somewhere,
pip uninstall
does not remove the symbolic link itself, but instead leaves the symbolic link intact and instead removes the whole directory, the link pointed too.The text was updated successfully, but these errors were encountered: