Bug Report
Three bugs found in multiplex.py:
1. Undefined constant EC_OUTPUT_WRITE_FAIL
Line 463: exit(EC_OUTPUT_WRITE_FAIL) references a constant that is never defined. Instead of a clean exit with a meaningful error code, this raises NameError.
2. List deletion during forward iteration
Lines 171-176: del obj[set_idx] inside for set_idx in range(0, len(obj)) — deleting elements while iterating forward by index causes elements to be skipped (indices shift down after deletion) and can raise IndexError when the index exceeds the shrinking list length.
3. Unused loop variable causing redundant processing
Lines 142-150: for preset_grp in presets_dict: — the loop variable preset_grp is never used inside the loop body, causing the same processing to be repeated for every preset group rather than processing each group distinctly.
Bug Report
Three bugs found in
multiplex.py:1. Undefined constant
EC_OUTPUT_WRITE_FAILLine 463:
exit(EC_OUTPUT_WRITE_FAIL)references a constant that is never defined. Instead of a clean exit with a meaningful error code, this raisesNameError.2. List deletion during forward iteration
Lines 171-176:
del obj[set_idx]insidefor set_idx in range(0, len(obj))— deleting elements while iterating forward by index causes elements to be skipped (indices shift down after deletion) and can raiseIndexErrorwhen the index exceeds the shrinking list length.3. Unused loop variable causing redundant processing
Lines 142-150:
for preset_grp in presets_dict:— the loop variablepreset_grpis never used inside the loop body, causing the same processing to be repeated for every preset group rather than processing each group distinctly.