From dd46b4c9840c3dd3b772a0b0b767a5df6d34e4eb Mon Sep 17 00:00:00 2001 From: Keoni Mahelona Date: Wed, 4 Mar 2020 18:13:42 +1300 Subject: [PATCH] Remove .encode(). Not needed in python3 --- python_apps/pypo/pypo/pypofetch.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/python_apps/pypo/pypo/pypofetch.py b/python_apps/pypo/pypo/pypofetch.py index 2ee91d1b1..3325432ef 100644 --- a/python_apps/pypo/pypo/pypofetch.py +++ b/python_apps/pypo/pypo/pypofetch.py @@ -159,9 +159,9 @@ class PypoFetch(Thread): station_name = info['station_name'] fade = info['transition_fade'] - commands.append(('vars.stream_metadata_type %s\n' % stream_format).encode('utf-8')) - commands.append(('vars.station_name %s\n' % station_name).encode('utf-8')) - commands.append(('vars.default_dj_fade %s\n' % fade).encode('utf-8')) + commands.append(('vars.stream_metadata_type %s\n' % stream_format)) + commands.append(('vars.station_name %s\n' % station_name)) + commands.append(('vars.default_dj_fade %s\n' % fade)) self.pypo_liquidsoap.get_telnet_dispatcher().telnet_send(commands) self.pypo_liquidsoap.clear_all_queues() @@ -229,7 +229,7 @@ class PypoFetch(Thread): self.logger.info(connection_status) tn.write(connection_status) - tn.write('exit\n'.encode('ascii')) + tn.write('exit\n') output = tn.read_all() except Exception as e: @@ -261,10 +261,10 @@ class PypoFetch(Thread): try: self.telnet_lock.acquire() tn = telnetlib.Telnet(self.config['ls_host'], self.config['ls_port']) - command = ('vars.stream_metadata_type %s\n' % stream_format).encode('utf-8') + command = ('vars.stream_metadata_type %s\n' % stream_format) self.logger.info(command) tn.write(command) - tn.write('exit\n'.encode('ascii')) + tn.write('exit\n') tn.read_all() except Exception as e: self.logger.exception(e) @@ -278,10 +278,10 @@ class PypoFetch(Thread): try: self.telnet_lock.acquire() tn = telnetlib.Telnet(self.config['ls_host'], self.config['ls_port']) - command = ('vars.default_dj_fade %s\n' % fade).encode('utf-8') + command = ('vars.default_dj_fade %s\n' % fade) self.logger.info(command) tn.write(command) - tn.write('exit\n'.encode('ascii')) + tn.write('exit\n') tn.read_all() except Exception as e: self.logger.exception(e) @@ -296,10 +296,10 @@ class PypoFetch(Thread): try: self.telnet_lock.acquire() tn = telnetlib.Telnet(self.config['ls_host'], self.config['ls_port']) - command = ('vars.station_name %s\n' % station_name).encode('utf-8') + command = ('vars.station_name %s\n' % station_name) self.logger.info(command) tn.write(command) - tn.write('exit\n'.encode('ascii')) + tn.write('exit\n') tn.read_all() except Exception as e: self.logger.exception(e)