@@ -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+
8293fdmap = {process .stdout .fileno (): (stdout_handler , [b'' ]),
8394process .stderr .fileno (): (stderr_handler , [b'' ])}
8495
@@ -119,6 +130,7 @@ def _dispatch_single_line(line, handler):
119130# end single line helper
120131
121132def _dispatch_lines (fno ,handler ,buf_list ):
133+ log .debug ('fno=%d, handler=%r, buf_list=%r' % (fno ,handler ,buf_list ))
122134lc = 0
123135for 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
333345if status != 0 :
334346errstr = read_all_from_possibly_closed_stream (self .proc .stderr )
347+ log .debug ('AutoInterrupt wait stderr: %r' % (errstr ,))
335348raise GitCommandError (self .args ,status ,errstr )
336349# END status handling
337350return status
@@ -618,7 +631,7 @@ def execute(self, command,
618631bufsize = - 1 ,
619632stdin = istream ,
620633stderr = PIPE ,
621- stdout = PIPE if with_stdout else open ( os . devnull , 'wb' ) ,
634+ stdout = PIPE ,
622635shell = self .USE_SHELL ,
623636close_fds = (os .name == 'posix' ),# unsupported on windows
624637universal_newlines = universal_newlines ,