In Python 2.x, os.popen(command, "b") gives me a binary stream of the given command’s output. This is primarily important on Windows, where binary and text streams actually give you different bytes.
The subprocess module is supposed to replace os.popen and the other child-process spawning APIs. However, the conversion docs don’t talk about dealing with the “b” mode at all. How do you get a binary output stream using subprocess?
It does by default, unless you’re doing
Popen(..., universal_newlines=True).