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

Use sys.executable as default python executable #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MaxLap
Copy link

@MaxLap MaxLap commented Jul 23, 2019

It's more likely to be the correct Python executable in case where someone specified the executable when running mutmut.
On Windows 7, there is also a weird thing with the way the search is done which makes just "python" not work with venv...

It's more likely to be the correct Python executable in case where someone specified the executable when running mutmut.
@boxed
Copy link
Owner

boxed commented Jul 23, 2019

This change is obviously an improvement but it has a little problem which is that that parameter can be stored in a config file and this doesn't handle that. I don't know what to do about that but maybe just check if the command starts with "python " and then replace with what you do here?

@MaxLap
Copy link
Author

MaxLap commented Jul 23, 2019

That could work. This has the side-effect of printing the long command when there is a problem. I don't think that's a problem.

@boxed
Copy link
Owner

boxed commented Jul 24, 2019

Yea that seems like a feature.

@jayvdb
Copy link
Contributor

jayvdb commented Sep 4, 2019

t has a little problem which is that that parameter can be stored in a config file and this doesn't handle that.

If I understand correctly, that is a separate problem of loading the config, especially configs stored before this change.

This change is also important for Unix distros, as they often have a python that points to python2, not python3.

@boxed
Copy link
Owner

boxed commented Sep 4, 2019

There really is no difference between the default path, the config and the command line. Or rather I'd really prefer there not to be any difference.

I am working on a new major version of mutmut that changes a lot of the config anyway so then I'll produce errors for the old config. That seems like a good time to tackle this.

I think a good default is to interpret "python foo" as call sys.executable with the argument foo. But then it could be confusing if you actually wanted "python" instead. I'm conflicted about this.

@jayvdb
Copy link
Contributor

jayvdb commented Sep 8, 2019

Regarding this patch, and your feedback

... is that that parameter can be stored in a config file and this doesn't handle that.

If the old parameter is already stored in a config file as python ... , and it was working, it will continue to work as this is only a default. If it wasnt working, they can edit their config file.

If the new parameter value is stored in a config file, it will contain a literal complete path, which is a good thing. The user can change it if they want to, or if they need to.

Am I missing something?
It seems like an acceptable interim solution for a number of bugs.

@boxed
Copy link
Owner

boxed commented Sep 8, 2019

Well yea. The point of storing the config is so that other people than the person who first set it up can run it. Maybe that will work and maybe it won't.

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