Python 2.6: How to turn off's DeprecationWarning: BaseException.message has been deprecated

Thomas Jollans thomas at
Fri Sep 24 19:25:08 CEST 2010

On Friday 24 September 2010, it occurred to python at 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\ 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 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:

More information about the Python-list mailing list