[Python-bugs-list] closing a popen file descriptor (PR#33)

laik@cs.stanford.edu laik@cs.stanford.edu
Tue, 20 Jul 1999 14:00:13 -0400 (EDT)


Full_Name: Kevin Lai
Version: 1.5.2
OS: Linux 2.2.10
Submission from: (NULL) (192.25.214.6)


I can't close a pipe's file descriptor without an error:

>>> import os
>>> p1 = os.popen("cat dummy1", "r")
>>> p2 = os.popen("cat dummy2", "r")
>>> p1.close()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
IOError: (0, 'Error')

It only happens if I do two or more popens. If I try to close any file
descriptor
but the last one I opened, I get this mysterious IOError. It happens regardless
of the order I try to close the descriptors.