Paramiko wasn't using binary mode for stdout and stderr.