-
Notifications
You must be signed in to change notification settings - Fork 414
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
Fix pipx reinstall
crash with absolute path
#1329
Conversation
405bc4d
to
ac04324
Compare
What's the behavior if you pass a relative path? I assume it will also lead to unexpected results? |
It just gets "normalized" and then appended to |
Ah, classic two-absolute-paths-where-one-clobbers-the-other. I'm also generally kind of suspicious of allowing paths being passed in to
This doesn't sound right to me for If this is the case, then it feels like we should be stricter about I also think the error messages here could be clearer. If there's no venv named, e.g.,
which is pretty ambiguous. I did have a package installed (that I was trying to pass in a path for) and this message made it seem like pipx just didn't think reinstallation was necessary. This would be much more clear to the user if it says something like
|
That's because
I agree with that. Would you like to improve it in a separate PR? |
195adbf
to
e94c5d2
Compare
Could you review again? |
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.
I'm on vacation for the next few weeks, so someone else needs to take over the reviews for this.
e94c5d2
to
a23f74b
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
74968fb
to
18da06a
Compare
Co-authored-by: Robert <[email protected]>
18da06a
to
bd55b6a
Compare
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.
Nice, lgtm
changelog.d/
(if the patch affects the end users)Summary of changes
Closes #1324. This checks whether the argument given as package name inside
VenvContainer.get_venv_dir()
is an absolute path or existing path, raisingPipxError
if so. This is due to the behaviour that an absolute path passed into thepathlib.PurePath.joinpath()
function to join with another path will return the same.Test plan
Tested by running