From b6cff68d73eafffbf985cd213cd2318b720823d2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 2 Apr 2019 18:15:16 +0200 Subject: [PATCH] [fix] Do not miserably crash if status.json can't be decoded --- src/yunohost/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 3d33ab8ae..38df51ea0 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1773,12 +1773,18 @@ def _get_app_status(app_id, format_date=False): raise YunohostError('app_unknown') status = {} + regen_status = True try: with open(app_setting_path + '/status.json') as f: status = json.loads(str(f.read())) + regen_status = False except IOError: logger.debug("status file not found for '%s'", app_id, exc_info=1) + except Exception as e: + logger.warning("could not open or decode %s : %s ... regenerating.", app_setting_path + '/status.json', str(e)) + + if regen_status: # Create app status status = { 'installed_at': app_setting(app_id, 'install_time'),