Re: Internet search engine

Guido.van.Rossum@cwi.nl
Mon, 27 Mar 1995 15:48:06 +0200

> I've written a script that uses the Dbhash library to search a small
> database, this works fine. I now want to put a HTML front end on the
> database for access via the WWW. I've tried using the cgi interface to
> do this but it doesn't work. I can write cgi scripts that generate
> HTML on the fly but the call to the Dbhash library seems to interfere
> with this process. The script returns all the generated HTML up to the
> following line:
>
> db = Dbhash("test_dbhash", 'r', 0600,1024,32)
>
> none of the generated HTML is returned after this point. If I run the
> script at the shell promt it works and the generated HTML is legal.
>
> Does anyone know what's happening?

It's almost certain that your script hits an exception at this point
(it's happened to me many times :-)

You can probably find the exception output in your http server log
(this works for me, but it may be server dependent, or you may not be
able to read the log file if your sysadmin hides it).

If you can't find it in the log file, try something like this:

try:
db = Dbhash("test_dbhash", 'r', 0600,1024,32)
except:
import sys
print "<H2>EXCEPTION</H2>"
print sys.exc_type, ":", sys.exc_value
sys.exit(0)

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>