[GRASS-SVN] r73945 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 16 06:21:30 PST 2019


Author: martinl
Date: 2019-01-16 06:21:30 -0800 (Wed, 16 Jan 2019)
New Revision: 73945

Modified:
   grass/trunk/lib/python/script/core.py
Log:
grass.core.find_program(): force bytes, see #3731

Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2019-01-16 13:15:49 UTC (rev 73944)
+++ grass/trunk/lib/python/script/core.py	2019-01-16 14:21:30 UTC (rev 73945)
@@ -1478,7 +1478,8 @@
     nuldev = open(os.devnull, 'w+')
     try:
         # TODO: the doc or impl is not correct, any return code is accepted
-        call([pgm] + list(args), stdin = nuldev, stdout = nuldev, stderr = nuldev)
+        cmd = list(map(lambda x: encode(x), [pgm] + list(args)))
+        call(cmd, stdin = nuldev, stdout = nuldev, stderr = nuldev)
         found = True
     except:
         found = False



More information about the grass-commit mailing list