You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test suite is unrunnable on Windows without symlink privilege: utils_temp_dir errors #2021
with suppress(FileExistsError):
(tmp_path / util_path.name).symlink_to(util_path)
Windows refuses symlink creation unless the process is elevated or Developer Mode is enabled. That raises OSError: [WinError 1314], which is not a FileExistsError, so suppress does not catch it and the fixture errors.
utils_temp_dir feeds pipx_temp_env, which most tests depend on, so effectively the whole suite errors on a normal Windows machine:
ERROR tests/test_uninstall_all.py::test_uninstall_all - OSError: [WinError 1314]
ERROR tests/test_uninstall_all.py::test_uninstall_all_legacy_venv[None] - OSError...
5 errors in 1.94s
Why CI doesn't catch it
tests.yml includes windows-2025, and it is green — those runners can create symlinks. The failure only appears for an unprivileged contributor, so the suite is permanently green in CI and permanently broken locally.
Suggested fix (implemented and verified)
Fall back to putting the utility's real directory on PATH when the symlink cannot be created. Copying or hard-linking is not an alternative: Windows resolves an executable's DLLs relative to its image path, and git.exe needs the siblings in mingw64/bin.
utils_temp_dir is referenced only inside conftest.py (three places), so returning a list of directories instead of one path is contained.
Result on Windows: tests/test_uninstall_all.py goes from 5 errors to 5 passed.
Activity
tests: make utils_temp_dir work without symlink privilege (#2023)