From 79a5668bd2dfb00bc60c8b73c0eabd1adc0651fe Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Sat, 26 Oct 2019 02:41:56 +0200 Subject: [PATCH] genPOI: handle more uuidcache.dat corruption Apparently the gzip stream can be malformed in a way where it does read it, but then throws an EOFError when it abruptly ends. Catch this so we don't error out. --- overviewer_core/aux_files/genPOI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 90d9ee7..f85fff0 100755 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -233,7 +233,7 @@ class PlayerDict(dict): cls.uuid_cache = json.loads(gz.read().decode("utf-8")) logging.info("Loaded UUID cache from %r with %d entries.", cache_file, len(cls.uuid_cache.keys())) - except (ValueError, IOError): + except (ValueError, IOError, EOFError): logging.warning("Failed to load UUID cache -- it might be corrupt.") cls.uuid_cache = {} corrupted_cache = cache_file + ".corrupted." + datetime.datetime.now().isoformat()