Message20010
By running the following short program on Linux, you
can see the number of open file descriptors increase:
import os, pty
for i in range(10):
pty.spawn(['true'])
print len(os.listdir('/proc/%d/fd' % os.getpid()))
This can be fixed by os.close()'ing master_fd. This
problem seems to exist in CVS head as well as 2.3.
There are also a few changes that would be nice to see
in pty.spawn:
1) get the exit status of the child. Could be fixed by
adding the following to the end of the function:
pid, status = os.waitpid(pid, 0)
return status
2) set master_fd to non-blocking mode, so that the
output is printed to the screen at the speed it is
produced by the child. |
|
Date |
User |
Action |
Args |
2007-08-23 14:19:56 | admin | link | issue897935 messages |
2007-08-23 14:19:56 | admin | create | |
|