Skip to content

IDLE: problems with completions on Mac #85777

Closed

Description

@rhettinger
BPO 41611
Nosy @rhettinger, @terryjreedy, @ronaldoussoren, @vstinner, @taleinat, @ned-deily, @serhiy-storchaka, @miss-islington
PRs
  • bpo-41611: IDLE: fix freezing on completion on macOS #26400
  • [3.10] bpo-41611: IDLE: fix freezing on completion on macOS (GH-26400) #26401
  • [3.9] bpo-41611: IDLE: fix freezing on completion on macOS (GH-26400) #26402
  • bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() #26404
  • [3.10] bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404) #26419
  • [3.9] bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404) #26420
  • 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:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2021-06-12.04:48:58.260>
    created_at = <Date 2020-08-21.17:51:37.650>
    labels = ['OS-mac', 'expert-IDLE', '3.9', '3.10', '3.11']
    title = 'IDLE: problems with completions on Mac'
    updated_at = <Date 2021-06-12.04:48:58.260>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2021-06-12.04:48:58.260>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2021-06-12.04:48:58.260>
    closer = 'terry.reedy'
    components = ['IDLE', 'macOS']
    creation = <Date 2020-08-21.17:51:37.650>
    creator = 'rhettinger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41611
    keywords = ['patch']
    message_count = 21.0
    messages = ['375764', '375767', '375768', '375769', '380925', '394508', '394523', '394527', '394528', '394530', '394531', '394543', '394544', '394546', '394587', '394591', '394634', '394635', '394636', '394637', '395676']
    nosy_count = 8.0
    nosy_names = ['rhettinger', 'terry.reedy', 'ronaldoussoren', 'vstinner', 'taleinat', 'ned.deily', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['26400', '26401', '26402', '26404', '26419', '26420']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41611'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. rhettinger commented on Aug 21, 2020

      @rhettinger
      ContributorAuthor

      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.
    2. terryjreedy commented on Aug 21, 2020

      @terryjreedy
      Member

      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__
      return self.func(*args)

      __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
      acw_width, acw_height = acw.winfo_width(), acw.winfo_height()

      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
      self.tk.call('winfo', 'width', self._w))
      _tkinter.TclError: bad window path name ".!listedtoplevel4.!frame.text.!toplevel2"

      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.

    3. changed the title [-]IDLE warnings and exceptions[/-] [+]IDLE: problem[/+] on Aug 21, 2020
    4. changed the title [-]IDLE warnings and exceptions[/-] [+]IDLE: problem[/+] on Aug 21, 2020
    5. terryjreedy commented on Aug 21, 2020

      @terryjreedy
      Member

      Serhiy, should 'text' be '!text' in a tkinter-generated widget name?

    6. terryjreedy commented on Aug 21, 2020

      @terryjreedy
      Member

      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.

    7. changed the title [-]IDLE: problem[/-] [+]IDLE: problems with completions on Mac[/+] on Aug 21, 2020
    8. 18 remaining items

    9. terryjreedy commented on May 27, 2021

      @terryjreedy
      Member

      The completion freeze fix is easily backported to non-Windows installations.

      1. Run IDLE
      2. File => Open Module, enter 'idlelib.autocomplete_w', OK.
      3. Goto line 247 (3.9) or 250 (3.10) with "acw.update".
      4. Add # in from of above to disable it.
      5. Save and close IDLE, then restart.

      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.

    10. taleinat commented on May 28, 2021

      @taleinat
      Contributor

      New changeset 4e2e5c1 by Tal Einat in branch 'main':
      bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404)
      4e2e5c1

    11. taleinat commented on May 28, 2021

      @taleinat
      Contributor

      New changeset 448abe8 by Miss Islington (bot) in branch '3.10':
      bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404)
      448abe8

    12. taleinat commented on May 28, 2021

      @taleinat
      Contributor

      New changeset 21a56a4 by Miss Islington (bot) in branch '3.9':
      bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404)
      21a56a4

    13. taleinat commented on May 28, 2021

      @taleinat
      Contributor

      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.

    14. terryjreedy commented on Jun 12, 2021

      @terryjreedy
      Member

      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.

    15. removed
      type-bug
      on Jun 12, 2021
    16. removed
      type-bug
      on Jun 12, 2021
    17. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.10 (EOL)3.113.9 (EOL)OS-mactopic-IDLE

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions