From 7228ca9bf651d9f06395419752139817511aabe1 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 24 May 2016 17:52:55 +0200 Subject: fix(cmd): fix with_stdout implementation Admittedly this fix is solely based on the documentation provided for this parameter, which indicated a different intend than was actually implemented. Also I don't believe doing this will cause any harm. As a special note: the call to `open(os.devnull, 'wb')` does not seem leak the handle, apparently it is given as-is to the subprocess, which will then close it naturally. This was tested using an interactive session via `htop` on osx. Fixes #437 --- git/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 8a657dc1..eef52534 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -605,7 +605,7 @@ class Git(LazyMixin): bufsize=-1, stdin=istream, stderr=PIPE, - stdout=with_stdout and PIPE or None, + stdout=with_stdout and PIPE or open(os.devnull, 'wb'), shell=self.USE_SHELL, close_fds=(os.name == 'posix'), # unsupported on windows **subprocess_kwargs -- cgit v1.2.1