diff -r db1f004f14ca -r 8acd446fb6e6 PyLint/PyLintExecDialog.py --- a/PyLint/PyLintExecDialog.py Wed Oct 07 19:33:10 2020 +0200 +++ b/PyLint/PyLintExecDialog.py Wed Oct 14 19:46:35 2020 +0200 @@ -378,10 +378,9 @@ try: import codecs - f = open(self.reportFile, 'wb') - f.write(codecs.BOM_UTF8) - f.write(self.buf.encode('utf-8')) - f.close() + with open(self.reportFile, 'wb') as f: + f.write(codecs.BOM_UTF8) + f.write(self.buf.encode('utf-8')) except IOError as why: E5MessageBox.critical( self, self.tr('PyLint Report'),