public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/logs/
Date: Thu,  3 Feb 2022 21:23:43 +0000 (UTC)	[thread overview]
Message-ID: <1643923408.57d8ef85943af7ddfeaa51d0cacdacba80a75a13.zorry@gentoo> (raw)

commit:     57d8ef85943af7ddfeaa51d0cacdacba80a75a13
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  3 21:23:28 2022 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Thu Feb  3 21:23:28 2022 +0000
URL:        https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=57d8ef85

Fix UnicodeDecodeError in log parser

Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>

 buildbot_gentoo_ci/logs/log_parser.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/buildbot_gentoo_ci/logs/log_parser.py b/buildbot_gentoo_ci/logs/log_parser.py
index 7531532..448192c 100644
--- a/buildbot_gentoo_ci/logs/log_parser.py
+++ b/buildbot_gentoo_ci/logs/log_parser.py
@@ -166,13 +166,10 @@ def runLogParser(args):
     # Is stored in a db instead of files.
     log_search_pattern_list = get_log_search_pattern(Session, args.uuid, config['default_uuid'])
     Session.close()
-    #FIXME: UnicodeDecodeError: 'utf-8' codec can't decode byte ... in some logs
-    with io.TextIOWrapper(io.BufferedReader(gzip.open(args.file, 'rb'))) as f:
-        for text_line in f:
-            logfile_text_dict[index] = text_line.strip('\n')
-            index = index + 1
-            max_text_lines = index
-        f.close()
+    for text_line in io.TextIOWrapper(io.BufferedReader(gzip.open(args.file)), encoding='utf8', errors='ignore'):
+        logfile_text_dict[index] = text_line.strip('\n')
+        index = index + 1
+        max_text_lines = index
     # run the parse patten on the line
     for tmp_index, text in logfile_text_dict.items():
         res = mp_pool.apply_async(search_buildlog, (log_search_pattern_list, logfile_text_dict, tmp_index, max_text_lines,))


             reply	other threads:[~2022-02-03 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 21:23 Magnus Granberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-11  9:55 [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/logs/ Magnus Granberg
2022-01-24  0:49 Magnus Granberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1643923408.57d8ef85943af7ddfeaa51d0cacdacba80a75a13.zorry@gentoo \
    --to=zorry@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox