From bca5becaf85a520ed9925adebeeec248c6ef4810 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 7 Nov 2023 16:56:43 -0800 Subject: [PATCH] vx2,3,7: Fix raw bytestring handling --- chirp/drivers/vx2.py | 2 +- chirp/drivers/vx3.py | 2 +- chirp/drivers/vx7.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chirp/drivers/vx2.py b/chirp/drivers/vx2.py index 41ee3f4a9..62f765054 100644 --- a/chirp/drivers/vx2.py +++ b/chirp/drivers/vx2.py @@ -265,7 +265,7 @@ def get_memory_mappings(self, memory): def _wipe_memory(mem): - mem.set_raw("\x00" * (mem.size() // 8)) + mem.set_raw(b"\x00" * (mem.size() // 8)) @directory.register diff --git a/chirp/drivers/vx3.py b/chirp/drivers/vx3.py index 6cff08381..1951163db 100644 --- a/chirp/drivers/vx3.py +++ b/chirp/drivers/vx3.py @@ -342,7 +342,7 @@ def get_memory_mappings(self, memory): def _wipe_memory(mem): - mem.set_raw("\x00" * (mem.size() // 8)) + mem.set_raw(b"\x00" * (mem.size() // 8)) # the following settings are set to match the defaults # on the radio, some of these fields are unknown mem.name = [0xFF for _i in range(0, 6)] diff --git a/chirp/drivers/vx7.py b/chirp/drivers/vx7.py index 01b854343..ebe827354 100644 --- a/chirp/drivers/vx7.py +++ b/chirp/drivers/vx7.py @@ -168,7 +168,7 @@ def get_memory_mappings(self, memory): def _wipe_memory(mem): - mem.set_raw("\x00" * (mem.size() // 8)) + mem.set_raw(b"\x00" * (mem.size() // 8)) mem.unknown1 = 0x05 mem.ones = 0x03 @@ -286,7 +286,7 @@ def get_memory(self, number): mem.power = levels[0] for i in _mem.name: - if i == "\xFF": + if i == 0xFF: break mem.name += CHARSET[i] mem.name = mem.name.rstrip()