Add clearer logging to gnupg.GPGBase._read_data().
parent
78400df41c
commit
4780f4443d
|
@ -533,15 +533,19 @@ class GPGBase(object):
|
||||||
:attr:`GPGBase._result_mapping`.
|
:attr:`GPGBase._result_mapping`.
|
||||||
"""
|
"""
|
||||||
chunks = []
|
chunks = []
|
||||||
|
log.debug("Reading data from stream %r..." % stream.__repr__())
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
data = stream.read(1024)
|
data = stream.read(1024)
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
break
|
break
|
||||||
log.debug("read from stdout: %r" % data[:256])
|
|
||||||
chunks.append(data)
|
chunks.append(data)
|
||||||
|
log.debug("Read %4d bytes" % len(data))
|
||||||
|
|
||||||
# Join using b'' or '', as appropriate
|
# Join using b'' or '', as appropriate
|
||||||
result.data = type(data)().join(chunks)
|
result.data = type(data)().join(chunks)
|
||||||
|
log.debug("Finishing reading from stream %r..." % stream.__repr__())
|
||||||
|
log.debug("Read %4d bytes total" % len(result.data))
|
||||||
|
|
||||||
def _collect_output(self, process, result, writer=None, stdin=None):
|
def _collect_output(self, process, result, writer=None, stdin=None):
|
||||||
"""Drain the subprocesses output streams, writing the collected output
|
"""Drain the subprocesses output streams, writing the collected output
|
||||||
|
|
Loading…
Reference in New Issue