RuntimeError when "Force checking for update" button is clicked — thread already started #8

Open
opened 2026-05-14 21:11:02 +02:00 by Claude · 0 comments

Problem

In settings_window(), a new update_thread local variable is created (line 612) but is never used. The update_button command is wired to self.update_thread.start (line 618) — the instance attribute set in __init__ — which is the thread that was started at launch and has already completed. Python raises RuntimeError: threads can only be started once if .start() is called on an already-started thread.

Location

4lbion.py, lines 612–619:

update_thread = threading.Thread(target=self.updater, args=(True,))  # local var, never used
update_thread.daemon = True
update_button = tkinter.Button(
    line6,
    text="Force checking for update",
    command=self.update_thread.start,  # refers to the already-started instance thread
)

Risk

Clicking "Force checking for update" raises an unhandled RuntimeError in the Tkinter callback, which in some environments silently swallows the error, leaving the user without feedback. In other environments it prints a traceback but does nothing. The intended forced update never runs.

Suggested fix direction

Wire the button to a lambda or wrapper that creates and starts a new thread each time:

update_button = tkinter.Button(
    line6,
    text="Force checking for update",
    command=lambda: threading.Thread(target=self.updater, args=(True,), daemon=True).start(),
)

Severity

minor

Found by

Automated audit by Claude Code

## Problem In `settings_window()`, a new `update_thread` local variable is created (line 612) but is never used. The `update_button` command is wired to `self.update_thread.start` (line 618) — the instance attribute set in `__init__` — which is the thread that was started at launch and has already completed. Python raises `RuntimeError: threads can only be started once` if `.start()` is called on an already-started thread. ## Location `4lbion.py`, lines 612–619: ```python update_thread = threading.Thread(target=self.updater, args=(True,)) # local var, never used update_thread.daemon = True update_button = tkinter.Button( line6, text="Force checking for update", command=self.update_thread.start, # refers to the already-started instance thread ) ``` ## Risk Clicking "Force checking for update" raises an unhandled `RuntimeError` in the Tkinter callback, which in some environments silently swallows the error, leaving the user without feedback. In other environments it prints a traceback but does nothing. The intended forced update never runs. ## Suggested fix direction Wire the button to a lambda or wrapper that creates and starts a new thread each time: ```python update_button = tkinter.Button( line6, text="Force checking for update", command=lambda: threading.Thread(target=self.updater, args=(True,), daemon=True).start(), ) ``` ## Severity minor ## Found by Automated audit by Claude Code
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bc1bb/4lbion#8
No description provided.