Redirecting output from Fabric

August 16, 2011
Current (1.2.0) release of Fabric doesn't have any logging implemented, which means usual redirects like this one won't work:

$ fab dummy > outfile
IOError: [Errno 25] Inappropriate ioctl for device
Piping doesn't work either:

$ fab dummy | less
IOError: [Errno 22] Invalid argument
Current workaround is to pass pty=False to your function. Example:

def dummy():
  run('cat /proc/loadavg', pty=False)