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.
This commit is contained in:
@@ -233,7 +233,7 @@ class PlayerDict(dict):
|
|||||||
cls.uuid_cache = json.loads(gz.read().decode("utf-8"))
|
cls.uuid_cache = json.loads(gz.read().decode("utf-8"))
|
||||||
logging.info("Loaded UUID cache from %r with %d entries.",
|
logging.info("Loaded UUID cache from %r with %d entries.",
|
||||||
cache_file, len(cls.uuid_cache.keys()))
|
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.")
|
logging.warning("Failed to load UUID cache -- it might be corrupt.")
|
||||||
cls.uuid_cache = {}
|
cls.uuid_cache = {}
|
||||||
corrupted_cache = cache_file + ".corrupted." + datetime.datetime.now().isoformat()
|
corrupted_cache = cache_file + ".corrupted." + datetime.datetime.now().isoformat()
|
||||||
|
|||||||
Reference in New Issue
Block a user