**Can someone answer my question under the only answer? **
I want to use subprocess and be able to read its output, so I used:
subprocess.check_output
But this wasn't enough for me, I wanted to hide writing to stderror so I added:
stderr=subprocess.DEVNULL
Which wasn't helpful as some commands now have the following output:
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['snmpwalk', '-t', '1', '-r', '1', '-v', '3', '-c', 'public', '31.208.215.122', '1.3.6.1.2.1.1.2.0']' returned non-zero exit status 1.
How can I fix this without try-catch (I don't want to harm performance as I am calling this code thousands of times)?
snmpwalkprogram.encoding="utf-8"is a safe choice for UNIX programs, in general.encoding=encodings.utf_8doesn't work @AKXencoding="utf-8".