From cde64139d499ad478548b82d737052090a84e9ec Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 6 May 2016 09:41:48 +0200 Subject: [PATCH] =?utf8?q?Support=20=C3=A4=C3=B6=C3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- exec.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exec.py b/exec.py index 8efb444..c7277ba 100644 --- a/exec.py +++ b/exec.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import os import re import subprocess @@ -56,19 +57,17 @@ class Exec(BotPlugin): """ Execute the commmand """ - for part in ("abc"): - print "part: ", part try: output = subprocess.check_output( - [self.config['command'], str(msg), str(msg.frm)], + [self.config['command'], unicode(msg.body), unicode(msg.frm)], stderr=subprocess.STDOUT ) if len(output) > 0: - return output + return unicode(output, 'utf-8') else: return "OK\n" except subprocess.CalledProcessError as err: if len(err.output): - return err.output + return unicode(err.output, 'utf-8') else: - return "Error" + return "Error" -- 2.30.2