Fixed some issues with bytes vs str mismatch

This commit is contained in:
Przemysław Czarnota
2015-08-02 22:25:55 +02:00
parent a86d4e11a9
commit 8d356e32b0

View File

@@ -128,7 +128,7 @@ class TS3Proto():
with self.io_lock:
self._telnet.write(commandstr.encode('utf-8') + b"\n\r")
data = ''
data = b''
response = self._telnet.read_until(b"\n\r", self._timeout)
if not response.startswith(b"error"):
@@ -136,7 +136,7 @@ class TS3Proto():
data = response
response = self._telnet.read_until(b"\n\r", self._timeout)
return TS3Response(response, data)
return TS3Response(response.decode('utf-8'), data.decode('utf-8'))
def check_connection(self):
if not self.is_connected:
@@ -199,7 +199,6 @@ class TS3Proto():
@param data: data string
@type data: string
"""
data = data.strip()
multipart = data.split('|')