From 32a24aeeb420e338fff51040c125004805382afb Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 10 Oct 2023 10:08:23 +0200 Subject: [PATCH] ignore error for non UTF8 char --- VeeamLogAnonymizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VeeamLogAnonymizer.py b/VeeamLogAnonymizer.py index 88cd153..4f09a67 100644 --- a/VeeamLogAnonymizer.py +++ b/VeeamLogAnonymizer.py @@ -97,7 +97,7 @@ def process_IP(input_file, output_file): ip_pattern = r"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b(?!])" # Read the file - with open(input_file, 'r') as file: + with open(input_file, 'r', encoding='utf-8', errors='ignore') as file: content = file.read() # Find all IP addresses in the content using regex