From 11d06a3a1608b90e97d227dc119f90350d3e0c86 Mon Sep 17 00:00:00 2001 From: tes Date: Fri, 15 May 2026 13:37:17 -0300 Subject: [PATCH] fix: open timeline.csv and alerts_timeline.csv with write mode to prevent cross run contamination (#798) --- src/mvt/common/alerts.py | 2 +- src/mvt/common/module.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mvt/common/alerts.py b/src/mvt/common/alerts.py index 64f1334..540325e 100644 --- a/src/mvt/common/alerts.py +++ b/src/mvt/common/alerts.py @@ -219,7 +219,7 @@ class AlertStore: return alerts def save_timeline(self, timeline_path: str) -> None: - with open(timeline_path, "a+", encoding="utf-8") as handle: + with open(timeline_path, "w", encoding="utf-8") as handle: csvoutput = csv.writer( handle, delimiter=",", diff --git a/src/mvt/common/module.py b/src/mvt/common/module.py index f555e40..1f6f6ce 100644 --- a/src/mvt/common/module.py +++ b/src/mvt/common/module.py @@ -259,7 +259,7 @@ def save_timeline(timeline: list, timeline_path: str, is_utc: bool = True) -> No :param timeline_path: Path to the csv file to store the timeline to """ - with open(timeline_path, "a+", encoding="utf-8") as handle: + with open(timeline_path, "w", encoding="utf-8") as handle: csvoutput = csv.writer( handle, delimiter=",", quotechar='"', quoting=csv.QUOTE_ALL, escapechar="\\" )