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

Use shutil.move() instead of rename() when moving extracted Python #1265

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

dukecat0
Copy link
Member

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

Using rename() will result in an error when the source and destination are not on the same file system:

pipx install nox --python=3.9 --fetch-missing-python
Traceback (most recent call last):
...
  File "/workspace/pipx/src/pipx/standalone_python.py", line 90, in download_python_build_standalone
    extracted_dir.rename(install_dir)
  File "/home/gitpod/.pyenv/versions/3.12.2/lib/python3.12/pathlib.py", line 1363, in rename
    os.rename(self, target)
OSError: [Errno 18] Invalid cross-device link: '/tmp/tmp5uhdkes5/download/python' -> '/home/gitpod/.local/share/pipx/py/3.9'

Test plan

Tested by running

 pipx install nox --python=3.9 --fetch-missing-python

@dukecat0 dukecat0 merged commit 6555533 into pypa:main Feb 25, 2024
14 checks passed
@dukecat0 dukecat0 deleted the move branch February 25, 2024 08:42
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.

2 participants