[Python-Dev] Re: [ python-Bugs-1048808 ] test_subprocess 2.4b1 fails on FreeBSD 5.2

Peter Astrand astrand at lysator.liu.se
Wed Oct 20 20:19:58 CEST 2004


On Wed, 20 Oct 2004, Ludovic Aubry wrote:

> I would say it is not safe:
>
> f=file("hello")
> from os import fork, execl
>
> if fork()!=0:
>    execl("python", "python" )
>
> This leaves fd=3 open on linux

Yes, but with the subprocess module and close_fds=True, subprocess
explicitly closes all fds except 0,1,2, between fork and exec. I'm talking
about the problem with the Python interpreter opening *new* files during
startup.



/Peter Åstrand <astrand at lysator.liu.se>



More information about the Python-Dev mailing list