On 3/2/2010 9:24 AM, Albert Hopkins wrote: > I have a snippet of code that looks like this: > > pid, fd = os.forkpty() > if pid == 0: > subprocess.call(args) > else: > input = os.fdopen(fd).read() > ... > > > This seems to work find for CPython 2.5 and 2.6 on my Linux system. To get help, or report a bug, for something like this, be as specific as possible. 'Linux' may be too generic. > However, with CPython 3.1 I get: > > input = os.fdopen(fd).read() > IOError: [Errno 5] Input/output error > > Is there something wrong in Python 3.1? Is this the correct way to do > this (run a process in a pseudo-tty and read it's output) or is there > another way I should/could be doing this? No idea, however, the first thing I would do is call the .fdopen and .read methods separately (on separate lines) to isolate which is raising the error. tjr
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4