From 74b350e9dd3e6f98dab118358eba68694695db91 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 16 Feb 2015 10:34:04 +0000 Subject: [PATCH] Don't use formatting on bytes Formatting bytes works on Py2.x, but breaks in Py3.x, this should resolve the issues but further unit tests will be need to capture any regressions. Formatting will be supported in Py3.5, but generally it'll be better to avoid formatting where it isn't really needed. Resolves #6 --- ts3/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts3/protocol.py b/ts3/protocol.py index a9ee8e1..937f5ff 100644 --- a/ts3/protocol.py +++ b/ts3/protocol.py @@ -126,7 +126,7 @@ class TS3Proto(): self.logger.debug("send_command - %s" % commandstr) with self.io_lock: - self._telnet.write(b"%s\n\r" % commandstr.encode('utf-8')) + self._telnet.write(commandstr.encode('utf-8') + b"\n\r") data = '' response = self._telnet.read_until(b"\n\r", self._timeout)