Fix issues in windows when pipx manages itself #718
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
docs/changelog.md
Summary of changes
Windows doesn't let you delete or overwrite a file that's being run. This causes errors when pipx manages itself with the following commands and the
-all
equivalent.pipx upgrade pipx
pipx reinstall pipx
pipx uninstall pipx
However, Windows does allow you to rename or move files that are in use. I utilize this by creating a folder at
$PIPX_HOME/.trash
to temporarily move files marked for deletion. The next time pipx runs, the folder will be deleted.Note:
reinstall
has to use the--python
option or setPIPX_DEFAULT_PYTHON
because it uses$PIPX_HOME\venvs\pipx\Scripts\python.exe
by default, which would end up being deleted. If it ends up using a python that would be deleted, the user will be notified and told to change it.Test plan
Install pipx via pip, then the dev pipx via pipx
Then run some commands that would normally error: