Bugs item #933670, was opened at 2004-04-12 10:21
Message generated for change (Comment added) made by dmeranda
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=933670&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Scott Lowrey (slowrey)
Assigned to: Nobody/Anonymous (nobody)
Summary: pty.fork() leaves slave fd's open on Solaris

Initial Comment:
On a Solaris 2.8 system, slave file descriptors are
left open after the child process is gone and the
master has been closed.

The pty.fork() function attempts to use os.forkpty()
first.  When that fails (apparently the os module does
not provide forkpty() on Solaris?), it uses openpty()
and os.fork().  openpty() returns master and slave file
descriptors.  Since pty.fork() only returns the
master_fd, it is not clear to me how the slave would
ever be closed since the caller doesn't have access to
it.  Perhaps pty.fork is supposed to take care of this?

I am using pexpect to control my pty's, so I don't have
much expertise in this area other than what I've
gleaned from the code.
At any rate, on a long running process used to test
other programs, the open file descriptors pile up until
the ulimit is reached.  I've worked around this by
modifying pexpect.close() to use os.close(self.child_fd
+ 1).  A hack, I'm sure... :)

----------------------------------------------------------------------

Comment By: Deron Meranda (dmeranda)
Date: 2007-01-31 16:00

Message:
Logged In: YES 
user_id=847188
Originator: NO

I am seeing the exact same problem under HP-UX 11.0
(python 2.5).  Slave descriptors are leaked.

This is a problem with Python's pty.fork(), not
with pexpect.

----------------------------------------------------------------------

Comment By: HyunKook Kim (k5r2a)
Date: 2004-08-27 04:07

Message:
Logged In: YES 
user_id=604333

Thank you very much for your comments 

My Case is same to yours.
 -platform : Solaris 5.8
 -Python : 2.3.3
 -pyexpect: 0.99


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=933670&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to