Skip to content

Commit

Permalink
Ensure we are compare normalized paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Apr 6, 2022
1 parent 1f4049c commit 2624b3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pip/_internal/req/req_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,9 @@ def from_dist(cls, dist: BaseDistribution) -> "UninstallPathSet":
# PEP 660 modern editable is handled in the ``.dist-info`` case
# above, so this only covers the setuptools-style editable.
with open(develop_egg_link) as fh:
link_pointer = normalize_path(os.path.normcase(fh.readline().strip()))
assert os.path.samefile(link_pointer, dist_location), (
link_pointer = os.path.normcase(fh.readline().strip())
normalized_link_pointer = normalize_path(link_pointer)
assert os.path.samefile(normalized_link_pointer, normalized_dist_location), (
f"Egg-link {link_pointer} does not match installed location of "
f"{dist.raw_name} (at {dist_location})"
)
Expand Down

0 comments on commit 2624b3e

Please sign in to comment.