diff -r 59a9a658618c -r 93b8a353c4bf eric6/Preferences/HighlightingStylesFile.py --- a/eric6/Preferences/HighlightingStylesFile.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/Preferences/HighlightingStylesFile.py Wed Apr 14 19:59:16 2021 +0200 @@ -83,7 +83,7 @@ jsonString = json.dumps(stylesDict, indent=2) with open(filename, "w") as f: f.write(jsonString) - except (TypeError, EnvironmentError) as err: + except (TypeError, OSError) as err: with E5OverridenCursor(): E5MessageBox.critical( None, @@ -111,7 +111,7 @@ with open(filename, "r") as f: jsonString = f.read() stylesDict = json.loads(jsonString) - except (EnvironmentError, json.JSONDecodeError) as err: + except (OSError, json.JSONDecodeError) as err: E5MessageBox.critical( None, self.tr("Import Highlighting Styles"),