From 8fb104240a4a8288c73b776c2d63a50337bdf21f Mon Sep 17 00:00:00 2001 From: Michael Clemens Date: Sat, 21 May 2022 16:05:11 +0200 Subject: [PATCH] added error handling to telnet decode line --- setup.cfg | 2 +- src/colorspot/__init__.py | 2 +- src/colorspot/__main__.py | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index f7d4547..c855c16 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/src/colorspot/__init__.py b/src/colorspot/__init__.py index b572ec4..0e56af6 100644 --- a/src/colorspot/__init__.py +++ b/src/colorspot/__init__.py @@ -1,3 +1,3 @@ from colorspot.__main__ import ColorSpot -__version__ = '0.1.4' +__version__ = '0.1.5' diff --git a/src/colorspot/__main__.py b/src/colorspot/__main__.py index d2cba11..bf81070 100755 --- a/src/colorspot/__main__.py +++ b/src/colorspot/__main__.py @@ -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")