Closed
Description
gevent.monkey.patch_all()
patches stderr to be gevent._fileobjectcommon._ClosedIO
object, which raises its own FileObjectClosed(IOError)
.
class _ClosedIO(object):
...
def __getattr__(self, name):
if name == 'name':
# We didn't set it in __init__ because there wasn't one
raise AttributeError
raise FileObjectClosed
GitPython only catches ValueError in read_all_from_possibly_closed_stream
def read_all_from_possibly_closed_stream(stream: Union[IO[bytes], None]) -> bytes:
if stream:
try:
return stderr_b + force_bytes(stream.read())
except ValueError:
return stderr_b or b''
else:
return stderr_b or b''