[chirp_devel] [PATCH] Fix clone.py to not attempt to read empty ports list.
Re: http://trac.chirp.danplanet.com/trac/ticket/128 IndexError bug
I said this bug was fixed in changeset:924, but it was actually just masked. If no ports are found, the IndexError still occurs.
I intended to fix this by displaying an error dialog when no ports were auto-detected, but decided to fail quietly instead. The user still has the option to manually type a port location. With this patch, CHIRP handles an empty serial port list without error. The fix prevents CHIRP from blindly attempting to read from an empty list.
Tom KD7LXL
I intended to fix this by displaying an error dialog when no ports were auto-detected, but decided to fail quietly instead. The user still has the option to manually type a port location. With this patch, CHIRP handles an empty serial port list without error. The fix prevents CHIRP from blindly attempting to read from an empty list.
I agree with the logic. Some new driver writer on OSX could (AFAICT) decide to call their device /dev/usbthingy and we'd hate to lock out users from using that if needed.
Thanks, applied!
The fix prevents CHIRP from blindly attempting to read from an empty list.
Interesting... looks like this isn't the first time this has been fixed:
http://trac.chirp.danplanet.com/trac/changeset/557/chirpui/clone.py
Lots of other changes since then though. Is there a way to do regression testing on GUI stuff, or do the tests only cover radio drivers?
Tom KD7LXL
Interesting... looks like this isn't the first time this has been fixed:
Heh, oops.
Lots of other changes since then though. Is there a way to do regression testing on GUI stuff, or do the tests only cover radio drivers?
It's really hard, as you might imagine. The easiest way is to break out UI functionality as much as you can (like I tried to do with the import/export stuff recently) and then unit-test those functions specifically.
You can, to some degree, automate things like dialog boxes by instantiating them and calling their response() method to give them the "answer" that the user chose. It's hard work, and tedious, and won't cover everything. Are you interested in trying to work on some of that? If so, I'm happy to help, or at least watch :)
You can, to some degree, automate things like dialog boxes by instantiating them and calling their response() method to give them the "answer" that the user chose. It's hard work, and tedious, and won't cover everything. Are you interested in trying to work on some of that? If so, I'm happy to help, or at least watch :)
I've never touched gtk, or any other UI stuff for that matter. I wouldn't know where to start. It's probably not worth the effort for rare regressions like this anyway.
Tom KD7LXL
participants (2)
-
Dan Smith
-
Tom Hayward