Unhelpful error message

Chris Angelico rosuav at gmail.com
Tue Jun 6 17:32:33 EDT 2017


On Wed, Jun 7, 2017 at 7:28 AM, Terry Reedy <tjreedy at udel.edu> wrote:
>> Yeah. Unfortunately this exception doesn't make good use of its args,
>> so you can't get programmatic information from it (this is true in 3.7
>> too actually). So if a change were to be made, I'd recommend putting
>> the actual string into e.args[1] or something, and then the message
>> shouldn't need to be parsed. I'm not sure what the backward compat
>> guarantees on exception messages are, though, so it is possible that
>> this might be changed in 2.7.
>
>
> Unless a message is erroneous (buggy), it is usually treated as an
> enhancement.

That's what I thought. If the OP's happy to upgrade to 3.6/3.7, of
course, the problem disappears.

ChrisA



More information about the Python-list mailing list