[GRASS-dev] [GRASS GIS] #3838: r74307 breaks GUI: UnicodeDecodeError
GRASS GIS
trac at osgeo.org
Thu May 16 05:59:05 PDT 2019
#3838: r74307 breaks GUI: UnicodeDecodeError
--------------------------+-------------------------
Reporter: marisn | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords:
CPU: Unspecified | Platform: Linux
--------------------------+-------------------------
Comment (by pmav99):
Dear Maris
Could you please try the following patch:
{{{
index 1183e93b..0bd515b2 100644
--- lib/python/__init__.py
+++ lib/python/__init__.py
@@ -1,6 +1,8 @@
import gettext
import os
+import six
+
# Setup i18N
#
# Calling `gettext.install()` injects `_()` in the builtins namespace and
@@ -17,9 +19,14 @@ import os
# - https://www.wefearchange.org/2012/06/the-right-way-to-
internationalize-your.html
#
_LOCALE_DIR = os.path.join(os.getenv("GISBASE"), 'locale')
-gettext.install('grasslibs', _LOCALE_DIR)
-gettext.install('grassmods', _LOCALE_DIR)
-gettext.install('grasswxpy', _LOCALE_DIR)
+if six.PY2:
+ gettext.install('grasslibs', _LOCALE_DIR, unicode=True)
+ gettext.install('grassmods', _LOCALE_DIR, unicode=True)
+ gettext.install('grasswxpy', _LOCALE_DIR, unicode=True)
+else:
+ gettext.install('grasslibs', _LOCALE_DIR)
+ gettext.install('grassmods', _LOCALE_DIR)
+ gettext.install('grasswxpy', _LOCALE_DIR)
__all__ = ["script", "temporal"]
}}}
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3838#comment:11>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list