Close stdout socket on CGI after fork with subprocess

Thibaud Roussillat thibaud.roussillat at gmail.com
Fri Jan 7 09:38:26 EST 2011


Hi,

I work with Python 2.4 and CGI.

I have a CGI which call a Python script in background process and return
result before background task is finished.

Actually, the browser displays response but it is waiting for end of
background task because the socket is not closed.

Internet told me that I must close the stdout file descriptor
(sys.stdout.close()) to close the socket but it doesn't work.

The background task is launched via subprocess.Popen and is attached to the
root process on ps command.

Any idea ?

Thanks

Thibaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110107/5141d303/attachment.html>


More information about the Python-list mailing list