I set up a subprocess.Popen to generate a pdf through pdflatex. Code snippet:
process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
output, err = process.communicate()
print output
print err
It works just fine, but the problem is the error message. If pdflatex doesn't manage to generate a file, e.g. I get the message "Fatal error occured, no output PDF file produced!"
at the end of the printed output, I still get "None"
printed out as the err.
Any insight would be appreciated
Edit: Adding stderr=subprocess.PIPE
helps. I don't get "None"
anymore, but I do get a blank error message regardless of whether or not the generation of the pdf is successful. It now looks like this:
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
same as above