I have an Icom-7100. I can download from the radio OK. There are two cases where the export to CSV fails. 1) If no rows are selected. 2) if row 0 and other rows are selected. If I select valid rows, it works. On failure I get:
ERROR: <function ChirpEditorSet.export_to_file at 0x7063e0c2d300> raised unexpected exception Traceback (most recent call last): File "/home/andy/.local/pipx/venvs/chirp/lib/python3.12/site-packages/chirp/wxui/common.py", line 642, in run_safe return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "/home/andy/.local/pipx/venvs/chirp/lib/python3.12/site-packages/chirp/wxui/main.py", line 325, in export_to_file current.export_to_file(filename) File "/home/andy/.local/pipx/venvs/chirp/lib/python3.12/site-packages/chirp/wxui/memedit.py", line 2247, in export_to_file m = self._memory_cache[row] ~~~~~~~~~~~~~~~~~~^^^^^ KeyError: 0
This seems to be from site-packages/chirp/wxui/memedit.py:
def export_to_file(self, filename): if not filename.lower().endswith('.csv'): raise Exception(_('Export can only write CSV files')) selected = self._grid.GetSelectedRows() if len(selected) <= 1: selected = range(0, self._grid.GetNumberRows()) -------------------------------------^ When no rows are selected, the range includes 0. If you start from 1, it works
print("selected: ",selected) r = generic_csv.CSVRadio(None) # The CSV driver defaults to a single non-empty memory at location # zero, so delete it before we go to export. r.erase_memory(0) for row in selected: m = self._memory_cache[row]
This is using chirp-20241108-py3-none-any.whl
I'm not sure if some radios may actually start at memory zero. The comment about deleting row zero would seem to indicate that is not the case.
Thanks, Andy - KF5JLJ
Thanks