Skip to content
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

uninstall check should use samefile(), not == #5439

Closed
jhermann opened this issue May 24, 2018 · 2 comments
Closed

uninstall check should use samefile(), not == #5439

jhermann opened this issue May 24, 2018 · 2 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@jhermann
Copy link

Environment

  • pip version: 10.0.1
  • Python version: 2.7
  • OS: Ubuntu

Description

The assertion at

assert (link_pointer == dist.location), (

should use os.path.samefile to compare paths. Hot-patching this in lib of a virtualenv solved my problem.

If you agree, I can prepare a PR.

Expected behavior

Uninstall should succeed in the face of symlinked project paths.

How to Reproduce

Not sure exactly, but have symlinks in the path to your virtualenv / project, so there are two alternative root paths.

@HaraldNordgren
Copy link

HaraldNordgren commented May 26, 2018

Hi, I created a PR:

The samefile solution seems to fail on Windows, but I found another solution here (general03/flask-autoindex#14) to use os.stat instead.

@pradyunsg pradyunsg added the type: bug A confirmed bug or unintended behavior label May 30, 2018
HaraldNordgren added a commit to HaraldNordgren/pip that referenced this issue Jun 5, 2018
Handle symlinks in req_uninstall.py
@uranusjr
Copy link
Member

uranusjr commented Mar 3, 2022

Fixed in #10697.

@uranusjr uranusjr closed this as completed Mar 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
4 participants