A star handler is written for a whole exception group type
What it finds
except* ExceptionGroup:: an except* clause matches the exceptions inside a group and hands them over as a new group, so naming a group type there makes no sense, and Python raises TypeError when such a clause is reached. A plain except ExceptionGroup: catches the group as a whole.
From the rule's source, star_handler_group_type.rs.
def run(task): try: task() except* ExceptionGroup:tx0 reports: except* cannot match ExceptionGroup, so this clause raises TypeError pass except* (ValueError, BaseExceptionGroup):tx0 reports: except* cannot match BaseExceptionGroup pass except* OSError: pass Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/python:star-handler-group-type" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:star-handler-group-type] reason="..."tx0 explain tx0/python:star-handler-group-type shows the same in the terminal. Found a false positive? Report it.