diff --git a/news/10476.feature.rst b/news/10476.feature.rst new file mode 100644 index 00000000000..7c2757771a7 --- /dev/null +++ b/news/10476.feature.rst @@ -0,0 +1 @@ +Specify egg-link location in assertion message when it does not match installed location to provide better error message for debugging. diff --git a/src/pip/_internal/req/req_uninstall.py b/src/pip/_internal/req/req_uninstall.py index 15b67385c86..641aaad76bd 100644 --- a/src/pip/_internal/req/req_uninstall.py +++ b/src/pip/_internal/req/req_uninstall.py @@ -535,8 +535,8 @@ def from_dist(cls, dist: BaseDistribution) -> "UninstallPathSet": 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})" + f"Egg-link {develop_egg_link} (to {link_pointer}) does not match " + f"installed location of {dist.raw_name} (at {dist_location})" ) paths_to_remove.add(develop_egg_link) easy_install_pth = os.path.join(