Python ';线路终止符';关键字参数在csv.read中不起作用

Python ';线路终止符';关键字参数在csv.read中不起作用,python,python-3.x,csv,Python,Python 3.x,Csv,我的文件中包含以下数据: '#export_date\x01video_id\x01name\x01long_description\x01episode_production_number\x02\n' 这似乎足够简单,可以进行以下分析: reader = csv.DictReader(f, delimiter=u'\x01', lineterminator=u'\x02\n') 但是,当我执行以下操作时,它不会在换行之前正确地解析该项。以下是我得到的: { '#export_da

我的文件中包含以下数据:

'#export_date\x01video_id\x01name\x01long_description\x01episode_production_number\x02\n'
这似乎足够简单,可以进行以下分析:

reader = csv.DictReader(f, delimiter=u'\x01', lineterminator=u'\x02\n')
但是,当我执行以下操作时,它不会在换行之前正确地解析该项。以下是我得到的:

{
    '#export_date': u '1475711237318',
    'video_id': u '382992872'
    'name': u 'Death Lives',
    'long_description': u 'When Peter skips out on his anniversary date with Lois in order to play golf with his buddies, he is inexplicably struck by lightning and visited by Death. Instead of escorting Peter to the after-life, Death tells Peter that Lois will leave him in the future unless Peter uses his near-death experience to come to a life-changing revelation. In order to help him, Death takes Peter back to the moment that Peter and Lois met and fell in love.',
    'episode_production_number\x02': u '2ACX21\x02',
}
如何修复此问题,以及lineterminator为什么不在此处工作?

根据,读者忽略lineterminator关键字参数:

用于终止写入程序生成的行的字符串。它默认为“\r\n”

注意:读卡器硬编码为将“\r”或“\n”识别为行尾,并忽略行终止符。这种行为将来可能会改变

根据,读取器忽略lineterminator关键字参数:

用于终止写入程序生成的行的字符串。它默认为“\r\n”

注意:读卡器硬编码为将“\r”或“\n”识别为行尾,并忽略行终止符。这种行为将来可能会改变

Dialect.lineterminator