[entropy.spm, rigo] Rigo related Python 3 fixes

1)
  File "/usr/lib/python-exec/python3.6/RigoDaemon_app.py", line 362, in _pusher
    fobj.write(chunk)
TypeError: write() argument must be str, not bytes

2)
  File "/usr/lib64/python3.6/site-packages/entropy/spm/plugins/interfaces/portage_plugin/__init__.py", line 77, in __init__
    self.buffer = Writer(self, self._std.buffer)
AttributeError: 'FakeOutFile' object has no attribute 'buffer'
This commit is contained in:
Sławomir Nizio
2020-02-11 22:25:08 +01:00
parent c06eb76644
commit 8700aade27
2 changed files with 4 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
"""
import os
import io
import errno
import bz2
import hashlib
@@ -74,7 +75,8 @@ class StdoutSplitter(object):
self._buf.flush()
self._parent.flush()
self.buffer = Writer(self, self._std.buffer)
if isinstance(self._std, io.TextIOWrapper):
self.buffer = Writer(self, self._std.buffer)
def __iter__(self):
return self._std

View File

@@ -3158,7 +3158,7 @@ class RigoDaemonService(dbus.service.Object):
"enqueue_application_action: "
"busied, but cannot remove previous path")
try:
fobj = os.fdopen(tmp_fd, "w")
fobj = os.fdopen(tmp_fd, "wb")
except OSError as err:
write_output(
"enqueue_application_action: "