I am trying to get errors from my python script without any luck. It just dies and reports
"The server encountered an unexpected condition which prevented it from fulfilling the request. The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log. "
If I send the content type headers in advance it seems to just die quietly.
UPDATE: I thought I would add this comment here in case someone else or me finds it again wondering how to print python errors.
import sys, traceback
tb = "no errors"
"""do something here that raises an exception"""
except Exception as e:
tb = traceback.format_exc()
print """Content-Type: text/plain; charset=utf8\n\n%s""" % (tb,)