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

Exception when git binary not present #336

Open
DEVoytas opened this issue Mar 13, 2018 · 0 comments
Open

Exception when git binary not present #336

DEVoytas opened this issue Mar 13, 2018 · 0 comments

Comments

@DEVoytas
Copy link
Contributor

Reproduction steps:

$ rm -rf ~/.subuser # or `mv` if there's something you need to keep
$ sudo mv /usr/bin/git /usr/bin/git_orig
$ subuser list available                                                                                                                                                                                           
Traceback (most recent call last):
  File "/usr/local/bin/subuser", line 52, in <module>
    command(sys.argv[2:])
  File "/usr/local/lib/python3.5/dist-packages/subuserlib/builtInCommands/list.py", line 64, in runCommand
    reposToList = user.registry.repositories.keys()
  File "/usr/local/lib/python3.5/dist-packages/subuserlib/classes/user.py", line 70, in registry
    self.__registry.ensureGitRepoInitialized()
  File "/usr/local/lib/python3.5/dist-packages/subuserlib/classes/registry.py", line 60, in ensureGitRepoInitialized
    self.gitRepository.assertGitSetup()
  File "/usr/local/lib/python3.5/dist-packages/subuserlib/classes/gitRepository.py", line 46, in assertGitSetup
    if getConfig("user.name") is None or getConfig("user.email") is None:
  File "/usr/local/lib/python3.5/dist-packages/subuserlib/classes/gitRepository.py", line 41, in getConfig
    (returncode,stdout,stderr) = self.user.endUser.callCollectOutput(gitExecutable + ["config","--get",key])
  File "/usr/local/lib/python3.5/dist-packages/subuserlib/classes/endUser.py", line 133, in callCollectOutput
    process = subprocess.Popen(args,stdout=subprocess.PIPE,stderr=subprocess.PIPE,cwd=cwd)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1474, in _execute_child
    executable = os.fsencode(executable)
  File "/usr/lib/python3.5/os.py", line 862, in fsencode
    raise TypeError("expect bytes or str, not %s" % type(filename).__name__)
TypeError: expect bytes or str, not NoneType

Extra info:

$ python3 --version
Python 3.5.2
$ subuser version
Subuser version: 0.6.2
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

1 participant