--- a/eric6/WebBrowser/Tools/WebIconProvider.py Tue Oct 13 19:02:26 2020 +0200 +++ b/eric6/WebBrowser/Tools/WebIconProvider.py Wed Oct 14 17:50:39 2020 +0200 @@ -88,9 +88,8 @@ filename = os.path.join(self.__iconDatabasePath, self.__iconsFileName) try: - f = open(filename, "r") - db = json.load(f) - f.close() + with open(filename, "r") as f: + db = json.load(f) except (IOError, OSError): # ignore silentyl db = {} @@ -122,9 +121,8 @@ filename = os.path.join(self.__iconDatabasePath, self.__iconsFileName) try: - f = open(filename, "w") - json.dump(db, f) - f.close() + with open(filename, "w") as f: + json.dump(db, f) except (IOError, OSError): # ignore silentyl pass