diff options
author | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2024-01-03 21:21:53 +0000 |
---|---|---|
committer | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2024-01-03 21:30:52 +0000 |
commit | 50158a1fc9b4dd47a7bef70d34fbb0b30d5e8b47 (patch) | |
tree | cd2d2df144329ca68d7fe3dccc9316e88ba3e158 /modules/launch_utils.py | |
parent | 04a005f0e98ebade44b33237bf4ccaa64f12600a (diff) | |
download | stable-diffusion-webui-gfx803-50158a1fc9b4dd47a7bef70d34fbb0b30d5e8b47.tar.gz stable-diffusion-webui-gfx803-50158a1fc9b4dd47a7bef70d34fbb0b30d5e8b47.tar.bz2 stable-diffusion-webui-gfx803-50158a1fc9b4dd47a7bef70d34fbb0b30d5e8b47.zip |
handle config.json failed to load
Diffstat (limited to 'modules/launch_utils.py')
-rw-r--r-- | modules/launch_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/launch_utils.py b/modules/launch_utils.py index c2cbd8ce..e2ad412a 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -249,7 +249,9 @@ def list_extensions(settings_file): with open(settings_file, "r", encoding="utf8") as file:
settings = json.load(file)
except Exception:
- errors.report("Could not load settings", exc_info=True)
+ errors.report(f'\nCould not load settings\nThe config file "{settings_file}" is likely corrupted\nIt has been moved to the "tmp/config.json"\nReverting config to default\n\n''', exc_info=True)
+ os.replace(settings_file, os.path.join(script_path, "tmp", "config.json"))
+ settings = {}
disabled_extensions = set(settings.get('disabled_extensions', []))
disable_all_extensions = settings.get('disable_all_extensions', 'none')
|