Skip to content

Commit d1f3c73

Browse files
freakboy3742Niko Pasanen
and
Niko Pasanen
authored
Normalise paths when comparing egg-link from network drive (#11011)
Co-authored-by: Niko Pasanen <[email protected]>
1 parent 182bac1 commit d1f3c73

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

news/9452.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix an error when trying to uninstall packages installed as editable from a network drive.

src/pip/_internal/req/req_uninstall.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,10 @@ def from_dist(cls, dist: BaseDistribution) -> "UninstallPathSet":
527527
# above, so this only covers the setuptools-style editable.
528528
with open(develop_egg_link) as fh:
529529
link_pointer = os.path.normcase(fh.readline().strip())
530-
assert os.path.samefile(link_pointer, dist_location), (
530+
normalized_link_pointer = normalize_path(link_pointer)
531+
assert os.path.samefile(
532+
normalized_link_pointer, normalized_dist_location
533+
), (
531534
f"Egg-link {link_pointer} does not match installed location of "
532535
f"{dist.raw_name} (at {dist_location})"
533536
)

0 commit comments

Comments
 (0)