From 326c56d3c778d6b8abe3dc78a70d2ca96db972c0 Mon Sep 17 00:00:00 2001 From: mbridak Date: Thu, 12 Dec 2024 15:03:35 -0800 Subject: [PATCH] Add a try exception for a unicode decode error --- CHANGELOG.md | 1 + README.md | 1 + not1mm/lib/cat_interface.py | 6 ++++-- not1mm/lib/version.py | 2 +- pyproject.toml | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91af0a2..06c965a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +- [24-12-12] Add a try exception for a unicode decode error. - [24-12-11-1] Add RTC to RAC Canada Day, ARRL VHF, ARRL Field Day, ARRL SS, ARRL DX, 10 10 - [24-12-11] Add RTC to IARU HF, IARU Field Day, DARC XMAS, CQ WW, CQ WPX - [24-12-9] Add RTC to Winter Field Day, Stew Perry, REF, RAEM, NAQP, LZ-DX, JIDX diff --git a/README.md b/README.md index a9057e6..ef0f33c 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's. ## Recent Changes (Polishing the Turd) +- [24-12-12] Add a try exception for a unicode decode error. - [24-12-11-1] Add RTC to RAC Canada Day, ARRL VHF, ARRL Field Day, ARRL SS, ARRL DX, 10 10 - [24-12-11] Add RTC to IARU HF, IARU Field Day, DARC XMAS, CQ WW, CQ WPX - [24-12-9] Add RTC to Winter Field Day, Stew Perry, REF, RAEM, NAQP, LZ-DX, JIDX diff --git a/not1mm/lib/cat_interface.py b/not1mm/lib/cat_interface.py index 08edc32..2a4dfce 100644 --- a/not1mm/lib/cat_interface.py +++ b/not1mm/lib/cat_interface.py @@ -122,7 +122,7 @@ def __check_sane_ip(self, ip: str) -> bool: def __initialize_rigctrld(self): try: self.rigctrlsocket = socket.socket() - self.rigctrlsocket.settimeout(0.2) + self.rigctrlsocket.settimeout(0.5) self.rigctrlsocket.connect((self.host, self.port)) logger.debug("Connected to rigctrld") self.online = True @@ -146,12 +146,14 @@ def __get_serial_string(self): """Gets any serial data waiting""" dump = "" thegrab = "" + self.rigctrlsocket.settimeout(0.1) try: while True: thegrab += self.rigctrlsocket.recv(1024).decode() dump += thegrab - except socket.error: + except (socket.error, UnicodeDecodeError): ... + self.rigctrlsocket.settimeout(0.5) return dump def sendcw(self, texttosend): diff --git a/not1mm/lib/version.py b/not1mm/lib/version.py index 76ebac2..9b55fcc 100644 --- a/not1mm/lib/version.py +++ b/not1mm/lib/version.py @@ -1,3 +1,3 @@ """It's the version""" -__version__ = "24.12.11.1" +__version__ = "24.12.12" diff --git a/pyproject.toml b/pyproject.toml index e887c25..54f605d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "not1mm" -version = "24.12.11.1" +version = "24.12.12" description = "NOT1MM Logger" readme = "README.md" requires-python = ">=3.9"