Commit 5f9324e6 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

prevent exception if allgo.log contains invalid UTF-8 chars

parent 7982242d
Pipeline #30217 failed with stage
in 45 seconds
...@@ -509,7 +509,7 @@ class JobDetail(LoginRequiredMixin, DetailView): ...@@ -509,7 +509,7 @@ class JobDetail(LoginRequiredMixin, DetailView):
else: else:
log_file = os.path.join(dirname, 'allgo.log') log_file = os.path.join(dirname, 'allgo.log')
if os.path.isfile(log_file): if os.path.isfile(log_file):
with open(log_file, 'r') as log_data: with open(log_file, 'r', errors="replace") as log_data:
logs = log_data.read() logs = log_data.read()
else: else:
logs = 'Can\'t load the log file' logs = 'Can\'t load the log file'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment