The top line of ansible-playbook (and other files in bin) start with this:
#!/usr/bin/env python
I am wondering if it is only me who wishes they started like this instead
#!/usr/bin/env python -u
Reason being, Python buffers output by default, and on some systems (or rather, being called from within another script), causes the output to not be displayed task by task, but randomly and in big chucks.
From the python man page:
-u Force stdin, stdout and stderr to be totally unbuffered. On systems where it matters, also put
stdin, stdout and stderr in binary mode. Note that there is internal buffering in xreadlines(),
readlines() and file-object iterators (“for line in sys.stdin”) which is not influenced by this
option. To work around this, you will want to use “sys.stdin.readline()” inside a “while 1:”
loop.
Now I have no idea if this is only a Python 2.7 thing, and how compatible it is with 2.6 and 3, but thought I would bring it up.
Thoughts?