Project

General

Profile

Actions

Bug #10275

closed

FT-4X driver: TypeError: argument should be integer or bytes-like object, not 'str'

Added by Beni K over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
01/15/2023
Due date:
% Done:

100%

Estimated time:
Chirp Version:
next (py3)
Model affected:
FT-4X
Platform:
Linux
Debug Log:
I read the instructions above:

Description

The FT-4X driver hat two instances of strings that should be bytes in Python 3. The following diff should fix this trivial problem. However the connection problem mentioned in issue 10198 still remains in CHIRP-next.

--- ./ft4.py.old        2023-01-09 11:00:26.000000000 +0100
+++ ./ft4.py    2023-01-15 06:57:45.549473236 +0100
@@ -309,8 +309,8 @@
     enter_clonemode(radio)
     id_response = sendcmd(radio.pipe, b'\x02', None)
     if id_response != radio.id_str:
-        substr0 = radio.id_str[:radio.id_str.find('\x00')]
-        if id_response[:id_response.find('\x00')] != substr0:
+        substr0 = radio.id_str[:radio.id_str.find(b'\x00')]
+        if id_response[:id_response.find(b'\x00')] != substr0:
             msg = "ID mismatch. Expected" + util.hexprint(radio.id_str)
             msg += ", Received:" + util.hexprint(id_response)
             LOG.warning(msg)

Actions

Also available in: Atom PDF