Skip to content

Exception when git binary not present #336

Description

@DEVoytas

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions