Customizing cgitb

Peter Otten __peter__ at
Thu Sep 2 19:02:35 CEST 2010

D'Arcy J.M. Cain wrote:

> I have a small problem with the cgitb module.  I know that I can
> basically write my own version but it seems kind of silly to rewrite
> something that does 99% what I want.  Here is an excerpt from the
> output of an exception.
>  1520                 (current_job['job_id'], job['_SELECT_']))
>  1521
>  1522     elif job['_ACTION_'].startswith('queue_'):
>  1523         action = job['_ACTION_'][6:]
>  1524         if action == 'mod':
> job = {'_PARENTDIR_': '', '__BAD_DATA__': [], '_REMOTE...orage('npq7',
> '5')]), '_REMOTE_HOST_': 'unknown'} ].startswith undefined
> My problem is that the "job =" line is abridging the value.  I need to
> see all of the variables in the dictionary.  Is there any way I can
> wrap cgitb and get the behaviour I want or do I have to write my own
> method for sys.excepthook?

You could try to monkey-patch pydoc:

import pydoc
def cram(text, maxlen):
    return text 
pydoc.cram = cram


More information about the Python-list mailing list