[Tutor] CGI File Woes
Alan Gauld
alan.gauld at btinternet.com
Sun Sep 30 18:26:17 CEST 2007
"wormwood_3" <wormwood_3 at yahoo.com> wrote
> I had not heard of it until this week when I started working on
> CGI stuff, but I have found it super handy! All you have to do
> it "import cgitb; cgitb.enable()" and all tracebacks will get
> printed to nicely formatted HTML output on the page you
> were trying to load.
Ok, Heres a thought.
try forcing an error after opening the file.
See what the traceback says. You can add a message
string to an exception so that it will print...
class LogError(Exception): pass
raise LogError, "Any old text here"
So you force the cgitb to kick in and print the mesage you
specify, use it like a print statement to debug whats happening...
Its a bit laborious but better than nothing!
See if that helps
Alan G
More information about the Tutor
mailing list