New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDLE: ValueError; Completions not working right on macOS #86025
Comments
I found this in today's long running shell session. The trigger event isn't known. Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1885, 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/autocomplete_w.py", line 430, in keyrelease_event
self.hide_window()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 447, in hide_window
self.widget.event_delete(HIDE_VIRTUAL_EVENT_NAME, seq)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/multicall.py", line 392, in event_delete
triplets.remove(triplet)
ValueError: list.remove(x): x not in list |
I presume that at some point you got a completion box. It disappeared with this traceback and when >>> appeared, you continued. What python binary? 3.8.5? 3.8.6? My diagnosis so far. __call__ is a method in CallWrapper. The wrapped func is multicall.handler. The exception was caught in the keyrelease_event catches internal errors. If the insert cursor is not where IDLE expects, because "# we didn't catch an event which moved the insert", IDLE just closes box rather than trying to recover. I presume that this should never happen. But when it did, a ValueError was raised for the reason given. In this error state, multicall.event_delete makes an invalid assumption. The simple and immediate fix would be to catch the very rare delete failure. A better and harder fix would be to catch the uncaught insert-moving event. For this, it would have been nice if keyrelease displayed a message identifying the released key with an email request. I should try to reproduce the failure (including on Mac) by trying every key (or type of key) that might possibly move the cursor. |
This is from the 64-bit macOS build on python.org: $ python3.9
Python 3.9.0rc2 (v3.9.0rc2:2bd31b5fde, Sep 16 2020, 20:19:18)
[Clang 6.0 (clang-600.0.57)] on darwin Thanks for looking into this :-) Let me know if filing these issues is helpful to you. I log a couple thousand hours of heavy IDLE usage each year and my students really put the tool through its paces. We tend to uncover buglets that wouldn't surface in light testing. At the end of the day, if there are tracebacks I haven't seen before, I'm posting them here. Hopefully, they are useful. |
On Windows, the only key I found that closed the completion box via keyrelease_event is Left Arrow. If I explicitly caught that, the method might not be needed on Windows. Next I will look at the triplets list and how something might be missing or deleted twice. On my Mac Airbook with current 3.8.6 and 3.9.0rc2, I cannot get a completion box, even with the menu. Do you have the same issue? Reports with a traceback, like this one, are helpful and welcome. If possible, include and information about either the code or action that triggered the exception. |
Reports with a reproducer are also helpful. Again, can you get a completion box at all? |
I don't have a reproducer. The event occurred one in a full-day session. I don't get a completion box. |
This seemingly random error involved completions and there is already an issue about them not working right on macOS. It was also opened by Raymond as a result of another 'random' error in an all day session. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: