From c388c2e0d0ddb6e68f4ac5ae075215cf6020a77f Mon Sep 17 00:00:00 2001 From: Frisk Date: Sat, 15 May 2021 12:11:56 +0200 Subject: [PATCH] Add handling for #209 --- src/misc.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/misc.py b/src/misc.py index af8ad53..f922c5d 100644 --- a/src/misc.py +++ b/src/misc.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with RcGcDw. If not, see . import base64 -import json, logging, sys, re +import json, logging, sys, re, platform from html.parser import HTMLParser from urllib.parse import urlparse, urlunparse import requests @@ -84,6 +84,15 @@ class DataFile: except PermissionError: misc_logger.critical("Could not modify a data file (no permissions). No way to store last edit.") sys.exit(1) + except OSError as e: + if settings.get("error_tolerance", 1) > 1: + if platform.system() == "Windows": + if "Invalid argument: 'data.json'" in str(e): + misc_logger.error("Saving the data file failed due to Invalid argument exception, we've seen it " + "before in issue #209, if you know the reason for it happening please reopen the " + "issue with explanation, for now we are going to just ignore it.") # Reference #209 + return + raise def __setitem__(self, instance, value): self.data[instance] = value