def bytes_to_lines(stream):
    """Reads single bytes from stream, emits lines.
    
       This hack makes me sick, but requests makes this impossible
       to do reliably, otherwise."""
    line = ''
    for byte in stream:
        line += byte
        if line.endswith('\r\n'):
            yield line
            line = ''
