Message304231
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. |
|
Date |
User |
Action |
Args |
2017-10-12 13:15:16 | vstinner | set | recipients:
+ vstinner, ncoghlan, gdr@garethrees.org, berker.peksag, serhiy.storchaka, eryksun |
2017-10-12 13:15:16 | vstinner | set | messageid: <1507814116.05.0.213398074469.issue28647@psf.upfronthosting.co.za> |
2017-10-12 13:15:16 | vstinner | link | issue28647 messages |
2017-10-12 13:15:16 | vstinner | create | |
|