comparison frontends/src/jp/cmd_pubsub.py @ 2320:f4a0723042ee

jp (pubsub/search): fixed encoding for stdin in external commands
author Goffi <goffi@goffi.org>
date Sun, 09 Jul 2017 15:20:31 +0200
parents ddb67c186f61
children d94e932be8b3
comparison
equal deleted inserted replaced
2319:e715a29c4f9b 2320:f4a0723042ee
700 command = u' '.join([arg_tools.escape(a) for a in cmd_args])), 2) 700 command = u' '.join([arg_tools.escape(a) for a in cmd_args])), 2)
701 if action == u'exec': 701 if action == u'exec':
702 ret = subprocess.call(cmd_args) 702 ret = subprocess.call(cmd_args)
703 else: 703 else:
704 p = subprocess.Popen(cmd_args, stdin=subprocess.PIPE) 704 p = subprocess.Popen(cmd_args, stdin=subprocess.PIPE)
705 p.communicate(item) 705 p.communicate(item.encode('utf-8'))
706 ret = p.wait() 706 ret = p.wait()
707 if ret != 0: 707 if ret != 0:
708 self.disp(A.color(C.A_FAILURE, _(u"executed command failed with exit code {code}").format(code=ret))) 708 self.disp(A.color(C.A_FAILURE, _(u"executed command failed with exit code {code}").format(code=ret)))
709 709
710 def search(self, items_data, depth): 710 def search(self, items_data, depth):