Skip to content

Commit

Permalink
[processing] Ensure reading of shortHelp yaml files as UTF-8
Browse files Browse the repository at this point in the history
On macOS 10.11 with Py 3.5.2, .yaml files defaulted to ASCII and failed.
  • Loading branch information
dakcarto committed Nov 24, 2016
1 parent 3312052 commit 3f50e83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/help/__init__.py
Expand Up @@ -24,6 +24,7 @@
__revision__ = '$Format:%H$'

import os
import codecs
import yaml
from qgis.core import Qgis, QgsWkbTypes
from qgis.PyQt.QtCore import QSettings, QLocale
Expand All @@ -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)
Expand Down

0 comments on commit 3f50e83

Please sign in to comment.