[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset dd20643b144d1c81989d235c3ec51f18fda618c2 by Miss Islington (bot) 
in branch '3.9':
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
https://github.com/python/cpython/commit/dd20643b144d1c81989d235c3ec51f18fda618c2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


miss-islington  added the comment:


New changeset 28b40d7a349787817fe5f6ebfa753c29b96c8832 by Miss Islington (bot) 
in branch '3.8':
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
https://github.com/python/cpython/commit/28b40d7a349787817fe5f6ebfa753c29b96c8832


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22345
pull_request: https://github.com/python/cpython/pull/23454

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +22344
pull_request: https://github.com/python/cpython/pull/23453

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 453bc1da2023d6cbe362637a2e0b06d0521f013c by Serhiy Storchaka in 
branch 'master':
bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)
https://github.com/python/cpython/commit/453bc1da2023d6cbe362637a2e0b06d0521f013c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Terry J. Reedy


Terry J. Reedy  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +22339
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23447

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42426] IDLE: Fix reporting RE error in searchengine

2020-11-21 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

In Lib/idlelib/searchengine.py there is a code which decomposes re.error and 
reports error message, pattern, and position of error.

The problem is that that code does not match the structure of re.error. It 
takes args[0] as error message, and args[1] (if specified) as position in the 
pattern. But actually re.error always sets args[0] to formatted error message, 
and args has only one item. So some code in IDLE is dead.

Currently reported:

   Error: bad escape \z at position 1
   Pattern: a\z

Expected:

   Error: bad escape \z
   Pattern: a\z
   Offset: 1

--
assignee: terry.reedy
components: IDLE
messages: 381566
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Fix reporting RE error in searchengine
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com