Skip to content

fix: undefined EC_OUTPUT_WRITE_FAIL and list deletion during forward iteration #104

Description

@k-rister

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions