A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025448.html below:

[Python-Dev] unicode() and its error argument

[Python-Dev] unicode() and its error argumentSkip Montanaro skip@pobox.com
Sat, 15 Jun 2002 23:53:57 -0500
    >> This reminds me, it occurred to me the other day that a plain text
    >> version of cgitb would be useful to use for non-web scripts.  You'd
    >> get a lot more context about the environment in which the exception
    >> was raised.

    Guido> Not a bad idea.  I think it could live in the traceback module,
    Guido> possibly as a family of functions named "fancy_traceback" and
    Guido> similar.  Care to do a patch?

I just submitted a patch done differently than you suggested.  I simply
added a text() formatting routine to cgitb.py and an extra 'format' argument
to cgitb.enable().  Now, if you want plain text output, just call enable()
like so

    import cgitb
    cgitb.enable(format="text")

I think I muffed the HTML formatting (there was an odd little bit of logic
in there I believe I might have botched).  I'll take another look at that
and submit a revised patch if necessary and include a little doc update.

For the curious, the patch is at

    http://python.org/sf/569574

Guido expressed interest, so I assigned it to him. ;-)

Skip





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4