From: Jason Ish Date: Mon, 12 Feb 2024 15:54:07 +0000 (-0600) Subject: check-eve: open files with utf-8 encoding X-Git-Tag: suricata-6.0.17~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1645%2Fhead;p=thirdparty%2Fsuricata-verify.git check-eve: open files with utf-8 encoding Not needed in modern versions of Python, but required for older versions like 3.6. --- diff --git a/check-eve.py b/check-eve.py index 1aaadccdf..d01a54e69 100755 --- a/check-eve.py +++ b/check-eve.py @@ -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: