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

Normalise paths when comparing egg-link from network drive #11011

Merged
merged 7 commits into from
Apr 7, 2022

Conversation

freakboy3742
Copy link
Contributor

This is a resurrection of #9453 which was closed due to bitrot. It may also be a fix for #8598.

On Windows, when a package is installed as editable, and the source is on a network drive, the mypkg.egg_link file references a Windows drive letter (e.g., Z:\somewhere\mypkg); however, easy-install.pth file stores the location as a UNC name (e.g., \\network-drive\somewhere\mypkg).

Although these are the same paths when normalised, the comparison is performed on un-normalized paths, which results in an error when you attempt to uninstall the package.

@pypa-bot
Copy link

pypa-bot commented Apr 5, 2022

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will eligible for code review and hopefully merging!

@pypa-bot pypa-bot added needs rebase or merge PR has conflicts with current master and removed needs rebase or merge PR has conflicts with current master labels Apr 5, 2022
@freakboy3742
Copy link
Contributor Author

I'm aware that this PR doesn't have tests; however, I'm having difficulty finding an entry point for those tests. I can't find any obvious place where the existing functionality is currently being tested; nor can I find any reference to any methods that would cause this code to be exercised. Any pointers on where I should be looking to develop a test for this would be appreciated.

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I though samefile covered that. That change was actually pretty recent to support junction links.

This would be very difficult to test so let’s not bother.

@pradyunsg
Copy link
Member

I agree, it’s likely fine to skip testing this entirely. We should normalise both values though and pacify the linters. :)

@freakboy3742 freakboy3742 marked this pull request as ready for review April 6, 2022 22:49
@freakboy3742
Copy link
Contributor Author

@pradyunsg PR now normalises both values, and the linter has been bought a cookie and an ice cream :-)

@pradyunsg pradyunsg merged commit d1f3c73 into pypa:main Apr 7, 2022
@pradyunsg pradyunsg changed the title Fixes #9452 - Correct path comparison when uninstalling development egg from network drive Normalise paths when comparing egg-link from network drive Apr 7, 2022
@freakboy3742 freakboy3742 deleted the unc-path-install branch April 8, 2022 00:44
@pradyunsg
Copy link
Member

Thanks @freakboy3742! ^.^

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants