Prechádzať zdrojové kódy

grass.core.find_program(): force bytes, see https://trac.osgeo.org/grass/ticket/3731

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73945 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 6 rokov pred
rodič
commit
545d9699aa
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      lib/python/script/core.py

+ 2 - 1
lib/python/script/core.py

@@ -1478,7 +1478,8 @@ def find_program(pgm, *args):
     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