Repository navigation
Offer to delete an unreadable config file instead of crashing - #667
Open
mirfalltnixein wants to merge 1 commit into
Open
mirfalltnixein wants to merge 1 commit into
mirfalltnixein wants to merge 1 commit into
Conversation
Fixes DavidoTek#361 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mirfalltnixein
force-pushed
the
fix-config-parse-error
branch
from
November 3, 2026 00:01
39443f6 to
d3b8cf2
Compare
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.
Fixes #361
A config file that
ConfigParsercan't parse, such as one withgithub_api_tokenset twice, crashes ProtonUp-Qt on startup at the first config read (apply_dark_theme→config_theme→read_update_config_value).This follows the plan from the issue: before that first read,
main()calls a newcheck_config_file(). If the file can't be parsed, it shows a warning with the parser's message (which names the option or section, the file and the line) and two buttons:The check runs once at startup, so the three places that read the config (
read_update_config_value,install_directory,config_custom_install_location) stay unchanged. It also covers the other parser errors, such as a duplicated section or a missing section header.Testing:
get_config_file_error(missing file, valid file, duplicate option, duplicate section, no section header). No Qt dialog test, after the feedback on Batch update: match Proton tool names case-insensitively #662.QT_QPA_PLATFORM=offscreen pytest -q: 172 passed.XDG_CONFIG_HOMEpointing at a config with a duplicatedgithub_api_token. Exit: the dialog appeared, ProtonUp-Qt exited and the file was kept. Delete config: the main window opened and a fresh default config was written.🤖 Generated with Claude Code