diff --git a/mvt/common/module.py b/mvt/common/module.py index 378acf5..7b6acac 100644 --- a/mvt/common/module.py +++ b/mvt/common/module.py @@ -3,6 +3,7 @@ # See the file 'LICENSE' for usage and copying permissions, or find a copy at # https://github.com/mvt-project/mvt/blob/main/LICENSE +import io import os import re import csv @@ -160,7 +161,7 @@ def save_timeline(timeline, timeline_path): :param timeline: List of records to order and store. :param timeline_path: Path to the csv file to store the timeline to. """ - with open(timeline_path, "a+") as handle: + with io.open(timeline_path, "a+", encoding="utf-8") as handle: csvoutput = csv.writer(handle, delimiter=",", quotechar="\"") csvoutput.writerow(["UTC Timestamp", "Plugin", "Event", "Description"]) for event in sorted(timeline, key=lambda x: x["timestamp"] if x["timestamp"] is not None else ""):