Skip to content
Permalink
Browse files
[processing] small fix for non-ascii string (fixes #9175)
  • Loading branch information
slarosa committed Jan 11, 2014
1 parent 1bca310 commit d04239d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
@@ -26,6 +26,8 @@
__revision__ = '$Format:%H$'

import pickle
import codecs
import sys

from PyQt4.QtCore import *
from PyQt4.QtGui import *
@@ -152,12 +154,11 @@ def saveScript(self, saveAs):
if self.alg is not None:
self.alg.script = text
try:
fout = open(self.filename, 'w')
fout.write(text)
fout.close()
with codecs.open(self.filename, 'w', encoding='utf-8') as fout:
fout.write(text)
except IOError:
QMessageBox.warning(self, self.tr('I/O error'),
self.tr('Unable to save edits. Reason:\n %1')
self.tr('Unable to save edits. Reason:\n %s')
% unicode(sys.exc_info()[1]))
return
self.update = True
@@ -254,7 +254,7 @@ def processAlgorithm(self, progress):
out.setValue(ns[out.name])

def helpFile(self):
helpfile = unicode(self.descriptionFile) + '.help'
helpfile = self.descriptionFile + '.help'
if os.path.exists(helpfile):
h2h = Help2Html()
return h2h.getHtmlFile(self, helpfile)

0 comments on commit d04239d

Please sign in to comment.