diff -r 59a9a658618c -r 93b8a353c4bf eric6/Sessions/SessionFile.py --- a/eric6/Sessions/SessionFile.py Wed Apr 14 19:38:19 2021 +0200 +++ b/eric6/Sessions/SessionFile.py Wed Apr 14 19:59:16 2021 +0200 @@ -226,7 +226,7 @@ jsonString = json.dumps(sessionDict, 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, @@ -253,7 +253,7 @@ with open(filename, "r") as f: jsonString = f.read() sessionDict = json.loads(jsonString) - except (EnvironmentError, json.JSONDecodeError) as err: + except (OSError, json.JSONDecodeError) as err: E5MessageBox.critical( None, self.tr("Read Session"),