'point logging StreamHandlers that point to this stream to a safe
copy of the underlying FD. otherwise, StreamHandler output will go
to the logging subprocess, effectively getting doubly logged.'

def _point_stream_handlers_to_copy(self):

    fd_copy = os.dup(self._fd)
    self._fd_copy_stream = os.fdopen(fd_copy, 'w')
    self._redirect_logging_stream_handlers(self._stream, self._fd_copy_stream)
