How to launch a pdftk subprocess while in wsgi?
I need to launch a pdftk process while serving a web request in Django, and wait for it to finish. My current pdftk code looks like this: proc = subprocess.Popen(["/usr/bin/pdftk", "/tmp/infile1.pdf", "/tmp/infile2.pdf", "cat", "output", "/tmp/outfile.pdf"]) proc.communicate() This works fine, as long as I'm executing under the dev server (running as user www-data ). But as soon as I switch to mod_wsgi, changing nothing else, the code hangs at proc.communicate() , and "outfile.pdf" is left as an open file handle of zero length. I've tried a several variants of the subprocess invocation (as