Skip to content

Commit 34d84b5

Browse files
committed
Fix createCSVData on Windows
The csv module documentation says to open the file with newline='': https://docs.python.org/3/library/csv.html#id4 Also, I'm pretty sure this isn't how you are supposed to use csv.writer. delimiter='\n' doesn't seem right. We should either let the csv writer actually generate the rows, or remove it altogether and just write the string rows into the file.
1 parent e79bc40 commit 34d84b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OMPython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ def createCSVData(self):
14811481
l.append(a)
14821482

14831483
self.csvFile = (pathlib.Path(self.tempdir) / f'{self.modelName}.csv').as_posix()
1484-
with open(self.csvFile, "w") as f:
1484+
with open(self.csvFile, "w", newline="") as f:
14851485
writer = csv.writer(f, delimiter='\n')
14861486
writer.writerow(l)
14871487
f.close()

0 commit comments

Comments
 (0)