I'm using subprocess.Popen and getting IOErrors when running under mod_wsgi. The following code will work in a python term, or a django runserver, and under mod_python. If you put it under mod_wsgi (v2), it fails: (2, 'No such file or directory') I have tried many variations involving using subprocess.PIPE. I have tried to redefine stdout, and to use the httpd directives to turn off mod_wsgi's complains of stdout usage. I recently tried upgrading to version 3.
import subprocess
input_file = 'test.html'
p = subprocess.Popen(['htmldoc','-f', 'output.pdf', '--book', input_file])
p.communicate()
len(open('output.pdf').read())
My test effort is going to be to move back to mod_python, and see if the problem goes away. I'd like to know if anyone else has done this and can shed some light on this problem.
in the body, and htmldoc will convert it to pdf.
– gene Aug 09 '10 at 22:01