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

--live does not symlink on Linux #127

Open
lordmauve opened this issue Oct 2, 2024 · 0 comments
Open

--live does not symlink on Linux #127

lordmauve opened this issue Oct 2, 2024 · 0 comments

Comments

@lordmauve
Copy link

Description

There is an accidental difference between the venvs created when running with --live and --py; when using --live the binaries are copied even on platforms where the default is symlinking. Thus these environments are heavier and slower to create. (Also this triggers a behaviour change with some home-built interpreters so was a cause of test failures.)

This is because python -m venv includes logic to default --symlinks vs --copies whereas [venv.create() simply defaults symlinks=False](https://github.com/python/cpython/blob/8cc5aa47ee464ddfd8da5461edecf4a5c72df2ff/Lib/venv/__init__.py#L562); thxuses the former generally and the latter only for--live`.

To have equivalent behaviour on both paths we need to pass

venv.create(..., symlinks=(os.name != "nt"))

Details

  • OS: Linux
  • Python version: 3.6+
  • thx version: main
  • Can you repro on main? Yes
  • Can you repro in a clean virtualenv? Yes
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

No branches or pull requests

1 participant