Inconsistency in CGI Documentation????

Maan M. Hamze mmhamze at pleiades.net
Tue Aug 21 16:30:17 EDT 2001


"Roman Suzi" <rnd at onego.ru> wrote in message
news:mailman.998412271.8345.python-list at python.org...
> On Tue, 21 Aug 2001, Maan M. Hamze wrote:
>
> >Question:  How do you provide this argument?
> >Test_Form=cgi.FieldStorage(keep_blank_values)??  This is not working.
>
> OK. Trying this:
>
> >>> import os
> >>> os.environ['QUERY_STRING']="aaa=1&b=&c=12"
> >>> Test_Form = cgi.FieldStorage()
> >>> Test_Form.keys()
> ['aaa', 'c']
> >>> Test_Form = cgi.FieldStorage(keep_blank_values=1)

Ok.  I see.  I tried the example.  Thanks for this information.  I see how
this works now.

> >>> Test_Form.keys()
> ['aaa', 'b', 'c']
>
> I can't see any inconsitencies...
> nb. the way keep_blank_values are given (it's a named argument).
>
> >Ok!  I am not going to provide this argument.  So, the Text Input element
> >that I left empty and had not provided a vlaue for should NOT make it
into
> >FieldStorage() if user does not type some characters in it.  Right?  I
tried
> >it.  It does not make it.
> >Even if I provide a value of " " (is " " an empty string??)
> >
> >2.  BUT, read on:
> >check http://www.python.org/doc/essays/ppt/sd99east/sld041.htm  Slide #
40
> ><form method="POST" action="http://host.com/cgi-bin/test.py">
> >Your first name: <input type="text" name="firstname">
> ><submit button goes here>
> ><input type="hidden" name="session" value="1f9a2">
> ></form>
>
> You can
>
Ignacio provided an answer to the seemingly contradictory issue.  I'll just
have to figure out why I am not getting the value with a white space in the
list of keys.
Thanks,
Maan





More information about the Python-list mailing list