added error handling to telnet decode line

This commit is contained in:
Michael Clemens 2022-05-21 16:05:11 +02:00
parent 6d20452d6e
commit 8fb104240a
3 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[metadata]
name = colorspot
version = 0.1.4
version = 0.1.5
author = Michael Clemens
author_email = colorspot@qrz.is
description = A colorful CLI DX cluster client with LotW integration

View File

@ -1,3 +1,3 @@
from colorspot.__main__ import ColorSpot
__version__ = '0.1.4'
__version__ = '0.1.5'

View File

@ -267,7 +267,11 @@ class ColorSpot():
int(self.config['cluster']['timeout'])) as telnet:
while True:
line_enc = telnet.read_until(b"\n") # Read one line
line = line_enc.decode('ascii')
try:
line = line_enc.decode('ascii')
except:
print("Error while encoding the following line:")
print(line_enc)
# Enters the call sign if requested
if "enter your call" in line:
b_user = str.encode(self.config['cluster']['user']+"\n")