[processing] Ensure reading of shortHelp yaml files as UTF-8

On macOS 10.11 with Py 3.5.2, .yaml files defaulted to ASCII and failed.
This commit is contained in:
Larry Shaffer 2016-11-24 09:40:22 -07:00
parent 33120528d0
commit 3f50e8356e

View File

@ -24,6 +24,7 @@ __copyright__ = '(C) 2016, Victor Olaya'
__revision__ = '$Format:%H$'
import os
import codecs
import yaml
from qgis.core import Qgis, QgsWkbTypes
from qgis.PyQt.QtCore import QSettings, QLocale
@ -35,7 +36,7 @@ def loadShortHelp():
for f in os.listdir(path):
if f.endswith("yaml"):
filename = os.path.join(path, f)
with open(filename) as stream:
with codecs.open(filename, encoding='utf-8') as stream:
h.update(yaml.load(stream))
version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2])
overrideLocale = QSettings().value('locale/overrideFlag', False, bool)