From 1bca5644014a159fae8e4b7121d363dc1473fa6f Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Mon, 25 Mar 2019 21:57:39 +0100 Subject: [archive] opening a file should ignore UTF errors When opening a file in archive e.g. for do_file_sub, we should ignore UTF encoding errors to prevent UnicodeDecodeError. Resolves: #1622 Signed-off-by: Pavel Moravec --- sos/archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sos/archive.py b/sos/archive.py index 91219318..9e19426c 100644 --- a/sos/archive.py +++ b/sos/archive.py @@ -518,7 +518,7 @@ class FileCacheArchive(Archive): def open_file(self, path): path = self.dest_path(path) - return codecs.open(path, "r", encoding='utf-8') + return codecs.open(path, "r", encoding='utf-8', errors='ignore') def cleanup(self): if os.path.isdir(self._archive_root): -- cgit