aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2019-03-25 21:57:39 +0100
committerBryn M. Reeves <bmr@redhat.com>2019-03-26 12:02:04 +0000
commit1bca5644014a159fae8e4b7121d363dc1473fa6f (patch)
tree9d587f6e2b321913ec7aaccfa445c698475e3d26
parent65814887c9cf43ed9314a39576299dd6319fb53e (diff)
downloadsos-1bca5644014a159fae8e4b7121d363dc1473fa6f.tar.gz
[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 <pmoravec@redhat.com>
-rw-r--r--sos/archive.py2
1 files changed, 1 insertions, 1 deletions
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):