Then, I was happy to see a change to python3, I were thinking yay, the end of encoding problems!
Today, I’ve had this code:
stdout, stderr = process.communicate()
and stdout, stderr can contain invalid characters… then with this:
[/code]
stdout, stderr = process.communicate()
stdout = stdout.decode('utf-8', 'ignore');
You may fix it, by converting and ignoring these bad chars.
You need to remove
universal_newlines=True
from the call to subprocess.Popen(
if not, process.communicate will raise an internal python error
my locale is cp1252 and I can’t change it.
{2cents}
