At 02:51 PM 6/22/01 -0500, Ian Bicking wrote:
>Geoff Talvola <gtalvola@...> wrote:
> > I downloaded the patch. I couldn't get your modified version of cgitb.py
> > to work. It worked running it from the command line as a self-test,
> but it
> > failed when I tried to use it within Webware.
>I made the patch about nearly two months ago at Chuck's request. I
>probably should have noted that to the list.
>Anyway, I don't know if Webware has changed since then so that the
>patch isn't really valid anymore. The important parts are the
>modified cgitb and WebUtils/ExpansiveHTMLForException.py, which has
>the same interface as HTMLForException. Everything else is
>configuration stuff, to which I am indifferent.
>Oh, I think I made two small changes to inspect: inspect.trace, so it
>could take the exec_info as an argument, and inspect.getsourcefile, to
>look for files throughout sys.path, instead of just the cwd. Probably
>both these should go upstream.
But neither of these changes seem necessary. In my testing it is able to
pick up the source for modules anywhere, and it's not necessary to pass in
exec_info since you can just get it from sys.
> > Generally, I think we're better off not including modified versions of
> > 3rd-party modules in Webware, especially when the unmodified version works
> > adequately. Instead, I'd recommend trying to get the author of cgitb to
> > incorporate your improvements.
>Some of the changes probably aren't appropriate for cgitb, though I
>should probably send some of the others back to the author. If I
>really was going to take it seriously, I'd probably rewrite cgitb, as
>most of the difficult stuff is in inspect.py anyway, and the
>HTML-generation stuff from pydoc doesn't really appeal to me.
>I strongly think you shouldn't point someone to downloading the file
>elsewhere -- if you want to keep 3rd-party modules pristine, okay, but
>they should be made available through the Webware distribution anyway.
I tend to disagree, but since Chuck is BDFL of Webware I will defer to his
opinion. Also in this case inspect.py and pydoc.py are part of Python
2.1's standard library, so we could just declare that use this feature you
either need to upgrade to Python 2.1 or download the modules separately.
> > I also prefer the approach I took of adding the "fancy traceback" to the
> > end of the error page instead of replacing the standard
> traceback. This is
> > because the amount of information in the fancy traceback can be
> > overwhelming, and most of the time I'd rather just see the standard
>I had that problem too, which is why I made changes to the fancy
>traceback that I think make it much easier to follow. IMHO, my
>version is easier to follow than the normal traceback, though perhaps
>other changes could be made. Admittedly, most of the time I just look
>at the filename/line numbers and go the line in question, so both are
>equivalent in that respect.
>I also made some changes to get rid of some redundant information, and
>to work better with Webware's OO style, where cgitb is more oriented
>toward a function-based style.
Well, those definitely do sound like worthwhile changes. I'd still tend
toward trying to get them incorporated into the standard cgitb.py rather
than forking off our own changes, but again, whatever Chuck wants to do is
- Geoff Talvola