瀏覽代碼

wxGUI: fix RunCommand to decode also empty string to return unicode (#702)

* better to use decode from python scripting library
* fixes TypeError generated in loc wizard when changing page from epsg code to summary
Anna Petrasova 4 年之前
父節點
當前提交
884f986caf
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      gui/wxpython/core/gcmd.py

+ 3 - 1
gui/wxpython/core/gcmd.py

@@ -716,7 +716,9 @@ def RunCommand(prog, flags="", overwrite=False, quiet=False,
         ps.stdin.close()
         ps.stdin = None
 
-    stdout, stderr = list(map(DecodeString, ps.communicate()))
+    stdout, stderr = ps.communicate()
+    stderr = decode(stderr)
+    stdout = decode(stdout) if read else stdout
 
     if parent:  # restore previous settings
         os.environ['GRASS_MESSAGE_FORMAT'] = messageFormat