Skip to content

Commit 326c56d

Browse files
committed
Add a try exception for a unicode decode error
1 parent abea88a commit 326c56d

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Changelog
22

3+
- [24-12-12] Add a try exception for a unicode decode error.
34
- [24-12-11-1] Add RTC to RAC Canada Day, ARRL VHF, ARRL Field Day, ARRL SS, ARRL DX, 10 10
45
- [24-12-11] Add RTC to IARU HF, IARU Field Day, DARC XMAS, CQ WW, CQ WPX
56
- [24-12-9] Add RTC to Winter Field Day, Stew Perry, REF, RAEM, NAQP, LZ-DX, JIDX

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
208208

209209
## Recent Changes (Polishing the Turd)
210210

211+
- [24-12-12] Add a try exception for a unicode decode error.
211212
- [24-12-11-1] Add RTC to RAC Canada Day, ARRL VHF, ARRL Field Day, ARRL SS, ARRL DX, 10 10
212213
- [24-12-11] Add RTC to IARU HF, IARU Field Day, DARC XMAS, CQ WW, CQ WPX
213214
- [24-12-9] Add RTC to Winter Field Day, Stew Perry, REF, RAEM, NAQP, LZ-DX, JIDX

not1mm/lib/cat_interface.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __check_sane_ip(self, ip: str) -> bool:
122122
def __initialize_rigctrld(self):
123123
try:
124124
self.rigctrlsocket = socket.socket()
125-
self.rigctrlsocket.settimeout(0.2)
125+
self.rigctrlsocket.settimeout(0.5)
126126
self.rigctrlsocket.connect((self.host, self.port))
127127
logger.debug("Connected to rigctrld")
128128
self.online = True
@@ -146,12 +146,14 @@ def __get_serial_string(self):
146146
"""Gets any serial data waiting"""
147147
dump = ""
148148
thegrab = ""
149+
self.rigctrlsocket.settimeout(0.1)
149150
try:
150151
while True:
151152
thegrab += self.rigctrlsocket.recv(1024).decode()
152153
dump += thegrab
153-
except socket.error:
154+
except (socket.error, UnicodeDecodeError):
154155
...
156+
self.rigctrlsocket.settimeout(0.5)
155157
return dump
156158

157159
def sendcw(self, texttosend):

not1mm/lib/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""It's the version"""
22

3-
__version__ = "24.12.11.1"
3+
__version__ = "24.12.12"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "not1mm"
7-
version = "24.12.11.1"
7+
version = "24.12.12"
88
description = "NOT1MM Logger"
99
readme = "README.md"
1010
requires-python = ">=3.9"

0 commit comments

Comments
 (0)