[GRASS-SVN] r41390 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 12 07:03:36 EST 2010


Author: martinl
Date: 2010-03-12 07:03:36 -0500 (Fri, 12 Mar 2010)
New Revision: 41390

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcmd.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
Log:
bugfix #995

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcmd.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcmd.py	2010-03-12 11:17:04 UTC (rev 41389)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcmd.py	2010-03-12 12:03:36 UTC (rev 41390)
@@ -520,7 +520,7 @@
         self.startTime = time.time()
         
         try:
-            self.module = Popen(self.cmd,
+            self.module = Popen(map(utils.EncodeString, self.cmd),
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE,

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2010-03-12 11:17:04 UTC (rev 41389)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2010-03-12 12:03:36 UTC (rev 41390)
@@ -17,6 +17,7 @@
 import os
 import sys
 import platform
+import locale
 
 import globalvar
 grassPath = os.path.join(globalvar.ETCDIR, "python")
@@ -331,3 +332,16 @@
         return path[1].upper() + ':\\' + path[3:].replace('/', '\\')
     
     return path
+
+def EncodeString(string):
+    """!Return encoded string
+
+    @param string string to be encoded
+
+    @return encoded string
+    """
+    enc = locale.getdefaultlocale()[1]
+    if enc:
+        return string.encode(enc)
+    
+    return string



More information about the grass-commit mailing list