Message381586
The confusion about error.args is this:
BaseException.args is documented as "The tuple of arguments given to the exception constructor."
https://docs.python.org/3/library/exceptions.html#base-classes
args[0] is usually and I would expect it to always be the formatted message, which is to say, the string normally printed at the end of tracebacks.
The signature of re.error is documented as "(msg, pattern=None, pos=None)"
https://docs.python.org/3/library/re.html#re.error
and this is what inspect.signature says (as reported in IDLE calltip).
So one might expect .args to be a 3-tuple.
With the value fetching fixed, the displayed message could be changed to something else (in another issue), such as
Error: bad escape \z in pattern r'a\z' at offset 1
Thanks for the patch. |
|
Date |
User |
Action |
Args |
2020-11-22 03:15:57 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka |
2020-11-22 03:15:57 | terry.reedy | set | messageid: <1606014957.69.0.667841008869.issue42426@roundup.psfhosted.org> |
2020-11-22 03:15:57 | terry.reedy | link | issue42426 messages |
2020-11-22 03:15:57 | terry.reedy | create | |
|