@@ -69,6 +69,10 @@ def _bchr(c):
6969# Documentation
7070## @{
7171
72+ def _drop_output_handler (line ):
73+ pass
74+
75+
7276def handle_process_output (process , stdout_handler , stderr_handler , finalizer ):
7377 """Registers for notifications to lean that process output is ready to read, and dispatches lines to
7478 the respective line handlers. We are able to handle carriage returns in case progress is sent by that
@@ -79,6 +83,13 @@ def handle_process_output(process, stdout_handler, stderr_handler, finalizer):
7983 :param stdout_handler: f(stdout_line_string), or None
8084 :param stderr_hanlder: f(stderr_line_string), or None
8185 :param finalizer: f(proc) - wait for proc to finish"""
86+
87+ log .debug ('handle_process_output( process=%r, stdout_handler=%r, stderr_handler=%r, finalizer=%r'
88+ % (process , stdout_handler , stderr_handler , finalizer ))
89+
90+ if stdout_handler is None :
91+ stdout_handler = _drop_output_handler
92+
8293 fdmap = {process .stdout .fileno (): (stdout_handler , [b'' ]),
8394 process .stderr .fileno (): (stderr_handler , [b'' ])}
8495
@@ -119,6 +130,7 @@ def _dispatch_single_line(line, handler):
119130 # end single line helper
120131
121132 def _dispatch_lines (fno , handler , buf_list ):
133+ log .debug ('fno=%d, handler=%r, buf_list=%r' % (fno , handler , buf_list ))
122134 lc = 0
123135 for line in _read_lines_from_fno (fno , buf_list ):
124136 _dispatch_single_line (line , handler )
@@ -332,6 +344,7 @@ def read_all_from_possibly_closed_stream(stream):
332344
333345 if status != 0 :
334346 errstr = read_all_from_possibly_closed_stream (self .proc .stderr )
347+ log .debug ('AutoInterrupt wait stderr: %r' % (errstr ,))
335348 raise GitCommandError (self .args , status , errstr )
336349 # END status handling
337350 return status
@@ -618,7 +631,7 @@ def execute(self, command,
618631 bufsize = - 1 ,
619632 stdin = istream ,
620633 stderr = PIPE ,
621- stdout = PIPE if with_stdout else open ( os . devnull , 'wb' ) ,
634+ stdout = PIPE ,
622635 shell = self .USE_SHELL ,
623636 close_fds = (os .name == 'posix' ), # unsupported on windows
624637 universal_newlines = universal_newlines ,
0 commit comments