avoid unicode error

changed str() to unicode() to fix unicode errors.
This commit is contained in:
topic2k
2015-03-28 20:09:26 +01:00
parent 50e5ff205d
commit f93d7dd227

View File

@@ -783,10 +783,10 @@ class PersistenceManager(object):
kind = repr(value.__class__).split("'")[1]
if self._customConfigHandler is not None:
result = self._customConfigHandler.SaveValue(self.GetKey(obj, keyName), repr((kind, str(value))))
result = self._customConfigHandler.SaveValue(self.GetKey(obj, keyName), repr((kind, unicode(value))))
else:
config = self.GetPersistenceFile()
result = config.Write(self.GetKey(obj, keyName), repr((kind, str(value))))
result = config.Write(self.GetKey(obj, keyName), repr((kind, unicode(value))))
config.Flush()
return result