John, I was getting a very similar error running tilecache on Apache/Linux, but under mod_python. I found that I had to rollback the mod_python version from 3.3.1 to 3.2.10 to make this go away. Not that this is related to your cgi issue, but I thought I'd throw it out to the list. Brian