Cannot Get Form To Work

Victor Subervi victorsubervi at gmail.com
Sun Jul 26 17:48:29 CEST 2009


Oops. My bad. I did in fact have this line of code before calls to form:

form = cgi.FieldStorage()

I changed the except command from "pass" to "print sys.exc_info()" as per
your suggestion. Still, however, the form just renews itself without
offering any information whatsoever. You can see this here, if you like:
http://13gems.com/test-Calculators_frame.py
TIA,
beno

On Thu, Jul 23, 2009 at 2:01 PM, Dennis Lee Bieber <wlfraed at ix.netcom.com>wrote:

> On Thu, 23 Jul 2009 12:46:16 -0300, Victor Subervi
> <victorsubervi at gmail.com> declaimed the following in
> gmane.comp.python.general:
>
> > sent. Here again is the code:
> >
> > from primeNumbers import primeNumbers
> >
> > try:
> >  lang = form.getfirst('lang', 'en')
>
>         This code is incomplete -- where is "form" created? I see no
> "import"s that might define such...
>
> >  browser = form.getfirst('browser', 'all')
> >  site = form.getfirst('site', 'bridge')
> >  num = form.getfirst('num','')
> > except:
> >  pass
>
>         Since there is no such thing as "form" in the code you posted, the
> first "form.getfirst()" operation will raise an exception. That
> exception is then being ignored by this "pass".
>
>        I'd suggest moving the code that outputs the HTTP response header
> and the HTML prelude material to the top, then replace "pass" with
> something that prints actual exception information (the stuff from
> sys.exc_info() )
> --
>        Wulfraed        Dennis Lee Bieber               KD6MOG
>        wlfraed at ix.netcom.com           wulfraed at bestiaria.com
>                HTTP://wlfraed.home.netcom.com/
>        (Bestiaria Support Staff:               web-asst at bestiaria.com)
>                HTTP://www.bestiaria.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090726/0b190933/attachment.html>


More information about the Python-list mailing list