Ticket #921 (closed enhancement: wontfix)
Using cgitb module to help in debugging.
| Reported by: | mcarpenter@… | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | web frontend/mod_python | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: |
Description
While using the mod_python front end I'm getting database lock errors (soon to be the subject of another ticket). I was getting 500 errors from apache. It was helpful for me to add a cgitb handler.
Index: trac/ModPythonHandler.py
===================================================================
--- trac/ModPythonHandler.py (revision 1049)
+++ trac/ModPythonHandler.py (working copy)
@@ -178,7 +178,17 @@
env_cache_lock.release()
return env
+import cgitb
+
def handler(req):
+ try:
+ handler2(req)
+ except:
+ req.content_type = 'text/html'
+ cgitb.Hook(file = req).handle()
+ return apache.OK
+
+def handler2(req):
mpr = ModPythonRequest(req)
mpr.init_request()
Now I can see the error in my browser, rather than tailing the error.log for apache. Perhaps this would be useful for other users debugging an install.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


