drewdeponte / sublime_guard

Sublime Text 2 Guard Plugin - helps create a smoother development workflow.
MIT License
175 stars 15 forks source link

#39 Resolve python shebang line for python2 #40

Closed BoGs closed 12 years ago

BoGs commented 12 years ago

This is the shebang line that i had added for the python wrappers, I tested them with python 3.2.2 as the default python. I also have python 2.7 installed and this did resolve the issue, if some more people could make sure it works as well.

Thanks :)

drewdeponte commented 12 years ago

@BoGs I am going to have to reject you pull request because this is the incorrect way to solve this problem. The correct shebang line is the the one that is there #!/usr/bin/env python. If your operating system's setup does not have a python environment variable set with the proper path for the version of python you have installed, that is something you need to fix in your environment setup. Often, configured in ~/.bashrc, ~/.profile, ~/.bash_profile if you are using bash. If you are using a different shell then you will need to look up the environment configuration files for that shell.

Just to be clearer the reason for using the #!/usr/bin/env python instead of the #!/usr/bin/python2 is so that when you upgrade to python 3 in the future you can simply update your environment configuration and you don't have to modify all the python files on the operating system to have #!/usr/bin/python3 as their shebang lines.

If for some reason you have it properly configured in your environment and for some reason that environment variable is not making it through to sublime_guard that is a different problem that should be looked into with a separate issue.