Skip to content

Failed import raises non-ImportError exception on MacOS #762

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

Closed
terminalmage opened this issue Jun 1, 2018 · 1 comment · Fixed by #763
Closed

Failed import raises non-ImportError exception on MacOS #762

terminalmage opened this issue Jun 1, 2018 · 1 comment · Fixed by #763

Comments

@terminalmage
Copy link
Contributor

This is related to #657.

Apparently, MacOS adds a git executable that is just a stub which displays an error. This gets past the try/except I added in #658, and allows all of the GitPython components to be imported, but since the executable is not actually git, it results in an exception when refresh() attemepts to run a git version:

  File "/opt/salt/lib/python2.7/site-packages/salt/utils/gitfs.py", line 90, in <module>
    import git
  File "/opt/salt/lib/python2.7/site-packages/git/__init__.py", line 82, in <module>
    refresh()
  File "/opt/salt/lib/python2.7/site-packages/git/__init__.py", line 73, in refresh
    if not Git.refresh(path=path):
  File "/opt/salt/lib/python2.7/site-packages/git/cmd.py", line 230, in refresh
    cls().version()
  File "/opt/salt/lib/python2.7/site-packages/git/cmd.py", line 551, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/opt/salt/lib/python2.7/site-packages/git/cmd.py", line 1010, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/opt/salt/lib/python2.7/site-packages/git/cmd.py", line 821, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git version
  stderr: 'xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer
.apple.com'.'

Fix incoming.

@terminalmage
Copy link
Contributor Author

Fix in #763.

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

Successfully merging a pull request may close this issue.

2 participants