Hirokazu Yamamoto <ocean-c...@m2.ccsnet.ne.jp> added the comment: This OSError(5) happens when we tries to read from pty after data runs out. So simple_test_2.py fails with same error even if we don't use io module.
Modules/posixmodule.c (posix_read) simply calls read(2) once, but io module while avail < n: chunk = self.raw.read(wanted) if chunk in empty_values: nodata_val = chunk break avail += len(chunk) chunks.append(chunk) chunk is shorter than wanted (data runs out), but not empty, so io module's read tries to read again => error happens. I said this is io module's bug, but now I'm not sure. Added file: http://bugs.python.org/file13203/simple_test_2.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5380> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com