From dfc6bd9516dd96fb4864fdd1b3b5bb31f251242d Mon Sep 17 00:00:00 2001 From: timurhai Date: Tue, 1 Oct 2024 15:21:20 +0000 Subject: [PATCH] get rules: rufiles read encoding utf8 --- lib/python/cgrules.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/python/cgrules.py b/lib/python/cgrules.py index 18cf81c3c..7232d06ff 100644 --- a/lib/python/cgrules.py +++ b/lib/python/cgrules.py @@ -111,7 +111,7 @@ def getRules(i_path = None, i_verbose = False): print('File: "%s"' % afile) try: - fobj = open(afile, 'r') + fobj = open(afile, 'r', encoding="utf-8") except: print(traceback.format_exc()) continue @@ -120,6 +120,7 @@ def getRules(i_path = None, i_verbose = False): try: obj = json.load(fobj) except: + print('Error reading "%s"' % afile) print(traceback.format_exc()) continue