Skip to content

Commit 3f50e83

Browse files
committedNov 24, 2016
[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.
1 parent 3312052 commit 3f50e83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎python/plugins/processing/algs/help/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
__revision__ = '$Format:%H$'
2525

2626
import os
27+
import codecs
2728
import yaml
2829
from qgis.core import Qgis, QgsWkbTypes
2930
from qgis.PyQt.QtCore import QSettings, QLocale
@@ -35,7 +36,7 @@ def loadShortHelp():
3536
for f in os.listdir(path):
3637
if f.endswith("yaml"):
3738
filename = os.path.join(path, f)
38-
with open(filename) as stream:
39+
with codecs.open(filename, encoding='utf-8') as stream:
3940
h.update(yaml.load(stream))
4041
version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2])
4142
overrideLocale = QSettings().value('locale/overrideFlag', False, bool)

0 commit comments

Comments
 (0)
Please sign in to comment.