It might not be the script, but might be the environment. I've been burned by something similar in the past when I had my CGI script in my home dir (default +r) and didnt have the permissions correct on the dir. Not only does the script have to be +r +x, but the dir it is in has to be as well for the apache user.
-adam -- http://mail.python.org/mailman/listinfo/python-list