Verified Commit 5d0a6501 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

supervisor: fix encoding on Python3

parent d2d1169d
......@@ -106,7 +106,7 @@ class Supervisor:
def _stdout(self):
while True:
line = self.process.stdout.readline()
line = self.process.stdout.readline().decode(sys.getdefaultencoding())
self.trace_lock.acquire()
self.trace += line
self.trace_lock.release()
......@@ -118,15 +118,14 @@ class Supervisor:
def _stderr(self):
while True:
line = self.process.stderr.readline()
line = self.process.stderr.readline().decode(sys.getdefaultencoding())
self.trace_lock.acquire()
self.trace += line
self.trace_lock.release()
if not line:
break
if self.verbose:
print(line.decode(sys.getdefaultencoding()), end='',
file=sys.stderr)
print(line, end='', file=sys.stderr)
sys.stderr.flush()
def _at_exit(self):
......
......@@ -105,7 +105,9 @@ def changes():
if text_en and text_cs:
if subprocess.call(['create_notification', '-s', 'update',
text_cs, text_en]) != 0:
text_cs.encode(sys.getdefaultencoding()),
text_en.encode(sys.getdefaultencoding())
]) != 0:
report('Notification creation failed.')
os.remove(PKGUPDATE_LOG)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment