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: Python 2.6 tutorial still recommends using Exception.message attribute
Type: Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: cito, georg.brandl
Priority: normal Keywords:

Created on 2009-08-24 19:50 by cito, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg91937 - (view) Author: Christoph Zwerschke (cito) * Date: 2009-08-24 19:50
The Python 2.6.2 tutorial says at the end of secton 8.3
(http://docs.python.org/tutorial/errors.html#handling-exceptions):

"But use of .args is discouraged. Instead, the preferred use is to pass 
a single argument to an exception (which can be a tuple if multiple 
arguments are needed) and have it bound to the message attribute."

It seems this is not true any more, the idea has been retracted so that 
it's now the other way around again: .args can still be used, 
but .message is deprecated (see http://www.python.org/dev/peps/pep-
0352/#retracted-ideas).

The examples classes in section 8.5 of the Tutorial, using the .message 
attribute should be also adapted because they raise a 
DeprecationWarning in Python 2.6.2.
msg92250 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-09-04 11:33
Thanks, corrected in r74653.
History
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 51026
2009-09-04 11:33:42georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg92250
2009-08-24 19:50:33citocreate