]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
check-eve: open files with utf-8 encoding 1645/head 1646/head
authorJason Ish <jason.ish@oisf.net>
Mon, 12 Feb 2024 15:54:07 +0000 (09:54 -0600)
committerJason Ish <jason.ish@oisf.net>
Mon, 12 Feb 2024 16:54:43 +0000 (10:54 -0600)
Not needed in modern versions of Python, but required for older
versions like 3.6.

check-eve.py

index 1aaadccdfa147c827fcd9069aa14d97c3ff54601..d01a54e690122d5e67fa8b89566b1aa740f3420c 100755 (executable)
@@ -53,7 +53,7 @@ def duplicate_key_object_pair_hook(pairs):
 
 
 def check_duplicate_keys(filename):
-    with open(filename) as json_in:
+    with open(filename, encoding="utf-8") as json_in:
         for line in json_in:
             json.loads(line, object_pairs_hook=duplicate_key_object_pair_hook)
 
@@ -69,7 +69,7 @@ def validate_json(args, json_filename, schema):
             status = "FAIL"
             errors.append(cp.stdout)
     else:
-        with open(json_filename) as f:
+        with open(json_filename, encoding="utf-8") as f:
             for line in f:
                 obj = json.loads(line)
                 try: