-
Notifications
You must be signed in to change notification settings - Fork 109
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
base: master
Are you sure you want to change the base?
Conversation
It's more likely to be the correct Python executable in case where someone specified the executable when running mutmut.
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? |
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. |
Yea that seems like a feature. |
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 |
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. |
Regarding this patch, and your feedback
If the old parameter is already stored in a config file as 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? |
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. |
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...