Conversation
Reported crash log: - city_panel.py: prepare_city_list() detected a missing new_city.cfg and opened a warning MessageBox, but then fell through into the open() call unconditionally anyway, raising FileNotFoundError (caught internally, but pointless). Missing `return` after showing the warning. - plugin.py: the MessageBox's callback (_close_panel) called self.close() with no arguments, and Foreca_Preview.city_selected required a positional `result` argument with no default, so the callback dispatch crashed with TypeError, producing the blue-screen error. Fixed both: _close_panel now closes with an explicit None (matching city_selected's existing `if result is None: return` handling), and city_selected got a `result=None` default so any other callback-with-no-args path can't hit the same crash. Note: new_city.cfg is only ever read, never written anywhere in the codebase - README's claim that the plugin creates it automatically during a search isn't actually implemented. Flagging this separately as a documentation/feature gap, not fixed here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
pQu4k3r
added a commit
that referenced
this pull request
Sep 9, 2026
…ning Reported: opening Select City with no offline new_city.cfg showed "City list file not found" twice, then dropped back to the main plugin screen instead of staying on a usable search panel. Root causes: - onShown fires more than once per screen open in Enigma2, and prepare_city_list() was bound directly to onShown with no guard, so the warning popped up on every firing. - The warning's callback closed the entire CityPanel4 screen (self.close(None)), not just the popup, contradicting its own "use the search" message since the search screen no longer existed by the time the user could act on it. Fixed by guarding the warning to show once per screen instance, and leaving CityPanel4 open afterward (with an empty list) so the user can press RED to search online, per PR #4's Test plan note that this mechanism needed follow-up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
pQu4k3r
added a commit
that referenced
this pull request
Sep 10, 2026
README documents that the offline city list "is created automatically during a search" if it doesn't exist, but that mechanism was never actually implemented anywhere in the codebase - new_city.cfg was only ever read, never written. Implemented it: after a successful online search (search_online), append any newly found cities to new_city.cfg, deduped by city id against what's already in the file, in the same "ID/City_Name" format the reader already expects (verified with a write/read round-trip, including a non-ASCII city name). Creates SYSTEM_DIR if needed, mirroring the pattern already used elsewhere (e.g. ForecaSetup.save in plugin.py). The offline list now builds up over time as users search, so City Selection's offline browsing (and search_offline's fallback) actually has something to work with after the fix in #4/#5. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a real crash reported after a fresh install, from the Enigma2 crash log:
city_panel.py:prepare_city_list()correctly detected a missingnew_city.cfgand opened a "file not found" warning, but then fell through into theopen()call unconditionally anyway, raisingFileNotFoundError(caught internally by the surroundingtry/except, so not fatal on its own, but pointless). Missingreturnafter showing the warning — added it, and also made the warning message point the user at the search feature instead.plugin.py: the actual crash. The warning MessageBox's callback (_close_panel) calledself.close()with no arguments.Foreca_Preview.city_selectedrequires a positionalresultargument with no default, so the callback dispatch itself raisedTypeError, which is what produced the blue-screen error (not theFileNotFoundError, which was already handled). Fixed both ends:_close_panelnow closes with an explicitNone(matchingcity_selected's existingif result is None: returnhandling), andcity_selectedgot aresult=Nonedefault so any other callback-with-no-args path can't hit the same crash.Note (not fixed here)
new_city.cfgis only ever read in the codebase, never written. README claims "the plugin create[s] it automatically during a search," but that mechanism doesn't actually exist — this is a documentation/feature gap, separate from the crash fixed in this PR.