Is there any easy way to debug cgi python programs apart from looking at the log file each time the browser generates an error?
You could capture (or form by hand) the data and env variables which the CGI script receives, then plainly run the script under your favorite debugger and  feed the data to it.
In order to capture the incoming data you can just dump it from the script in CGI mode to some log file, then re-use under debugger in standalone mode.
Debugging CGI python