Skip to content

Commit

Permalink
wxGUI: fix RunCommand to decode also empty string to return unicode (#…
Browse files Browse the repository at this point in the history
…702)

* better to use decode from python scripting library
* fixes TypeError generated in loc wizard when changing page from epsg code to summary
  • Loading branch information
petrasovaa committed Jun 13, 2020
1 parent 19ea788 commit 884f986
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gui/wxpython/core/gcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 884f986

Please sign in to comment.