Skip to content

Commit 41bae88

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 02728a8 commit 41bae88

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
@@ -1464,7 +1464,7 @@ def createCSVData(self):
14641464
l.append(a)
14651465

14661466
self.csvFile = (pathlib.Path(self.tempdir) / f'{self.modelName}.csv').as_posix()
1467-
with open(self.csvFile, "w") as f:
1467+
with open(self.csvFile, "w", newline="") as f:
14681468
writer = csv.writer(f, delimiter='\n')
14691469
writer.writerow(l)
14701470
f.close()

0 commit comments

Comments
 (0)