From 682452d9140a299bbdd93c0202137631c5453cef Mon Sep 17 00:00:00 2001 From: lethliel Date: Fri, 21 Jun 2019 10:13:31 +0200 Subject: [PATCH] [python3] fix osc lbl non utf8 encoding data can contain non-utf8 chars. So passing data to the decode_it function will solve this problem. --- osc/commandline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index 17d8fe1d..8ea37ba3 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5591,9 +5591,10 @@ Please submit there instead, or use --nodevelproject to force direct submission. logfile = os.path.join(buildroot, '.build.log') if not os.path.isfile(logfile): raise oscerr.OscIOError(None, 'logfile \'%s\' does not exist' % logfile) - f = open(logfile, 'r') + f = open(logfile, 'rb') f.seek(offset) data = f.read(BUFSIZE) + data = decode_it(data) while len(data): if opts.strip_time or conf.config['buildlog_strip_time']: data = buildlog_strip_time(data)