local() raises an UnboundLocalError if output.stdout or output.stderr is unset #301

bitprophet opened this Issue Aug 19, 2011 · 2 comments


None yet

1 participant



import fabric.api as fabric

fabric.output.stdout = False

print fabric.local('ls')


[localhost] local: ls
Traceback (most recent call last):
  File "quick.py", line 5, in 
    print fabric.local('ls')
  File "/Users/crose/virtualenv/release/lib/python2.7/site-packages/fabric/operations.py", line 1001, in local
    p = subprocess.Popen([wrapped_command], shell=True, stdout=out_stream,
UnboundLocalError: local variable 'out_stream' referenced before assignment

Originally submitted by Eric Hanchrow (offby1) on 2011-03-05 at 12:36pm EST

Closed as Done on 2011-03-05 at 02:05pm EST

@bitprophet bitprophet was assigned Aug 19, 2011

Eric Hanchrow (offby1) posted:

It's worth noting that I see this in non-trivial code; I have a few cases where I suppress stdout/stderr in local() calls that previously captured output by default.

on 2011-03-05 at 12:44pm EST


Jeff Forcier (bitprophet) posted:

Applied in changeset commit:834ace42deb0381c8d036689ff2c25c551649a38.

on 2011-03-05 at 02:05pm EST

@bitprophet bitprophet closed this Aug 19, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment