Skip to content

repo.git.submodule('foreach', 'git', 'clean', '-xfd') fails with Bad file descriptor error #688

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

Open
grkkarthick90 opened this issue Oct 12, 2017 · 1 comment

Comments

@grkkarthick90
Copy link

OS: Windows 64 bit
gitpython: 2.0.8
git: 2.10.0

I'm trying to clean my submodules using the command repo.git.submodule('foreach', 'git', 'clean', '-xfd'). When executing this getting the below stack trace.

  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\git\cmd.py", line 466, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "C:\Python27\lib\site-packages\git\cmd.py", line 910, in _call_process
    return self.execute(make_call(), **_kwargs)
  File "C:\Python27\lib\site-packages\git\cmd.py", line 718, in execute
    raise GitCommandError(command, status, stderr_value)
git.exc.GitCommandError: 'git submodule foreach git clean -xfd' returned with ex
it code 1
stderr: 'C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 311:
0: Bad file descriptor'

Getting the same error for the below commands too,

repo.git.submodule('foreach', 'git', 'reset', '--hard')
 repo.git.submodule('foreach', 'git', 'stash')

But the below commands are getting succeeded in gitpython

repo.git.submodule('update', '--init', '--recursive')
repo.git.submodule('update', '--remote', '--recursive')

Whereas trying to execute git submodule foreach git clean -xfd in windows command prompt or git bash it succeeds without any error.

@Byron
Copy link
Member

Byron commented Dec 11, 2017

With Windows, I believe there are all kinds of possible issues related to file-descriptors, and unfortunately I have no means to reproduce it.
However, if someone else runs into this reproduceably, maybe they can help fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants