--- a/eric6/CondaInterface/CondaExportDialog.py Tue Oct 13 19:02:26 2020 +0200 +++ b/eric6/CondaInterface/CondaExportDialog.py Wed Oct 14 17:50:39 2020 +0200 @@ -183,9 +183,8 @@ return try: - f = open(fileName, "w") - f.write(self.requirementsEdit.toPlainText()) - f.close() + with open(fileName, "w") as f: + f.write(self.requirementsEdit.toPlainText()) except (OSError, IOError) as err: E5MessageBox.critical( self,