Message 319378 - Python tracker

Message319378

Author Stefan Vasilev
Recipients Stefan Vasilev, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-06-12.13:01:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528808464.61.0.475983251502.issue33844@psf.upfronthosting.co.za>
In-reply-to
Content
import csv
csv.writer(open('./file.csv', 'a', newline='')).writerow(['ID', 0])

If you try to open file.csv with Excel on Windows 10 it says:
The file format and extension of 'file.csv' don't match. The file could be corrupted or unsafe. Unless you trust its source don't open it. Do you want to open it anyway.

When you click 'Yes', another msgbox appears saying:
Excel has detected that 'file.csv' is a SYLK file, but cannot load it. Either the file has errors or it is not a SYLK fyle format. Click OK to try to open the file in a different format.

When you click on 'OK' it opens it as expected.

The strange thing is that if you use the following code, there are no problems opening it:
import csv
csv.writer(open('./file.csv', 'a', newline='')).writerow(['Id', 0])
History
Date User Action Args
2018-06-12 13:01:04Stefan Vasilevsetrecipients: + Stefan Vasilev, paul.moore, tim.golden, zach.ware, steve.dower
2018-06-12 13:01:04Stefan Vasilevsetmessageid: <1528808464.61.0.475983251502.issue33844@psf.upfronthosting.co.za>
2018-06-12 13:01:04Stefan Vasilevlinkissue33844 messages
2018-06-12 13:01:04Stefan Vasilevcreate