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

Fix uv run python when the executable has a different name #6362

Closed
wants to merge 1 commit into from

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Aug 21, 2024

No description provided.

@zanieb zanieb added the bug Something isn't working label Aug 21, 2024
@@ -742,6 +741,20 @@ impl RunCommand {
process
}
Self::External(executable, args) => {
// If the executable is `python` and it's not on the path, rename it to the
// path reported by the interpreter.
Copy link
Member

Choose a reason for hiding this comment

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

Could this not resolve to some Python that doesn't match the intended interpreter? Like you run uv run -p 3.9, but we then pick up Python 3.12 that's on your path?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah but what if you have a python executable in the interpreter bin that does some special behavior? Should we unconditionally switch to the sys executable? Should we just look in the interpreter bin instead of the whole PATH here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems problematic both ways. I'm okay with unconditional replacement, I guess?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here's that approach #6363

@zanieb zanieb closed this Aug 21, 2024
zanieb added a commit that referenced this pull request Aug 21, 2024
Alternative to #6362

Resolves the error mentioned in #6361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants