misc: load config.pck as utf-8 (#37976)

This commit is contained in:
Frédéric Péters 2019-11-26 16:35:40 +01:00
parent 73088ea36e
commit 0463cadea1
1 changed files with 4 additions and 1 deletions

View File

@ -704,7 +704,10 @@ class QommonPublisher(Publisher, object):
def reload_cfg(self):
filename = os.path.join(self.app_dir, 'config.pck')
try:
self.cfg = cPickle.load(open(filename, 'rb'))
if six.PY3:
self.cfg = cPickle.load(open(filename, 'rb'), encoding='utf-8')
else:
self.cfg = cPickle.load(open(filename, 'rb'))
except:
self.cfg = {}