I once needed to know about SyntaxError's attributes. Here's what pydoc SyntaxError from Python 2.5 says:
| Data descriptors defined here: | | filename | exception filename | | lineno | exception lineno | | message | exception message
So far so good
| | msg | exception msg
| | offset | exception offset | | print_file_and_line | exception print_file_and_line
| | text | exception text
My, that was useful. Maybe the online documentation will be better?
- exception SyntaxError
Instances of this class have attributes filename, lineno, offset and text for easier access to the details. str() of the exception instance returns only the message.
Um. Well, at least now I know I can ignore both 'msg' and 'message'. I think. Still, it would be nice to warn that sometimes the exception text can be multi-line.