I'm trying to convert a Python library made for Python 2 to Python 3, here is the code.
I have an error at line 152. In the Py2 version, the function is:
def write(self, data):
self._write_buffer += data
The error is:
TypeError: Can't convert 'bytes' object to str implicitly
I found that I've to decode the variable, so I changed the function to:
def write(self, data):
self._write_buffer += data.decode('utf8')
It works but I have another error in the asyncore library which said that
(the Type) must be bytes or buffer, not str
So, what can I do ?