def read_all(fd):
from os import close<EOL>result = []<EOL>lastread = None<EOL>while lastread != b'<STR_LIT>':<EOL><INDENT>lastread = read_block(fd)<EOL>result.append(lastread)<EOL><DEDENT>close(fd)<EOL>return b'<STR_LIT>'.join(result)<EOL>
My own read loop, bc the one in python3.4 is derpy atm:
    http://bugs.python.org/issue21090#msg231093