The encoding argument has been available since Python 3.6. https://docs.python.org/3/library/subprocess.html#subprocess.run