Re: unboundlocalerror with cgi module

2006-04-11 Thread bruno at modulix
David Bear wrote: > I'm attempting to use the cgi module with code like this: > > import cgi > fo = cgi.FieldStorage() > # form field names are in the form if 'name:part' > keys = fo.keys() > for i in keys: > try: > item,value=i.split(':') > except NameError, Unboun

Re: unboundlocalerror with cgi module

2006-04-10 Thread Tim Hochberg
Kent Johnson wrote: > Tim Hochberg wrote: > >>Kent Johnson wrote: >> >>>David Bear wrote: >>> >>> I'm attempting to use the cgi module with code like this: import cgi fo = cgi.FieldStorage() # form field names are in the form if 'name:part' keys = fo.keys() for i in ke

Re: unboundlocalerror with cgi module

2006-04-10 Thread Fredrik Lundh
"David Bear" wrote: > I'm attempting to use the cgi module with code like this: > > import cgi > fo = cgi.FieldStorage() > # form field names are in the form if 'name:part' > keys = fo.keys() > for i in keys: > try: > item,value=i.split(':') > except NameError, Unbo

Re: unboundlocalerror with cgi module

2006-04-10 Thread Tim Hochberg
Tim Hochberg wrote: > Kent Johnson wrote: > >>David Bear wrote: >> >> >>>I'm attempting to use the cgi module with code like this: >>> >>>import cgi >>>fo = cgi.FieldStorage() >>># form field names are in the form if 'name:part' >>>keys = fo.keys() >>>for i in keys: >>> try: >>>

Re: unboundlocalerror with cgi module

2006-04-10 Thread Kent Johnson
Tim Hochberg wrote: > Kent Johnson wrote: >> David Bear wrote: >> >>> I'm attempting to use the cgi module with code like this: >>> >>> import cgi >>> fo = cgi.FieldStorage() >>> # form field names are in the form if 'name:part' >>> keys = fo.keys() >>> for i in keys: >>>try: >>>

Re: unboundlocalerror with cgi module

2006-04-10 Thread Tim Hochberg
Kent Johnson wrote: > David Bear wrote: > >>I'm attempting to use the cgi module with code like this: >> >>import cgi >>fo = cgi.FieldStorage() >># form field names are in the form if 'name:part' >>keys = fo.keys() >>for i in keys: >>try: >>item,value=i.split(':') >>

Re: unboundlocalerror with cgi module

2006-04-10 Thread Kent Johnson
David Bear wrote: > I'm attempting to use the cgi module with code like this: > > import cgi > fo = cgi.FieldStorage() > # form field names are in the form if 'name:part' > keys = fo.keys() > for i in keys: > try: > item,value=i.split(':') > except NameError, Unboun

Re: unboundlocalerror with cgi module

2006-04-10 Thread Felipe Almeida Lessa
Em Seg, 2006-04-10 às 11:29 -0700, David Bear escreveu: > However, the except block does not seem to catch the exception and an > unboundlocalerror is thrown anyway. What am I missing? See http://docs.python.org/tut/node10.html : """ A try statement may have more than one except clause, to specif

unboundlocalerror with cgi module

2006-04-10 Thread David Bear
I'm attempting to use the cgi module with code like this: import cgi fo = cgi.FieldStorage() # form field names are in the form if 'name:part' keys = fo.keys() for i in keys: try: item,value=i.split(':') except NameError, UnboundLocalError: print "ex