fork/exec & close file descriptors

Marko Rauhamaa marko at pacujo.net
Wed Jun 3 10:43:26 EDT 2015


Marko Rauhamaa <marko at pacujo.net>:

> So the strategy you proposed is the right one: have the child process
> ignore any possible errors from os.close(). The parent will have an
> opportunity to deal with them.
>
> And now Linux is back in the good graces, only the man page is
> misleading.

However, the child process needs to be prepared for os.close() to block
indefinitely because of an NFS problem or because SO_LINGER has been
specified by the parent, for example. Setting the close-on-exec flag
doesn't help there.


Marko



More information about the Python-list mailing list