[GRASS-SVN] r64335 - grass/trunk/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 27 08:21:39 PST 2015
Author: annakrat
Date: 2015-01-27 08:21:38 -0800 (Tue, 27 Jan 2015)
New Revision: 64335
Modified:
grass/trunk/lib/init/grass.py
Log:
startup: attempt to fix #2552 by encoding string
Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py 2015-01-27 08:33:32 UTC (rev 64334)
+++ grass/trunk/lib/init/grass.py 2015-01-27 16:21:38 UTC (rev 64335)
@@ -70,7 +70,9 @@
grass_gui = None
exit_grass = None
force_gislock_removal = None
+encoding = None
+
def warning(text):
sys.stderr.write(_("WARNING") + ': ' + text + os.linesep)
@@ -776,7 +778,7 @@
import locale
language = 'None' # Such string sometimes is present in wx file
- encoding = None
+ global encoding
# Override value is stored in wxGUI preferences file.
# As it's the only thing required, we'll just grep it out.
@@ -1124,7 +1126,7 @@
else:
f.write("PS1='GRASS %s (%s):\w > '\n" % (grass_version, location_name))
- f.write("""grass_prompt() {
+ f.write(("""grass_prompt() {
LOCATION="`g.gisenv get=GISDBASE,LOCATION_NAME,MAPSET separator='/'`"
if test -d "$LOCATION/grid3/G3D_MASK" && test -f "$LOCATION/cell/MASK" ; then
echo [%s]
@@ -1136,7 +1138,7 @@
}
PROMPT_COMMAND=grass_prompt\n""" % (_("2D and 3D raster MASKs present"),
_("Raster MASK present"),
- _("3D raster MASK present")))
+ _("3D raster MASK present"))).encode(encoding))
# read environmental variables
path = os.path.join(userhome, ".grass.bashrc") # left for backward compatibility
More information about the grass-commit
mailing list