Lichen

tests/read.py

343:e0879c83a439
2016-12-07 Paul Boddie Added support for reading to the end of a stream's input, fixing EOFError raising in fread by returning shorter amounts of data when EOF occurs, only raising an exception if no data was read before EOF occurred. Made the test input longer to exercise tests of reading remaining data.
     1 from posix import read     2      3 try:     4     s = read(3, 10)     5 except IOError, exc:     6     print "read(3, 10): input/output error condition", exc.value     7      8 s = read(0, 10)     9 print s