On windows 7 64bit have installed Python 2.7, I have no choice over which version to use.
I have used IDLE to write a script and when I press F5 to run the script everything works as expected.
However, if I double-click the Python file from within explorer or use Py2Exe to make it into an executable the script fails.
This is the part that screws up:
print subprocess.check_output(["git", "pull", "origin", "master"], shell=False)
I keep receiving the git error:
Permission denied (publickey).
Fatal: the remote end hung up unexpectedly.
As I said, if I open the script in IDLE and run from there it works a charm. I have compared the output of os.environ
from both Environments and the output of:
print subprocess.check_output(["ENV"], shell=False)
I can see no differences relating to git inparticular and paths in general. I'm stumped!
PS. If you have a git repo and python installed and a moment to help me then please put the following code in to a file in your git repo:
import sys, subprocess
try:
print "pulling from github"
print subprocess.check_output(["git", "pull", "origin", "master"], shell=False)
except:
print "Failed"
print sys.exc_info()[0]
raw_input("Any key to exit.")
sys.exit(0)
Right-click on the file and choose "Edit with IDLE" and hit F5. Then try double clicking the .py file directly... What happens for you guys?