Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a5ceba

Browse files
committed
log all the output from stdout and stderr for debugging process failures
1 parent3565888 commit4a5ceba

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎git/cmd.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def _bchr(c):
6969
# Documentation
7070
## @{
7171

72+
def_drop_output_handler(line):
73+
pass
74+
75+
7276
defhandle_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+
ifstdout_handlerisNone:
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
forlinein_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
ifstatus!=0:
334346
errstr=read_all_from_possibly_closed_stream(self.proc.stderr)
347+
log.debug('AutoInterrupt wait stderr: %r'% (errstr,))
335348
raiseGitCommandError(self.args,status,errstr)
336349
# END status handling
337350
returnstatus
@@ -618,7 +631,7 @@ def execute(self, command,
618631
bufsize=-1,
619632
stdin=istream,
620633
stderr=PIPE,
621-
stdout=PIPEifwith_stdoutelseopen(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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp