diff --git a/teuthology/scrape.py b/teuthology/scrape.py index e84122e62..e490c50a9 100644 --- a/teuthology/scrape.py +++ b/teuthology/scrape.py @@ -3,7 +3,7 @@ import difflib from errno import ENOENT -from gzip import GzipFile +import gzip import sys import os import yaml @@ -356,6 +356,8 @@ def _populate_backtrace(self): return for line in grep(tlog_path, "command crashed with signal"): + if not line: + continue log.debug("Found a crash indication: {0}".format(line)) # tasks.ceph.osd.1.plana82.stderr match = re.search(r"tasks.ceph.([^\.]+).([^\.]+).([^\.]+).stderr", line) @@ -382,7 +384,10 @@ def _populate_backtrace(self): )) continue - bt, ass = self._search_backtrace(GzipFile(gzipped_log_path)) + with gzip.open(gzipped_log_path, 'rb') as f: + # Read and decode the contents into strings + decoded_content = f.read().decode('utf-8') + bt, ass = self._search_backtrace(decoded_content) if ass and not self.assertion: self.assertion = ass if bt: