This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients berker.peksag, eryksun, gdr@garethrees.org, ncoghlan, serhiy.storchaka, vstinner
Date 2017-10-12.13:15:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507814116.05.0.213398074469.issue28647@psf.upfronthosting.co.za>
In-reply-to
Content
Serhiy: "(...) I think it is more correct to say that stdin is always unbuffered in Python 3."

I disagree. Technically, sys.stdin.read(1) reads up to 1024 bytes from the file descriptor 0. For me, "unbuffered read" means that read(1) reads a single byte.

Expected behaviour of an fully unbuffered stdin:

assert sys.stdin.read(1) == 'a'
assert os.read(0, 1) == b'b'

The program should not fail with an assertion error nor block if you write 'ab' characters into stdin.
History
Date User Action Args
2017-10-12 13:15:16vstinnersetrecipients: + vstinner, ncoghlan, gdr@garethrees.org, berker.peksag, serhiy.storchaka, eryksun
2017-10-12 13:15:16vstinnersetmessageid: <1507814116.05.0.213398074469.issue28647@psf.upfronthosting.co.za>
2017-10-12 13:15:16vstinnerlinkissue28647 messages
2017-10-12 13:15:16vstinnercreate