release-engineering/kobo

LoggingThread fails on Python 3

alexandrevicenzi opened this issue · 0 comments

LoggingThread fails on Python 3 due to encoding errors.

It fails on Python 3 because string.encode returns a bytes-like object and StringIO should receive an str object.

Traceback (most recent call last):
  File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/kobo/kobo/worker/logger.py", line 54, in run
    self._hub.upload_task_log(StringIO(self._send_data), self._task_id, "stdout.log", append=True)
TypeError: initial_value must be str or None, not bytes