def connectionLost(self, reason):
        # At least on OS X 10.4, exiting while stdout is non-blocking can
        # result in data loss.  For some reason putting the file descriptor
        # back into blocking mode seems to resolve this issue.
        fdesc.setBlocking(self.fd)

        abstract.FileDescriptor.connectionLost(self, reason)
        self.proc.childConnectionLost(self.name, reason)
See abstract.FileDescriptor.connectionLost.
dataset/ETHPy150Open twisted/twisted/twisted/internet/process.py/ProcessWriter.connectionLost