Browse Source

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 năm trước cách đây
mục cha
commit
545d9699aa
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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