[GRASS-SVN] r58902 - grass/trunk/lib/python/pygrass/modules/interface

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 6 08:54:24 PST 2014


Author: annakrat
Date: 2014-02-06 08:54:24 -0800 (Thu, 06 Feb 2014)
New Revision: 58902

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/module.py
Log:
pygrass: fix launching modules - shell=True needed (see #2189)

Modified: grass/trunk/lib/python/pygrass/modules/interface/module.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/module.py	2014-02-06 16:51:02 UTC (rev 58901)
+++ grass/trunk/lib/python/pygrass/modules/interface/module.py	2014-02-06 16:54:24 UTC (rev 58902)
@@ -53,6 +53,7 @@
 from itertools import izip_longest
 from xml.etree.ElementTree import fromstring
 import time
+import sys
 
 
 from grass.pygrass.errors import GrassError, ParameterError
@@ -241,7 +242,8 @@
         try:
             # call the command with --interface-description
             get_cmd_xml = subprocess.Popen([cmd, "--interface-description"],
-                                           stdout=subprocess.PIPE)
+                                           stdout=subprocess.PIPE,
+                                           shell=(sys.platform == "win32"))
         except OSError as e:
             print("OSError error({0}): {1}".format(e.errno, e.strerror))
             str_err = "Error running: `%s --interface-description`."
@@ -468,7 +470,8 @@
                                       stdin=self.stdin_,
                                       stdout=self.stdout_,
                                       stderr=self.stderr_,
-                                      env=self.env_)
+                                      env=self.env_,
+                                      shell=(sys.platform == "win32"))
         if self.finish_:
             stdout, stderr = self.popen.communicate(input=self.stdin)
             self.outputs['stdout'].value = stdout if stdout else ''



More information about the grass-commit mailing list