def _read_txt(path):
    """Read a txt crashfile
    """
    from pathlib import Path
    lines = Path(path).read_text().splitlines()
    data = {'file': str(path)}
    traceback_start = 0
    if lines[0].startswith('Node'):
        data['node'] = lines[0].split(': ', 1)[1].strip()
        data['node_dir'] = lines[1].split(': ', 1)[1].strip()
        inputs = []
        cur_key = ''
        cur_val = ''
        for i, line in enumerate(lines[5:]):
            if not line.strip():
                continue
            if line[0].isspace():
                cur_val += line
                continue
            if cur_val:
                inputs.append((cur_key, cur_val.strip()))
            if line.startswith('Traceback ('):
                traceback_start = i + 5
                break
            cur_key, cur_val = tuple(line.split(' = ', 1))
        data['inputs'] = sorted(inputs)
    else:
        data['node_dir'] = 'Node crashed before execution'
    data['traceback'] = '\n'.join(lines[traceback_start:]).strip()
    return data
