[Python-Dev] quick patch for better debugging

Hunter Peress hunterp at fastmail.fm
Sun Nov 23 19:27:20 EST 2003


Both IndexError and KeyError dont report which object the retrieval
failed on. Having this data would save lots of typing and annoyance.

Eg:
KeyError: 'jio'  could look like KeyError: "Dictionary(some_name) has no
key 'jio'"

IndexError: list index out of range  could look like:  IndexError:
list(some_name) index(some_value) out of range


If this is ok, ill make a patch!

-----
PS: And for those of you that think even more debugging info is needed,
think no more, because I prodded enough a few months ago such that
textmode cgitb is now in 2.3 tree. 

Try:

import cgitb; cgitb.enable(format='text') 

make error here.
-- 
  Hunter Peress
  hunterp at fastmail.fm



More information about the Python-Dev mailing list