handle EOFError from readpartial