[Python-bugs-list] [ python-Bugs-761888 ] popen2.Popen3 and popen2.Popen4 leaks filedescriptors

SourceForge.net noreply@sourceforge.net
Fri, 27 Jun 2003 07:58:01 -0700


Bugs item #761888, was opened at 2003-06-27 16:58
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=761888&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Troels Walsted Hansen (troels)
Assigned to: Nobody/Anonymous (nobody)
Summary: popen2.Popen3 and popen2.Popen4 leaks filedescriptors

Initial Comment:
The code below (from Lib/popen2.py) appears to leak no
less then 4 filedescriptors if os.fork() raises an
exception (say "OSError: [Errno 12] Not enough space"
on a Solaris box running out of swap).

Popen3.__init__() appears to leak 6 filedescriptors.

class Popen4(Popen3):
    def __init__(self, cmd, bufsize=-1):
        p2cread, p2cwrite = os.pipe()
        c2pread, c2pwrite = os.pipe()
        self.pid = os.fork()


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=761888&group_id=5470