ShaBren / tkintertable

Automatically exported from code.google.com/p/tkintertable
Other
1 stars 1 forks source link

tkintertables should open csv file for output in binary mode #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use tkintertable on Windows
2. try to export as csv
3. open the csv file in excel

What is the expected output? What do you see instead?

Expected output:
A csv file without empty lines interspersed

What happens:
An empty line follows every intended line due to an extra carriage return.

What version of the product are you using? On what operating system?
Windows 7, tkintertable v 1.1.2

Please provide any additional information below.
You should change line 147 in Tables_IO.py from 
>writer = csv.writer(file(filename, "w"), delimiter=sep)
to
>writer = csv.writer(file(filename, "wb"), delimiter=sep)
Opening the file in text mode on Windows inserts an extra carriage return.  See 
here:
http://stackoverflow.com/questions/3348460/python-getting-rid-of-extra-line

Original issue reported on code.google.com by ballaban on 10 Sep 2014 at 9:13