[issue4705] python3.0 -u: unbuffered stdout

Antoine Pitrou report at bugs.python.org
Sun Dec 28 11:27:50 CET 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

> pitrou's patch changes PyFile_FromFd() behaviour for a text file 
> opened with buffering=0:
>   /* As a convenience, when buffering == 0 on a text file, we
>      open the underlying binary stream in unbuffered mode and
>      wrap it with a text stream in line-buffered mode. */
> 
> Why changing PyFile_FromFd() and not io.open() directly?

I must admit I'm a bit lazy, and changing io.open() means changing a
fundamental public API, as Guido said on python-dev, so more discussion
and some parts of the patches delayed to 3.1. If someone else wants to
do it, please don't hesitate...

> Note: I prefer Py_UnbufferedStdoutFlag=1 instead of 
> Py_UnbufferedStdoutFlag++ (for -u command line option).

Well, I minimally changed the existing code.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4705>
_______________________________________


More information about the Python-bugs-list mailing list