Terry J. Reedy <tjre...@udel.edu> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42426>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to