From d48e792922383de6c5e25b0a86129e1a44220943 Mon Sep 17 00:00:00 2001 From: Keoni Mahelona Date: Wed, 4 Mar 2020 21:47:06 +1300 Subject: [PATCH] Checking type of command to only encode if string. --- python_apps/pypo/pypo/telnetliquidsoap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_apps/pypo/pypo/telnetliquidsoap.py b/python_apps/pypo/pypo/telnetliquidsoap.py index fbaf87b37..146bdc971 100644 --- a/python_apps/pypo/pypo/telnetliquidsoap.py +++ b/python_apps/pypo/pypo/telnetliquidsoap.py @@ -265,7 +265,9 @@ class TelnetLiquidsoap: tn = telnetlib.Telnet(self.ls_host, self.ls_port) for i in commands: self.logger.info(i) - tn.write(i.encode('utf-8')) + if type(i) is str: + i = i.encode('utf-8') + tn.write(i) tn.write('exit\n'.encode('utf-8')) tn.read_all().decode('utf-8')