Write CSVs properly on windows

Description

Python's csv.writer library has some strange behavior around line endings that vary across platforms and between python 2 and 3.

If you think you're doing the right thing by setting the lineterminator parameter to os.linesep, you'll get fun and amusing double line breaks on windows in Python 3.

To add to the fun, pandas' read_csv method will complain "ValueError: Only length-1 line terminators supported" if you try to pass it '\r\n' as a lineterminator.

Environment

None

Assignee

Chris Bare

Reporter

Chris Bare

Labels

Validator

None

Development Area

None

Release Version History

None

Components

Affects versions

Priority

Minor
Configure