finding keys in cgi module 
Author Message
 finding keys in cgi module

This seems a little odd.  I use the cgi module all the time but in this
case I get an odd error.  Here is what I do.

import cgi
inp = cgi.FieldStorage()
for k in inp.keys():
    ...

etc.  This always works fine when I bring up the page normally.  The
problem is that if I reload the current page it sometimes fails with
this error.

Traceback (innermost last):
  File "/home/trends/www/mumby/order.cgi", line 16, in ?
    for k in inp.keys():
  File "/usr/local/lib/python1.5/cgi.py", line 890, in keys
    raise TypeError, "not indexable"
TypeError: not indexable

This doesn't happen every time I reload but often enough to be annoying.
Does anyone have any idea why this is failing and how I can get the
indeces that I care about without raising an exception?

--

http://www.*-*-*.com/ ;                |  and a sheep voting on        
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



Sat, 03 Feb 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. cgi behaviouring with key=& url

2. find a key word and delete 5 lines before it and 5 lines after this

3. Finding all the Keys used in an APP

4. How to find when the enter key pressed in a memo

5. finding non-unique keys in index.

6. finding out what keys do

7. found the bug in cgi.rb

8. *now* I have found the bug in cgi.rb, really :)

9. Finding parent key in nested arrays

10. Newbie: finding the key/index of the min/max element

11. Fixing the FAQ (was Re: Newbie: finding the key/index of the min/max element)

12. Where to find all functions that can be bound to keys in Pythowin

 

 
Powered by phpBB® Forum Software