TypeError: not indexable in cgi.py?

Kurt Jansen KurtJansen at go.com
Thu Aug 23 07:06:47 CEST 2001


Sorry if this may be a newbie question, but that is exactly what I am.  I am trying to build a Web site using Python as the CGI script language.  I am trying to get a HTML form read and processed by the cgi.py Library module, but am not having much luck.

When I press the 'submit' button on my Web page, it executes the followig CGI test script:

#!/usr/bin/python
import cgi
cgi.test()

This script produces the following error message:

Traceback (innermost last):
  File "/usr/lib/python1.4/cgi.py", line 1151, in test
    print_form(form)
  File "/usr/lib/python1.4/cgi.py", line 1192, in print_form
    keys = form.keys()
  File "/usr/lib/python1.4/cgi.py", line 859, in keys
    raise TypeError, "not indexable"
TypeError: not indexable

Can anyone tell me what this error means, or better yet, how to fix it?

This is my HTML source:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Family Information</TITLE>
</HEAD>
<BODY><FORM method="POST" action="/cgi-bin/formhandler.py" enctype="text/plain" target="_self">First Name<INPUT size="12" type="text" name="fname" maxlength="20"> Last Name <INPUT size="15" type="text" name="lname"><BR>
<INPUT type="submit" name="sub" value="Submit"></FORM>
</BODY>
</HTML>

I appreciate any and all assistance.
Kurt Jansen

___________________________________________________
GO.com Mail                                    
Get Your Free, Private E-mail at http://mail.go.com






More information about the Python-list mailing list