From f3d7349cd4d8cefcec59d4ee91c179a5f828783f Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Wed, 10 Apr 2024 13:23:59 +0200 Subject: [PATCH] Update filter_sarif.py: use UTF-8 as encoding for reading/writing SARIF content --- filter_sarif.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter_sarif.py b/filter_sarif.py index 4451237..ac6ca5f 100644 --- a/filter_sarif.py +++ b/filter_sarif.py @@ -79,7 +79,7 @@ def filter_sarif(args): ) ) - with open(args.input, 'r') as f: + with open(args.input, 'r', encoding='utf-8') as f: s = json.load(f) for run in s.get('runs', []): @@ -107,7 +107,7 @@ def filter_sarif(args): new_results.append(r) run['results'] = new_results - with open(args.output, 'w') as f: + with open(args.output, 'w', encoding='utf-8') as f: json.dump(s, f, indent=2)