fix utf-8 output in CLI

Fixes: https://pagure.io/koji/issue/1010
This commit is contained in:
Tomas Kopecek 2018-08-16 09:56:26 +02:00 committed by Mike McLean
parent 8334878deb
commit c64f3389c7

View file

@ -377,7 +377,11 @@ def watch_logs(session, tasklist, opts, poll_interval):
sys.stdout.write("\n")
sys.stdout.write("==> %s <==\n" % currlog)
lastlog = currlog
sys.stdout.write(contents.decode('utf8'))
if six.PY3:
sys.stdout.buffer.write(contents)
else:
sys.stdout.write(contents)
if opts.follow:
for child in session.getTaskChildren(task_id):