# HG changeset patch # User Marcin Kuzminski # Date 2012-08-29 22:03:48 # Node ID fd5f2b2174889d9bd3ec318e68c7885aadfecb3e # Parent c61c2ccea2b43432e1a90a0638eeb75df7ec1116 get stderr also for git commands, pass in shell = False diff --git a/rhodecode/lib/subprocessio.py b/rhodecode/lib/subprocessio.py --- a/rhodecode/lib/subprocessio.py +++ b/rhodecode/lib/subprocessio.py @@ -341,9 +341,10 @@ class SubprocessIOChunker(object): if isinstance(cmd, (list, tuple)): cmd = ' '.join(cmd) + _shell = kwargs.get('shell') or True + kwargs['shell'] = _shell _p = subprocess.Popen(cmd, bufsize=-1, - shell=True, stdin=inputstream, stdout=subprocess.PIPE, stderr=subprocess.PIPE, diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -115,6 +115,7 @@ class GitRepository(BaseRepository): try: opts = dict( env=gitenv, + shell=False, ) if os.path.isdir(self.path): opts['cwd'] = self.path @@ -124,9 +125,7 @@ class GitRepository(BaseRepository): raise RepositoryError("Couldn't run git command (%s).\n" "Original error was:%s" % (cmd, err)) - so = ''.join(p) - se = None - return so, se + return ''.join(p.output), ''.join(p.error) @classmethod def _check_url(cls, url):