Message101587
In the current state of affaires this is more of a documentation issue.
Python 3 doesn't support totally unbuffered text I/O (and standard streams are open in text mode). What `-u` and PYTHONUNBUFFERED do is that the binary layer of standard streams is unbuffered, but the text layer is still line-buffered (if in a tty).
"python --help" gives you an accurate description:
-u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x
see man page for details on internal buffering relating to '-u'
Also, you can try out:
python3 -u -c 'import time, sys; sys.stdout.buffer.write(b"b"); time.sleep(1); sys.stdout.buffer.write(b"\n")'
To explicitly flush the text layer, you can use the flush() method. |
|
Date |
User |
Action |
Args |
2010-03-23 15:33:54 | pitrou | set | recipients:
+ pitrou, vstinner, noam |
2010-03-23 15:33:51 | pitrou | set | messageid: <1269358431.68.0.938924989029.issue8213@psf.upfronthosting.co.za> |
2010-03-23 15:33:50 | pitrou | link | issue8213 messages |
2010-03-23 15:33:49 | pitrou | create | |
|