From 54553a91c2e4e94567e6727d46b8a464f3d6392c Mon Sep 17 00:00:00 2001 From: tes Date: Fri, 15 May 2026 13:20:15 -0300 Subject: [PATCH] fix: open timeline.csv and alerts_timeline.csv with write mode to prevent cross run contamination --- 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="\\" )