Repository navigation
🐛 fix(uv): return absolute paths for a relative install dir - #289
Merged
gaborbernat merged 2 commits intoNov 30, 2026
Merged
Conversation
Discovery searched a relative UV_PYTHON_INSTALL_DIR as written and returned the interpreters it found with relative paths, so a returned executable depended on the directory the caller was in when it used it. uv anchors a relative store at the working directory, so do the same and return absolute paths. Fixes tox-dev#284. Reported by oss-scanner as ANT-2026-JQLRJOIU.
The hand-built from_exe mock only checked the path it received, which the uv_probed fixture already records.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Setting
UV_PYTHON_INSTALL_DIRto a relative folder made discovery return relative interpreter paths. After the calling tool changed directory, that path named a different Python or nothing, and a second lookup in the same process could pair the first folder's details with the wrong binary. 🐛 Interpreters found there now come back as absolute paths. Fixes #284.Before:
After:
The folder is still searched from the current directory, as uv anchors it. Discovery now makes it absolute when the lookup runs, as it already does for interpreters found on
PATH.Absolute values and uv's default locations behave as before. Lookups from two directories still search two stores, as uv would.
Reported by oss-scanner: ANT-2026-JQLRJOIU.