[issue28647] python --help: -u is misdocumented as binary mode

Serhiy Storchaka report at bugs.python.org
Thu Oct 12 07:05:33 EDT 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

In Python 2 there is an internal buffering in xreadlines(), readlines() and file-object iterators. You need to enter many lines first that the program get the first of them. And -u doesn't help.

But in Python 3 the program gets the input right as it becomes available. Reading is not blocked if the input is available. There are internal buffers, but they affect only performance, not the behavior. If you can edit a line before pressing Enter, this is because your terminal buffers a line before sending it to the program. I think it is more correct to say that stdin is always unbuffered in Python 3.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28647>
_______________________________________


More information about the Python-bugs-list mailing list