[paramiko] getting stdout and stderr together
james bardin
jbardin at bu.edu
Mon Nov 23 13:12:49 PST 2009
On Mon, Nov 23, 2009 at 1:26 PM, Todd Whiteman <toddw at activestate.com> wrote:
> Marcin Krol wrote:
>>
>> Hello,
>>
>> Is there any way to get standard output and standard error arranged
>> chronologically together in one text stream as they come from ssh server,
>> while doing connection_object.exec_command() of course?
>>
>> Sometimes you do want to separate standard output from standard error. But
>> sometimes you don't. Example: when I do the following command over paramiko:
>
> Hi Marcin,
>
> You can do this using the "set_combine_stderr" method on the Channel object:
> [http://www.lag.net/paramiko/docs/paramiko.Channel-class.html#set_combine_stderr]
>
Thanks.
Sorry Marcin, I completely forgot about that option.
> As James noted, the ordering is not 100% reliable - but it should be close
> enough.
>
Paramiko combines them at a fairly low level, so this should be pretty
close to what you would see on the host.
-jim
More information about the paramiko
mailing list