parent: fix TtyLogger str/unicode crash on 3.x.

pull/295/head
David Wilson 6 years ago
parent 038f8d5dec
commit 692275064b

@ -694,7 +694,7 @@ class TtyLogStream(mitogen.core.BasicStream):
if not buf: if not buf:
return self.on_disconnect(broker) return self.on_disconnect(broker)
self.buf += buf self.buf += buf.decode('utf-8', 'replace')
while '\n' in self.buf: while '\n' in self.buf:
lines = self.buf.split('\n') lines = self.buf.split('\n')
self.buf = lines[-1] self.buf = lines[-1]

Loading…
Cancel
Save