]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
framework: explicit utf-8 encoding for reading json 1111/head suricata-6.0.10
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 2 Feb 2023 15:57:01 +0000 (16:57 +0100)
committerPhilippe Antoine <contact@catenacyber.fr>
Thu, 2 Feb 2023 15:57:01 +0000 (16:57 +0100)
As the default encoding is platform dependent

run.py

diff --git a/run.py b/run.py
index 2d744e38c1d184c2156a4e86c1f05063205a5aa9..2319e339ecbe177c37cacf418ad42098e8d57a63 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -484,7 +484,7 @@ class FilterCheck:
             raise TestError("%s does not exist" % (json_filename))
 
         count = 0
-        with open(json_filename, "r") as fileobj:
+        with open(json_filename, "r", encoding="utf-8") as fileobj:
             for line in fileobj:
                 event = json.loads(line)
                 if self.match(event):