fromDB = '"Column\nheading1",hdng2\r\n"data1\rfoo","data2\r\nfoo"\r\n'
sources = [StringIO(fromDB), fromDB.splitlines(True), fromDB.splitlines(),
    fromDB.split('\n')]
for i, source in enumerate(sources):
    pass
Разбор данных CSV из памяти в Python