Skip to content

Panel summaries crash on inf/nan; --minutes inf makes the app fail to start #147

Closed

Description

@TMHSDigital

Summary

_num accepts inf and nan, and _plain calls int() on the result, so the collapsed panel summaries raise. From the CLI this turns a bad value into a startup crash instead of a validation message.

Where

  • autoclicker/gui/summaries.py:23-33 (_num, _plain)
  • autoclicker/gui/summaries.py:63, :73, :77, :84, :108, :113 (callers doing int(_num(...)))
  • autoclicker/gui/features/profiles.py:158
  • autoclicker/main.py:77-80

Details

def _num(text, default=0):
    try:
        return float(str(text).strip())     # float('inf') is accepted
    except (TypeError, ValueError):
        return default

def _plain(value):
    return str(int(value)) if value == int(value) else f"{value:g}"

The module promises "Bad numbers never raise", but click_summary(interval='inf'), timing_summary(burst_clicks='1e400') and safety_summary(max_clicks='inf') raise OverflowError, and hold_ms='nan' raises ValueError. The summaries run on every key release and from apply_form_values, before validation.

Impact

autoclicker --minutes inf (also --clicks inf, --burst 1e999:0, --hold nan) shows "Application failed to start" and exits 1. Typing inf into a field raises in the key-release handler and the summary stops updating.

Steps to reproduce

  1. Run autoclicker --minutes inf
  2. The app shows "Application failed to start: cannot convert float infinity to integer"

Suggested fix

In _num, return default unless math.isfinite(value).

Acceptance criteria

  • All summary functions return text for inf, -inf, nan and 1e400 inputs
  • --minutes inf reaches normal validation

Getting started

  • Relevant files: autoclicker/gui/summaries.py, tests/
  • How to run tests: make check (Git Bash) or tasks.bat lint, tasks.bat typecheck, tasks.bat test (cmd). Single test: python -m pytest tests/test_x.py::TestClass::test_name --no-cov
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 9968dc8. Severity: medium. Effort: S. audit-key: bug|autoclicker/gui/summaries.py|_plain

Activity

  1. added
    bug
    good first issue
    priority: medium
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issuepriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions