From df5c1cb715664fd7a98160844572cc473cb6b87c Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sun, 2 Oct 2016 14:24:28 +0200 Subject: FIX regression by #519 on reading stdout/stderr of cmds --- .appveyor.yml | 3 ++- git/cmd.py | 3 ++- git/repo/base.py | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 47bd1f0b..df957c20 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,9 +38,10 @@ environment: install: - set PATH=%PYTHON%;%PYTHON%\Scripts;%GIT_PATH%;%PATH% - ## Print architecture, python & git used for debugging. + ## Print configuration for debugging. # - | + echo %PATH% uname -a where git git-daemon python pip pip3 pip34 python --version diff --git a/git/cmd.py b/git/cmd.py index f4f5f99a..88d62aa4 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -539,7 +539,8 @@ class Git(LazyMixin): cmd_not_found_exception = OSError # end handle - log.debug("Popen(%s, cwd=%s, universal_newlines=%s", command, cwd, universal_newlines) + log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)", + command, cwd, universal_newlines, shell) try: proc = Popen(command, env=env, diff --git a/git/repo/base.py b/git/repo/base.py index 947d77d2..26753bab 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -899,8 +899,12 @@ class Repo(object): try: proc = git.clone(url, path, with_extended_output=True, as_process=True, v=True, **add_progress(kwargs, git, progress)) - progress_handler = progress and progress.new_message_handler() or None - handle_process_output(proc, None, progress_handler, finalize_process) + if progress: + handle_process_output(proc, None, progress.new_message_handler(), finalize_process) + else: + (stdout, stderr) = proc.communicate() # FIXME: Will block of outputs are big! + finalize_process(proc, stderr=stderr) + # end handle progress finally: if prev_cwd is not None: os.chdir(prev_cwd) -- cgit v1.2.1