Skip to content
Snippets Groups Projects
Commit dfb15166 authored by Andreas Freise's avatar Andreas Freise
Browse files

fixing unicode problems with error output

parent d8374ad4
No related branches found
No related tags found
No related merge requests found
...@@ -1031,17 +1031,23 @@ class kat(object): ...@@ -1031,17 +1031,23 @@ class kat(object):
if six.PY2: if six.PY2:
sys.stdout.write(line) sys.stdout.write(line)
else: else:
sys.stdout.write(line) # todo fix this if needed sys.stdout.write(str(line,'utf-8'))
elif line.rstrip().endswith(b'%'): elif line.rstrip().endswith(b'%'):
vals = line.split("-") vals = line.split("-")
action = vals[0].strip() action = vals[0].strip()
prc = vals[1].strip()[:] prc = vals[1].strip()[:]
if printerr == 1: if printerr == 1:
sys.stdout.write("\r{0} {1}".format(action, str(prc))) if six.PY2:
sys.stdout.write("\r{0} {1}".format(action, prc))
else:
sys.stdout.write("\r{0} {1}".format(str(action, 'utf-8'), str(prc, 'utf-8')))
else: else:
err += str(line) if six.PY2:
err="".join((err,line))
else:
err="".join((err,str(line, 'utf-8')))
[out,errpipe] = p.communicate() [out,errpipe] = p.communicate()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment