_py_read1 - Pure python version of "read1", which allows non-blocking I/O on a potentially unfinished or  non-newline-ending stream. 

        @param maxBuffer - Max buffer size

        @return - All data available on stream, regardless of newlines

def _py_read1(fileObj, maxBuffer):
    '''
        _py_read1 - Pure python version of "read1", which allows non-blocking I/O on a potentially unfinished or  non-newline-ending stream. 

        @param maxBuffer - Max buffer size

        @return - All data available on stream, regardless of newlines
    '''
    i = 0
    ret = []
    while i < maxBuffer:
        c = fileObj.read(1)
        if c == '':
            # Stream has been closed
            break
        i += 1
        ret.append(c)
        # Use a very low timeout so we only grab more data if it's immediately available.
        (readyToRead, junk1, junk2) = select.select([fileObj], [], [], .00001)
        if not readyToRead:
            break

    return ''.join(ret)