[[email protected]: Re: [mod_python] Tutorials, FieldStorage and sys.py. A depressing saga.]

Dustin Mitchell dustin at ywlcs.org
Thu May 22 08:56:20 EST 2003


Sorry, meant to send this to the list.

----- Forwarded message from Dustin Mitchell <dustin at ywlcs.org> -----

From: Dustin Mitchell <dustin at ywlcs.org>
To: Terry MacDonald <terry at i3technologies.co.uk>
Subject: Re: [mod_python] Tutorials, FieldStorage and sys.py. A depressing saga.

On Thu, May 22, 2003 at 01:45:55PM +0100, Terry MacDonald wrote:
>   File "/var/www/html/python/sample.py", line 90, in ?
>     form = cgi.FieldStorage()
> 
>   File "/usr/lib/python2.2/cgi.py", line 448, in __init__
>     elif sys.argv[1:]:

You're using the CGI module, but you're not using a CGI script.  The mod_python distribution has a FieldStorage class, but it's (subtly) different from the one in the Python standard 'cgi' module.

import mod_python.util
form = mod_python.util.FieldStorage(req)

Read the docs on that module for more info.

Dustin

-- 

  Dustin Mitchell
  dustin at ywlcs.org/djmitche at alumni.uchicago.edu
  http://people.cs.uchicago.edu/~dustin/

----- End forwarded message -----

-- 

  Dustin Mitchell
  dustin at ywlcs.org/djmitche at alumni.uchicago.edu
  http://people.cs.uchicago.edu/~dustin/


More information about the Mod_python mailing list