Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoggingThread fails on Python 3 #66

Closed
alexandrevicenzi opened this issue Oct 26, 2018 · 0 comments
Closed

LoggingThread fails on Python 3 #66

alexandrevicenzi opened this issue Oct 26, 2018 · 0 comments

Comments

@alexandrevicenzi
Copy link
Contributor

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
rohanpm added a commit to rohanpm/kobo that referenced this issue Jan 7, 2019
Looking at the implementation of upload_task_log, it expects to
receive bytes as input, not text. Hence, the appropriate file-like
object is BytesIO, not StringIO.

Fixes release-engineering#66
yontalcar added a commit to yontalcar/kobo that referenced this issue May 29, 2019
Fixed several Py2 str -> Py3 bytes issues.

Related: release-engineering#66

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
yontalcar added a commit to yontalcar/kobo that referenced this issue May 30, 2019
Fixed several Py2 str -> Py3 bytes issues.

Related: release-engineering#66

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
rohanpm pushed a commit to yontalcar/kobo that referenced this issue Jun 4, 2019
Fixed several Py2 str -> Py3 bytes issues.

Related: release-engineering#66

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant