380 try: |
380 try: |
381 import codecs |
381 import codecs |
382 with open(self.reportFile, 'wb') as f: |
382 with open(self.reportFile, 'wb') as f: |
383 f.write(codecs.BOM_UTF8) |
383 f.write(codecs.BOM_UTF8) |
384 f.write(self.buf.encode('utf-8')) |
384 f.write(self.buf.encode('utf-8')) |
385 except IOError as why: |
385 except OSError as why: |
386 E5MessageBox.critical( |
386 E5MessageBox.critical( |
387 self, self.tr('PyLint Report'), |
387 self, self.tr('PyLint Report'), |
388 self.tr('<p>The PyLint report file <b>{0}</b> could not' |
388 self.tr('<p>The PyLint report file <b>{0}</b> could not' |
389 ' be written.<br>Reason: {1}</p>') |
389 ' be written.<br>Reason: {1}</p>') |
390 .format(self.reportFile, str(why))) |
390 .format(self.reportFile, str(why))) |