From 7126df373bcd5fe6f0af90412282da51afbc58bd Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 7 Nov 2023 16:49:48 -0800 Subject: [PATCH] tk8102: Fix raw bytestring handling --- chirp/drivers/tk8102.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chirp/drivers/tk8102.py b/chirp/drivers/tk8102.py index 888f015ca..b15836838 100644 --- a/chirp/drivers/tk8102.py +++ b/chirp/drivers/tk8102.py @@ -297,7 +297,7 @@ def get_memory(self, number): mem = chirp_common.Memory() mem.number = number - if _mem.get_raw(asbytes=False)[:4] == "\xFF\xFF\xFF\xFF": + if _mem.get_raw()[0:4] == b"\xFF\xFF\xFF\xFF": mem.empty = True return mem @@ -382,7 +382,7 @@ def set_memory(self, mem): _mem = self._memobj.memory[mem.number - 1] if mem.empty: - _mem.set_raw("\xFF" * 16) + _mem.set_raw(b"\xFF" * 16) return _mem.unknown3[0] = 0x07 @@ -490,7 +490,8 @@ def set_settings(self, settings): setting = element.get_name() if "line" in setting: - value = str(element.value).ljust(32, "\xFF") + value = bytes(str(element.value).encode('ascii')) + value = value.ljust(32, b"\xFF") elif 'key' in setting: value = int(element.value) + 4 else: