Re: Python 2.6: How to turn off cgitb.py's DeprecationWarning:BaseException.message has been depreca

Discussion in 'Python' started by Thomas Jollans, Sep 24, 2010.

  1. On Friday 24 September 2010, it occurred to to exclaim:
    > Python 2.6: We're using the standard lib's cgitb module to
    > provide diagnostic messages when unexpected exceptions occur.
    >
    > Unfortunately, this module raises a DeprecationWarning like below
    > when it is used:
    >
    > C:\Python26\lib\cgitb.py:245: DeprecationWarning:
    > BaseException.message has been
    > deprecated as of Python 2.6
    > value = pydoc.text.repr(getattr(evalue, name))
    >
    > Is there some way to disable this specific warning message (our
    > customers find it disconcerting) or do we have to go in and edit
    > the cgitb.py module itself? Also, wondering if this warning has
    > been addressed in Python 2.7/3.x?


    Yes. Filtering is an important part of the Python warnings framework:

    http://docs.python.org/library/warnings.html#warnings.filterwarnings
    http://www.python.org/dev/peps/pep-0230/
     
    Thomas Jollans, Sep 24, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    2
    Views:
    490
    Cheung, Jeffrey Jing-Yen
    Jul 8, 2003
  2. Robin Becker

    cgitb vs traceback

    Robin Becker, May 10, 2004, in forum: Python
    Replies:
    7
    Views:
    379
    Fernando Perez
    May 15, 2004
  3. Robin Becker

    bug in inspect (was cgitb vs traceback)

    Robin Becker, Jun 6, 2004, in forum: Python
    Replies:
    1
    Views:
    307
    Robin Becker
    Jun 6, 2004
  4. robert112
    Replies:
    1
    Views:
    474
    Juan T. Llibre
    Apr 26, 2007
  5. Chad Austin
    Replies:
    0
    Views:
    292
    Chad Austin
    Aug 20, 2007
Loading...

Share This Page