Running remote command with fabric doesn't separate stdout and stderr streams
Question: I have a python file like so in my home directory

    
    
    import sys
    
    sys.stdout.write('THIS IS STDOUT\n')
    sys.stdout.flush()
    sys.stderr.write('THIS IS STDERR\n')
    sys.stderr.flush()
    

When I run this python file, I get output to stdout/stderr as expected.

Now, I have the following fabfile:

    
    
    from fabric.api import run, task
    
    @task
    def my_task(cmd):
        run(cmd)
    

When I run the task, both lines get reported as coming from stdout:

    
    
    $ fab --host localhost my_task:'python foo.py'
    [localhost] Executing task 'my_task'
    [localhost] run: python foo.py
    [localhost] out: THIS IS STDOUT
    [localhost] out: THIS IS STDERR
    [localhost] out: 
    
    
    Done.
    Disconnecting from localhost... done.
    

Why does fabric pipe stderr into stdout? Looking
[here](https://github.com/fabric/fabric/blob/master/fabric/io.py#L44) stderr
lines should get `err:` prepended to them, not `out`. Moreover, adding some
debugging statements in there I can see that there is an object set up to
watch `stderr`; however it's just not getting any data. Is there a way to
change this so that the error lines get `err:` in front of them?


Answer: Just disable `combine_stderr`:

    
    
    run(cmd, combine_stderr=False)
    

