Why text I/O must be buffered in python 3?

io, python, python-3.x

Solution

This is an open bug, issue # 17404 (last update 2013-03-13): http://bugs.python.org/issue17404

Problem

Python 2 supported unbuffered text I/O. The same approach doesn't work in python 3. Why was unbuffered text I/O disabled? ``` > import sys > sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) builtins.ValueError: can't have unbuffered text I/O ``` The binary still works fine: ``` > sys.stdout = os.fdopen(sys.stdout.fileno(), 'wb', 0) # works fine ```

Original source