-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Make failed uninstalls roll back more reliably and better at avoiding naming conflicts #6225
Conversation
…etter at avoiding naming conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, other than the lack of direct tests, but I'd appreciate another @pypa/pip-committers's review on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for breaking this fix out separately, @zooba.
Approving this now, but continuing what @pradyunsg said, is there any way a regression test can be added for this case (can also be added as part of PR #6215)?
src/pip/_internal/utils/temp_dir.py
Outdated
@@ -98,7 +98,7 @@ class AdjacentTempDirectory(TempDirectory): | |||
|
|||
""" | |||
# The characters that may be used to name the temp directory | |||
LEADING_CHARS = "-~.+=%0123456789" | |||
LEADING_CHARS = "~.=%0123456789" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the reason isn't obvious and for anyone in the future that might want to modify this, I think it would be good to add a comment here recording the lesson of why -
isn't in the list (see #6194 (comment)).
It's okay for this to be done in PR #6215 after this is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do
Actually, I'm playing around with pkg_resources now and it's looking like the best option is to always have a leading The crash was only because pkg_resources checks for an empty directory to skip, and then fails when the dist-info directory has contents that is not valid metadata. I can handle this scenario in freeze, but it probably will show up all over the place. |
And I'll mention again, that this scenarios only occurs when we've already failed in some other way (incorrectly cleaning up after uninstallation). So it's not a normal or expected scenario by any means, though obviously it's one that a few people have already hit. |
This should be discussed separately in a different PR (one fix per PR). If you want to add more commits here, I'd focus on the |
Unfortunately, the original problem isn't really Instead, I'll dig into the rollback tests, which should have caught this in the first place. But that needs to wait for tomorrow - I'm busy rest of today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@cjerdonek @zooba Let's get to the lack of relevant tests (and any issues they might identify) in a separate PR? |
^ ping |
If there's nothing else needed here in your opinion @cjerdonek, let's merge this. :) |
@pradyunsg I had approved this earlier (with the request to handle the new commit separately) and said the regression test could be added / discussed in a later PR. |
I would squash first to cancel the reverted commit first though. |
Yea, I was just being cautious in making sure you're okay with the subsequent commits. |
Hi folks, just wanted to check on this issue and ask if there is a plan to make a release with this fix anytime soon. This has some effect on our update script and we want to know how we should proceed. Thanks for the quick turnaround on the fix! |
There is. This'll be a part of 19.0.2, planned to be released late this week or early next week: #6106. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #6194