-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
IDLE: problems with completions on Mac #85777
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
Comments
In case it is helpful, here is the error log from a recent full-day IDLE session. $ python3.9 --version
Python 3.9.0rc1
$ python3.9 -m idlelib.idle
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/autocomplete_w.py", line 248, in winconfig_event
acw_width, acw_height = acw.winfo_width(), acw.winfo_height()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1291, in winfo_width
self.tk.call('winfo', 'width', self._w))
_tkinter.TclError: bad window path name ".!listedtoplevel4.!frame.text.!toplevel2"
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
2020-08-20 15:00:38.074 Python[1512:2706287] WARNING: <NSOpenPanel: 0x7ff5a3ed6280> running implicitly; please run panels using NSSavePanel rather than NSApplication.
2020-08-20 16:29:29.880 Python[1512:2706287] WARNING: <NSOpenPanel: 0x7ff5a25566b0> running implicitly; please run panels using NSSavePanel rather than NSApplication. |
The Mac-specific shutdown warning from multiprocessing is not directly related to IDLE. 'multiprocessing' is not imported by IDLE and is not in sys.modules when IDLE starts. From 'all-day' I assume that there was a time period between starting IDLE and getting the traceback. File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 1885, in __call__ __call__ here is a method of CallWrapper, often used for event handlers. File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py", line 248, in winconfig_event winconfig_event handles tk '<configure>' events. "A Configure event is sent to a window whenever its size, position, or border width changes, and sometimes when it has changed position in the stacking order." IDLE triggers it somehow. It has had intermittent bugs before. File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 1291, in winfo_width The name is for an editor window (listedtoplevel) with a frame with a text with a popup (unlisted toplevel). The toplevel2 suggests that this is the second popup for this text. The name looks correct except that I expected 'text' to maybe be '!text'. In any case, the name is generated by tkinter without IDLE being involved. |
Serhiy, should 'text' be '!text' in a tkinter-generated widget name? |
On my Macbook Air Mohave, I don't get completion boxes on either 3.8.3rc1 or 3.9.0rc1, even when clicking Edit => Show completions. Nor does IDLE quit or print anything in Terminal. |
It looks like the lack of completions in msg375769 is a problem with Tk 8.6.8 as used by the python.org installers. I have a build of master with Tk 8.6.10 on my DTK system and with that Edit->Show completions works in a shell window. However: Ctrl+s does not show the completion pop-up, even though the "Edit" button in the application menu flashes (which indicates that Ctrl+s is recognised as a keyboard shortcut). Just using Tab for completion works fine though (shows the completion pop-up). --- I did get a similar traceback to the one in msg375764 once, this is without using multiprocessing. I haven't been able to reproduce this yet. python3.10 -m idlelib
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 1884, in __call__
return self.func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/idlelib/autocomplete_w.py", line 248, in winconfig_event
acw_width, acw_height = acw.winfo_width(), acw.winfo_height()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 1290, in winfo_width
self.tk.call('winfo', 'width', self._w))
_tkinter.TclError: bad window path name ".!listedtoplevel.!frame.text.!toplevel8" |
With 3.10.0b1 on Mac I am getting attribute completion freezes. I had to turn them off. I am tempted to disable completions until there is a Mac IDLE developer to dig into issues like this. |
Confirmed. This may be a separate issue. I have a macOS machine to develop with an will look into this. |
I can reproduce this consistently on macOS by running IDLE, typing "sys.ba" in the shell and pressing the tab key. I've carefully narrowed this down to the call to acw.update() in AutoCompleteWindows.winconfig_event(). Removing that call makes everything work properly. That call to acw.update() was added to address the bug reported in bpo-37849 (see PR #59472). That bug was reported on Windows, but apparently doesn't occur on macOS. A quick test on Ubuntu 20.04 with that call removed also appears to not exhibit that bug. Therefore, I propose making that call only on Windows. Note that there is already another fragile call in the same method that is conditionally called only on Windows, so there is definitely precedent for such a solution. |
I've confirmed that the acw.update() call is still required on Windows to avoid the completion list positioning bug, and that IDLE doesn't freeze as described in this issue on Windows with that call in place. |
See PR #70588. |
To clarify, the above is regarding IDLE freezing on macOS after hitting tab to complete, with no completions window open, and with multiple completions possible. That may not be identical to the issue originally reported here. Apologies if I've caused some confusion. |
See a second PR for the originally reported bug, #70592. |
The completion freeze fix is easily backported to non-Windows installations.
For me, with 3.10.0b1, this restores full functions, with boxes appearing as appropriate. With 3.9.5, no freeze by also no box. 2 or 3 tabs brings up first match. 'pr<tab><tab><tab>' = print, 'int.<tab><tab>' = int.as_integer_ratio. As far as I know, the file is the same in both versions. Both versions are the same in Shell and Editor, so it is not the improved 3.10 shell. |
Both the original bug reported here, and the bug whereby completion could cause IDLE to freeze on macOS, have been fixed and backported to 3.10 and 3.9. |
bpo-40128, which inserted update_idletasks in a different place, fixed completions for me in installed 3.9.5. They already worked fine for me in installed 3.10.0b2. bpo-41859 is another report by Raymond of a 'random' ValueError connected with completions. Closed as a duplicate of this. I opened bpo-44398 about 'cntl+space' being changed to the currently non-functional '^S' as the shortcut for Show completions on the macOS Edit menu. ^space does work. Nearly the same issue as cntl+backslash for Show calltip be displayed as the non-functional ^B. |
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: