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

Error on Windows #54

Open
WanHonghui204 opened this issue Jan 7, 2012 · 2 comments
Open

Error on Windows #54

WanHonghui204 opened this issue Jan 7, 2012 · 2 comments

Comments

@WanHonghui204
Copy link

I am getting the following error(s) when trying to upload git repository using 'python.exe git-ftp.py test' under Windows 7:

INFO: Using .git/ftpdata
Traceback (most recent call last):
File "git-ftp.py", line 357, in
main()
File "git-ftp.py", line 64, in main
if repo.is_dirty() and not options.commit:
File "C:\portable\python2.7\App\lib\site-packages\gitpython-0.3.2.rc1-py2.7.eg
g\git\repo\base.py", line 502, in is_dirty
len(self.git.diff('HEAD', '--cached', _default_args)):
File "C:\portable\python2.7\App\lib\site-packages\gitpython-0.3.2.rc1-py2.7.eg
g\git\cmd.py", line 227, in
return lambda *args, *_kwargs: self._call_process(name, _args, *_kwargs)
File "C:\portable\python2.7\App\lib\site-packages\gitpython-0.3.2.rc1-py2.7.eg
g\git\cmd.py", line 456, in _call_process
return self.execute(call, *__kwargs)
File "C:\portable\python2.7\App\lib\site-packages\gitpython-0.3.2.rc1-py2.7.eg
g\git\cmd.py", line 335, in execute
*_subprocess_kwargs
File "C:\portable\python2.7\App\lib\subprocess.py", line 679, in init
errread, errwrite)
File "C:\portable\python2.7\App\lib\subprocess.py", line 893, in _execute_chil
d
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

As it seems it can successfully find gitpython and ftpdata, but something goes wrong later in execution...

@avladev
Copy link

avladev commented Mar 18, 2012

I found the problem but im not into python programming. Problem is that windows not recognize "git.cmd" this is becouse it's invoked as "git", one solution is to open subprocess.py and locate _execute_child method and add these lines in the first line of the method

if( args and args[0] == "git" ):
args[0] = args[0] + ".cmd"

Someone good in python can come up with real fix of the problem

@bzamecnik
Copy link

Just set the GIT_PYTHON_GIT_EXECUTABLE environment variable to yout git.cmd path, eg. c:\Program Files (x86)\Git\cmd\git.cmd. No need to modify subprocess.py. When this env variable is not set it falls back to 'git' on the system path.

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

No branches or pull requests

3 participants