--- a/eric6/ViewManager/ViewManager.py Tue Oct 13 19:02:26 2020 +0200 +++ b/eric6/ViewManager/ViewManager.py Wed Oct 14 17:50:39 2020 +0200 @@ -6583,9 +6583,8 @@ """ if os.path.exists(dictionaryFile): try: - f = open(dictionaryFile, "r", encoding="utf-8") - data = f.read() - f.close() + with open(dictionaryFile, "r", encoding="utf-8") as f: + data = f.read() except (IOError, OSError) as err: E5MessageBox.critical( self.ui, @@ -6613,9 +6612,8 @@ if dlg.exec() == QDialog.Accepted: data = dlg.getData() try: - f = open(dictionaryFile, "w", encoding="utf-8") - f.write(data) - f.close() + with open(dictionaryFile, "w", encoding="utf-8") as f: + f.write(data) except (IOError, OSError) as err: E5MessageBox.critical( self.ui,