Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
ondras12345 committed Apr 17, 2025
commit 41bae88b9db21b5951610f8a799865bb035e5da4
2 changes: 1 addition & 1 deletion OMPython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ def createCSVData(self):
l.append(a)

self.csvFile = (pathlib.Path(self.tempdir) / f'{self.modelName}.csv').as_posix()
with open(self.csvFile, "w") as f:
with open(self.csvFile, "w", newline="") as f:
writer = csv.writer(f, delimiter='\n')
writer.writerow(l)
f.close()
Expand Down