Hi there!
I tested chirp from the upstream mercurial repository (py3 branch) today in
Debian testing bullseye, and I got it working with python3 with the attached
patch.
I was able to download the image from a baofeng UV-5RA, modify it and the upload
it again.
Please, consider merging the attached patch. If the patch requires any mangling
please do so yourself, I'm on vacations and I don't plan to follow-up on this.
regards.
# HG changeset patch
# User Arturo Borrero Gonzalez
# Date 1596733882 -7200
# Thu Aug 06 19:11:22 2020 +0200
# Branch py3
# Node ID 16906193cd4089786be642ce0af684a72e29cae9
# Parent 68534f20c1418ae8e4cc09f3ff468d0375ba843a
[py3] some fixes to get chirpw running with python3, Fixes #7431
This patch contains a couple of small changes to get chirpw running with
python3.
Signed-off-by: Arturo Borrero Gonzalez
diff -r 68534f20c141 -r 16906193cd40 chirp/drivers/uv5r.py
--- a/chirp/drivers/uv5r.py Thu Feb 13 16:35:52 2020 -0800
+++ b/chirp/drivers/uv5r.py Thu Aug 06 19:11:22 2020 +0200
@@ -587,7 +587,7 @@
data += _read_block(radio, i, 0x40, False)
if append_model:
-data += radio.MODEL.ljust(8)
+data += bytes(radio.MODEL.ljust(8), 'utf-8')
LOG.debug("done.")
return memmap.MemoryMapBytes(data)
diff -r 68534f20c141 -r 16906193cd40 chirp/drivers/vx6.py
--- a/chirp/drivers/vx6.py Thu Feb 13 16:35:52 2020 -0800
+++ b/chirp/drivers/vx6.py Thu Aug 06 19:11:22 2020 +0200
@@ -871,5 +871,5 @@
elif setting == "password":
newval = self._encode_chars(newval, 4)
setattr(_settings, setting, newval)
-except Exception, e:
+except:
raise
diff -r 68534f20c141 -r 16906193cd40 chirp/ui/mainapp.py
--- a/chirp/ui/mainapp.py Thu Feb 13 16:35:52 2020 -0800
+++ b/chirp/ui/mainapp.py Thu Aug 06 19:11:22 2020 +0200
@@ -1137,7 +1137,7 @@
query = "http://chirp.danplanet.com/query/rb/1.0/app_direct; \
"?loc=%s=%s=%s" % (loc, band, dist)
-print query
+print(query)
# Do this in case the import process is going to take a while
# to make sure we process events leading up to this