From a350d38d4ee5e1d78341edb9a74db8329e6a56f7 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 15 Feb 2024 22:04:16 +0100 Subject: [PATCH] Fix CSV newlines on Windows --- novelwriter/gui/outline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/novelwriter/gui/outline.py b/novelwriter/gui/outline.py index ba7c8432..63c46e57 100644 --- a/novelwriter/gui/outline.py +++ b/novelwriter/gui/outline.py @@ -536,7 +536,7 @@ class GuiOutlineTree(QTreeWidget): logger.info("Writing CSV file: %s", path) cols = [col for col in self._treeOrder if not self._colHidden[col]] order = [self._colIdx[col] for col in cols] - with open(path, mode="w") as csvFile: + with open(path, mode="w", newline="") as csvFile: writer = csv.writer(csvFile, dialect="excel", quoting=csv.QUOTE_ALL) writer.writerow([trConst(nwLabels.OUTLINE_COLS[col]) for col in cols]) for i in range(self.topLevelItemCount()):