Skip to content

OSError: [WinError 193] %1 is not a valid Win32 application when commiting LFS-enabled repository on Windows #971

Closed
@KichangKim

Description

@KichangKim

Hi. I found that GitPython 3.0.5 throw errors when committing to LFS-enabled repository.

Here is error log:

Traceback (most recent call last):
File "C:\Users\XXXXXXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\git\index\fun.py", line 85, in run_commit_hook
creationflags=PROC_CREATIONFLAGS,)
File "C:\Users\XXXXXXXX\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "C:\Users\XXXXXXXX\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:/Users/XXXXXXXX/Downloads/GitPythonTest/test.py", line 7, in
repo.index.commit('AA')
File "C:\Users\XXXXXXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\git\index\base.py",\index\base.py", line 959, in commit
run_commit_hook('post-commit', self)
File "C:\Users\XXXXXXXX\AppData\Local\Programs\Python\Python37\lib\site-packages\git\index\fun.py", line 87, in run_commit_hook
raise HookExecutionError(hp, ex)
git.exc.HookExecutionError: Hook('C:\Users\XXXXXXXX\Downloads\GitPythonTest.git\hooks\post-commit') failed due to: OSError('[WinError 193] %1 is not not a valid Win32 application')
cmdline: C:\Users\XXXXXXXX\Downloads\GitPythonTest.git\hooks\post-commit

This can be reproduced by following code:

import git

repo = git.Repo('.')

repo.git.add(['test.png', '-A'])

repo.index.commit('AA')

Target repository is LFS-enabled and *.png are tracked.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions