kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.15k stars 570 forks source link

csv output places records on every other line #163

Closed bfmcneill closed 5 years ago

bfmcneill commented 5 years ago

When I export rows to .csv it seems like a new line is inserted between each record. Is this by design? Thanks!

bfmcneill commented 5 years ago

' import records db_url = os.environ.get('DATABASE_URL') db = records.Database(db_url) rows = db.query_file('./the_best_sql_on_earch.sql') f = open('./report.csv','w') f.write(rows.export('csv')) f.close() `

ayancey commented 5 years ago

Try setting newline='' in open()

bfmcneill commented 5 years ago

Thanks!