[pypy-issue] [issue956] os.fdopen() is broken with fds returned by os.openpty()

Nirbheek Chauhan tracker at bugs.pypy.org
Wed Dec 7 02:05:51 CET 2011


New submission from Nirbheek Chauhan <nirbheek.chauhan at gmail.com>:

$title, test case attached.

Open a pair of fds using os.openpty():

* os.read() from the master pty fd works fine
* os.fdopen().read() from the master pty fd FAILS with IOError

Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "test_pty_fdopen.py", line 36, in <module>
    print(test_pty_fdopen())
  File "test_pty_fdopen.py", line 28, in test_pty_fdopen
    return test_string == master_file.read()
IOError: [Errno 5] Input/output error: '<fdopen>'

However, os.fdopen().read() from ordinary files opened using os.open() works
fine, so it only manifests itself while using fdopen on openpty fds.

----------
files: test_pty_fdopen.py
messages: 3547
nosy: nirbheek, pypy-issue
priority: bug
release: 1.7
status: unread
title: os.fdopen() is broken with fds returned by os.openpty()

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue956>
________________________________________


More information about the pypy-issue mailing list