I have a piece of code that does this:
def command(self, s, level=1):
sub=subprocess.Popen(s, bufsize=0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True);
(out, err) = sub.communicate()
I see this error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbe in position 2: invalid start byte
when I try to call the communicate method. The subprocess popen is reading as strings.
In a working condition it should return a tuple (stdoutdata, stderrdata)