Reads at most maxlenbytes from the
I/O stream. It blocks only if ios has no data immediately
available. It doesn’t block if some data available. If the optional
outbuf argument is present, it must reference a String, which will receive the data. It raises
EOFError on end of file.

readpartial is designed for streams such
as pipe, socket, tty, etc. It blocks only when no data immediately
available. This means that it blocks only when following all conditions
hold.

When readpartial doesn’t blocks,
it returns or raises immediately. If the buffer is not empty, it returns
the data in the buffer. Otherwise if the stream has some content, it
returns the data in the stream. Otherwise if the stream is reached to EOF,
it raises EOFError.