Skip to content

Conversation

mattmess1221
Copy link
Contributor

  • I have added an entry to 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 set PIPX_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

python -m pip install pipx
pipx install .

Then run some commands that would normally error:

pipx upgrade pipx
pipx reinstall pipx --python $(which python)
pipx uninstall pipx

@gaborbernat gaborbernat self-requested a review July 26, 2021 08:46
@@ -28,8 +28,10 @@ def use_emojis() -> bool:
if EMOJI_SUPPORT:
stars = "✨ 🌟 ✨"
hazard = "⚠️"
error = "⛔"
Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere?

@cs01
Copy link
Member

cs01 commented Aug 27, 2021

Thanks for the PR!

LGTM besides the one question about the error emoji.

@jaraco jaraco changed the base branch from master to main September 22, 2021 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants