This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Overzealous deprecation of BaseException.message
Type: Stage: resolved
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: BaseException DeprecationError raises inappropriately
View: 6844
Assigned To: Nosy List: aisaac, bethard, ezio.melotti, frankoid, ncoghlan, tseaver
Priority: normal Keywords:

Created on 2009-04-07 12:07 by tseaver, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg85695 - (view) Author: Tres Seaver (tseaver) * Date: 2009-04-07 12:07
I'm working on cleaning up deprecations for Zope and related
packages under Python 2.6.  The irony here is that I'm receiving
deprecation warnings for custom exception classes  which had a 'message'
attribute long before the abortive attempt to add them to the
BaseException type, which hardly seems reasonable.

For instance, docutils.parsers.rst defines a DirectiveError which takes
two arguments, 'level' and 'message', and therefore gets hit with the
deprecation (even though it never used the new signature).  Likewise,
ZODB.POSException defines a ConflictError type which takes 'message' as
one of several arguments, all optional, and has since at least 2002.

I don't think either of these classes should be subject to a deprecation
warning for a feature they never used or depended on.
msg85710 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2009-04-07 15:03
I've run into exactly the same thing. The argparse module's
ArgumentError had a "message" attribute back in Python 2.4, and in
Python 2.6 I get the same warnings Tres is getting.
msg96270 - (view) Author: Alan Isaac (aisaac) Date: 2009-12-11 18:31
FYI a patch has been committed that should fix this. For discussion see
http://bugs.python.org/issue6844
msg96278 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-12-11 23:13
Closing this as a duplicate of #6844.
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49966
2009-12-11 23:13:03ezio.melottisetstatus: open -> closed

superseder: BaseException DeprecationError raises inappropriately

nosy: + ezio.melotti
messages: + msg96278
resolution: duplicate
stage: resolved
2009-12-11 18:31:46aisaacsetnosy: + aisaac
messages: + msg96270
2009-05-12 23:27:03frankoidsetnosy: + frankoid
2009-04-07 21:48:28ncoghlansetnosy: + ncoghlan
2009-04-07 15:03:54bethardsetnosy: + bethard
messages: + msg85710
2009-04-07 12:07:04tseavercreate