fixed terminal encoding bug with exec
--HG-- branch : pmacs2
This commit is contained in:
parent
72bdc0915a
commit
9840cb4806
|
@ -30,6 +30,11 @@ class Exec(Method):
|
|||
result = p.wait()
|
||||
status = os.WEXITSTATUS(result)
|
||||
|
||||
try:
|
||||
output2 = output.decode('utf-8')
|
||||
except:
|
||||
output2 = output.decode('latin-1')
|
||||
|
||||
if not os.WIFEXITED(result) or status != 0:
|
||||
err = True
|
||||
msg = "failed to exec %r" % cmdname
|
||||
|
@ -37,9 +42,9 @@ class Exec(Method):
|
|||
err = False
|
||||
msg = "exec(%r): ok" % (cmdname,)
|
||||
|
||||
if output:
|
||||
if output2:
|
||||
switch_to = err or self.show_success
|
||||
w.application.data_buffer(bufname, output, switch_to=switch_to)
|
||||
w.application.data_buffer(bufname, output2, switch_to=switch_to)
|
||||
w.set_error(msg)
|
||||
|
||||
def _execute(self, w, **vargs):
|
||||
|
|
Loading…
Reference in New Issue