json.DecodeError does not exist.
One of a few bugs:
if os.path.exists(path):
with open(path, "r") as f:
try:
data = json.load(f)
except json.DecodeError: # this is wrong
Should be json.JSONDecodeError