jp (pubsub/search): fixed encoding for stdin in external commands

This commit is contained in:
Goffi 2017-07-09 15:20:31 +02:00
commit 1d3680445d

View file

@ -702,7 +702,7 @@ class Search(base.CommandBase):
ret = subprocess.call(cmd_args)
else:
p = subprocess.Popen(cmd_args, stdin=subprocess.PIPE)
p.communicate(item)
p.communicate(item.encode('utf-8'))
ret = p.wait()
if ret != 0:
self.disp(A.color(C.A_FAILURE, _(u"executed command failed with exit code {code}").format(code=ret)))