From 7b85ba7fd8f7680207b87efa73bfc059e409d238 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 26 Sep 2024 02:41:45 -0700 Subject: [PATCH] fix log line view in admin data when bytes are not utf8 --- archivebox/plugantic/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/plugantic/views.py b/archivebox/plugantic/views.py index 6025cba9..7689deec 100644 --- a/archivebox/plugantic/views.py +++ b/archivebox/plugantic/views.py @@ -403,7 +403,7 @@ def log_list_view(request: HttpRequest, **kwargs) -> TableContext: f.seek(-1024, os.SEEK_END) except OSError: f.seek(0) - last_lines = f.read().decode().split("\n") + last_lines = f.read().decode('utf-8', errors='replace').split("\n") non_empty_lines = [line for line in last_lines if line.strip()] rows["Most Recent Lines"].append(non_empty_lines[-1])