[pypy-dev] "OSError: [Errno 10] No child processes"

Armin Rigo arigo at tunes.org
Tue Jan 11 21:56:53 CET 2011


Hi Amaury,

On Tue, Jan 11, 2011 at 4:41 PM, Amaury Forgeot d'Arc
<amauryfa at gmail.com> wrote:
> It's probably related to our file.__del__ which does not silence
> errors raised by close().

Indeed, it seems to be the case.  Arnd, to answer the original
question: there is a file that you are not explicitly closing, and
when its __del__ method is (later) invoked, it raises an OSError which
is printed and ignored.  The real problem you have there is that you
should close your files (in this case, an <fdopen> file, so I guess
it's actually a pipe returned by os.popen*()).

The secondary problem that we have is what to do when file.__del__
gets an exception from calling close().  Is it ok to just ignore it?
FWIW in CPython, file.__del__ also prints an error message if close()
raises an exception.  So from that point of view there is nothing to
fix in PyPy, apart maybe making the error message a bit more explicit
(CPython prints "close failed in file object destructor:...").


A bientôt,

Armin.



More information about the Pypy-dev mailing list