From 3f50e8356e0c52c811aecf9f81db470161f7a145 Mon Sep 17 00:00:00 2001 From: Larry Shaffer Date: Thu, 24 Nov 2016 09:40:22 -0700 Subject: [PATCH] [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. --- python/plugins/processing/algs/help/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/plugins/processing/algs/help/__init__.py b/python/plugins/processing/algs/help/__init__.py index ec4843cd93a..5591eef6dd1 100644 --- a/python/plugins/processing/algs/help/__init__.py +++ b/python/plugins/processing/algs/help/__init__.py @@ -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)