PyLint/PyLintExecDialog.py

changeset 22
68beeb22dade
parent 20
8ca799e4b7e4
child 24
b01348dd84d5
--- a/PyLint/PyLintExecDialog.py	Sun Apr 14 14:46:14 2013 +0200
+++ b/PyLint/PyLintExecDialog.py	Thu Sep 26 22:53:14 2013 +0200
@@ -7,6 +7,12 @@
 Module implementing a dialog to show the results of the PyLint run.
 """
 
+from __future__ import unicode_literals    # __IGNORE_WARNING__
+try:
+    str = unicode
+except (NameError):
+    pass
+
 import os
 
 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot
@@ -361,8 +367,10 @@
                 return
         
         try:
-            f = open(self.reportFile, 'w')
-            f.write(self.buf)
+            import codecs
+            f = open(self.reportFile, 'wb')
+            f.write(codecs.BOM_UTF8)
+            f.write(self.buf.encode('utf-8'))
             f.close()
         except IOError as why:
             E5MessageBox.critical(self, self.trUtf8('PyLint Report'),
@@ -385,7 +393,6 @@
             self.trUtf8("PyLint Report"),
             self.ppath,
             filter,
-            None,
             E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
         if self.reportFile:
             self.__writeReport()

eric ide

mercurial