[Python-Dev] cgitb.py for Python 2.2

Guido van Rossum guido@zope.com
Tue, 31 Jul 2001 02:22:13 -0400


> Sorry i've been fairly quiet recently -- at least life isn't dull.

You still have a few SF bugs and patches assigned!  How about
addressing those?!

> I wanted to put in a few words for cgitb.py for your consideration.
> 
> I think you all saw it at IPC 9 -- if you missed the presentation,
> there are examples at http://www.lfw.org/python to check out.

Yeah, it's cool.

> What i'm proposing is that we toss cgitb.py into the standard library
> (pretty small at about 100 lines, since all the heavy lifting is in
> pydoc and inspect).  Then we can add this to site.py:
> 
>     if os.environ.has_key("GATEWAY_INTERFACE"):
>         import sys, cgitb
>         sys.excepthook = cgitb.excepthook

Why not add this to cgi.py instead?  Th site.py initialization is
accumulating a lot of cruft, and I don't like new additions that are
irrelevant for most apps (CGI is a tiny niche for Python IMO).  (I
also think all the stuff that's only for interactive mode should be
moved off to another module that is only run in interactive mode.)

--Guido van Rossum (home page: http://www.python.org/~guido/)