New submission from Zac Medico <zmed...@gentoo.org>: With python-3.0, array.fromfile() raises an IOError when reading from a master pty device after the slave device has been closed. This causes remaining data that had been written to the slave device to be lost. I have observed this problem with python-3.0.1 on linux (I get the same result with or without the patch from issue 5334). The traceback produced by the attached test case looks like this:
Traceback (most recent call last): File "./fromfile_pty_ioerror.py", line 26, in <module> buf.fromfile(master_file, bufsize) File "/usr/lib/python3.0/io.py", line 918, in read return self._read_unlocked(n) File "/usr/lib/python3.0/io.py", line 952, in _read_unlocked chunk = self.raw.read(wanted) IOError: [Errno 5] Input/output error With python-2.x, the remaining data is appended to the array and an EOFError is raised like one would expect. ---------- components: Library (Lib) files: fromfile_pty_ioerror.py messages: 82824 nosy: zmedico severity: normal status: open title: array.fromfile() on master pty raises IOError when slave pty device is closed type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file13200/fromfile_pty_ioerror.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