Skip to content

TypeError: _typing._idfunc() takes exactly one argument (0 given) — pima.Outputs() called with no arguments #37

Description

@reinhardvw-code

pima_server.py line 170 calls pima.Outputs() with zero arguments:

outputs = pima.Outputs()

But Outputs is defined in pima.py as:

Outputs = typing.NewType('Partitions', typing.Set[int])

typing.NewType instances are callables that require exactly one
positional argument (the value to cast) — they can't be called
with zero arguments to construct an empty instance. This causes
a crash whenever this code path executes:

TypeError: _typing._idfunc() takes exactly one argument (0 given)

This appears to happen when the alarm returns an empty/no response
during a status update, causing repeated crash-loop restarts
(3 consecutive failures triggers "Exiting for clean restart").

The same pattern also exists in pima.py itself in get_outputs() and
get_zones() — e.g. return Outputs() when there's no response.

Suggested fix: pass an empty set explicitly, e.g. pima.Outputs(set())
instead of pima.Outputs().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions