Skip to content

Conversation

@scop
Copy link
Collaborator

@scop scop commented Aug 13, 2023

Previously, the bin dir of a given explicit venv was simply added to $PATH with no checks.

This may have caused unintended executables to be invoked when given a nonexistent or non-directory argument. Whatever might be in $PATH would have been run, with venv-run becoming essentially a no-op.

Previously, the bin dir of a given explicit venv was simply added to
`$PATH` with no checks.

This may have caused unintended executables to be invoked when given a
nonexistent or non-directory argument. Whatever might be in `$PATH`
would have been run, with `venv-run` becoming essentially a no-op.
Copy link
Owner

@guludo guludo left a comment

Choose a reason for hiding this comment

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

I think the rationale makes sense. Thanks.

The solution proposed with the current patch only checks for the path being a directory, but I think we could look and see that the directory looks like a virtual environment.

I'd like to suggest that we extract parts of guess() that can be reused into separate function(s) so that do can do the same type of validation when guessing and when the venv is explicitly passed via CLI. That would make the check on a explicit env consistent with the way we check when guessing.

Also, it would be good to have a test case for this.

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.

3 participants