Problems with Python running improperly in CGI scripts?!? (Help!)

Randy Burgess rburgess1 at
Fri Jan 10 23:13:40 CET 2003

I am having an acute crisis with a CGI script-driven site I coded to run on
part of my overall Web site, which is hosted by Hostway (

Hostway only runs Python 1.5.1, but I got as close as I could in my
development environment by installing 1.5.2 and coding against that. The
scripts I developed ran fine after uploading to Hostway's unix server for
several days. Then, this morning, three of the scripts (each script = a
page) began bombing out, refusing to honor a very simple conditional that is
identical in all three.

When I checked I found the condition is being found not true because a
string value that should be getting stripped is *not* getting stripped. When
I test outside the pages - whether at the command line via SSH or in a test
page launched as a CGI script - string.strip works correctly. But inside the
page (which is rather more complex) it either blows up entirely, killing the
rest of the script, or else fails to strip at all.

Given that the pages worked absolutely fine for several days, and that I
haven't changed anything, I am guessing something has gone wrong with Python
itself - even though small tests work OK. I have e-mailed Hostway support
but they haven't gotten back to me.

Has anyone heard of anything like this happening with Python CGI scripts,
and with some scripts but not others? I know that when I run the Python
interpreter locally via IDLE, it's possible for it to get confused and need
restarting to process scripts properly - but I would have thought a
CGI-driven copy of Python would be immune to this. It's really bothering me,
in part because the site is one I set up for several important clients, who
now cannot use it.

Randy Burgess

More information about the Python-list mailing list