[issue44163] IDLE ValueError in HyperParser

2021-05-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

For now, I want to just improve the error message and then close.

--

___
Python tracker 

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



[issue44163] IDLE ValueError in HyperParser

2021-05-20 Thread Tal Einat


Tal Einat  added the comment:

I took a look but can't see any obvious bugs there. ISTM that's a rather 
harmless edge case. I can't think of anything to do with this except to close 
for now, and reopen if this pops up again.


Thinking a few steps forward, to make sense of such issues, it would be greatly 
beneficial to get a full stack dump rather than just a traceback. Perhaps we 
should add something of the sort to IDLE, ideally something which works even 
when not running from the command line?

--

___
Python tracker 

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



[issue44163] IDLE ValueError in HyperParser

2021-05-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

So, consider both possibilities where relevant.  In the future, I will assume 
that you are running standard, up-to-date, Mac build unless you say otherwise.

I presume you start IDLE from terminal and check it before shutting down.  I 
have wondered whether it might be worthwhile to try to catch the occasional 
messages even when running from an icon.  Seems it might be.

This conditional exception was part of the 2005 merge of the separate IDLE 
branch.  So there is no history to say whether 'just-in-case' or known trigger.

--

___
Python tracker 

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



[issue44163] IDLE ValueError in HyperParser

2021-05-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I constantly move back and forth between the editor and the shell, so am not 
sure where the issue occurred.  Also, I've never seen this one before so it 
isn't easily triggered.   Am running Python 3.9.5 in class.  Am not using a 
special build, it is the macOS build found on python.org.

--

___
Python tracker 

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



[issue44163] IDLE ValueError in HyperParser

2021-05-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you for the report.  Which 3.9.?  hyperparser has not changed in a year, 
but some of the calltip logic has.

This occurred when you typed a '(' and IDLE tried to open a calltip but failed, 
and you did not notice its absence.  Easy when not looking for it to help 
complete the call, especially when others are around.  Do you have any idea if 
more likely to have been in editor or shell, or did you use a mix of both?

The preceding lines are

indexinrawtext = (len(self.rawtext) -
  len(self.text.get(index, self.stopatindex)))
if indexinrawtext < 0:

The resolution of this issue might be augment the error message to print the 
window type, the index as line.col as well as 'insert', the two lengths, and at 
least part of the text.

We should perhaps look at other callback error messages that IDLE raises.

--
nosy: +taleinat

___
Python tracker 

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



[issue44163] IDLE ValueError in HyperParser

2021-05-17 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Here's a new error that I hadn't seen before.  I occurred at some point during 
a full day training session, so am not sure what triggered the failure:

Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
 line 1892, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py",
 line 176, in handler
r = l[i](event)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/calltip.py",
 line 51, in try_open_calltip_event
self.open_calltip(False)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/calltip.py",
 line 62, in open_calltip
hp = HyperParser(self.editwin, "insert")
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/hyperparser.py",
 line 79, in __init__
self.set_index(index)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/hyperparser.py",
 line 89, in set_index
raise ValueError("Index %s precedes the analyzed statement"
ValueError: Index insert precedes the analyzed statement

--
assignee: terry.reedy
components: IDLE
messages: 393845
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE ValueError in HyperParser
type: behavior
versions: Python 3.9

___
Python tracker 

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