Skip to content

IDLE crash on startup with typo in config-keys.cfg #55646

Closed

Description

@GeorgeDhoore
BPO 11437
Nosy @terryjreedy, @ned-deily, @serwy, @asvetlov
Files
  • config-keys.cfg: File that crashes IDLE in interpreter mode
  • issue11437.patch
  • 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 = None
    created_at = <Date 2011-03-08.00:13:57.851>
    labels = ['3.7', 'expert-IDLE', 'type-bug', 'expert-tkinter']
    title = 'IDLE crash on startup with typo in config-keys.cfg'
    updated_at = <Date 2017-09-28.06:58:52.142>
    user = 'https://bugs.python.org/GeorgeDhoore'

    bugs.python.org fields:

    activity = <Date 2017-09-28.06:58:52.142>
    actor = 'taleinat'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE', 'Tkinter']
    creation = <Date 2011-03-08.00:13:57.851>
    creator = 'George.Dhoore'
    dependencies = []
    files = ['21039', '24351']
    hgrepos = []
    issue_num = 11437
    keywords = ['patch']
    message_count = 18.0
    messages = ['130301', '130387', '151993', '151994', '152187', '157095', '157098', '157206', '157208', '157211', '157213', '157215', '220093', '220107', '220391', '226890', '280685', '297253']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'ned.deily', 'roger.serwy', 'asvetlov', 'George.Dhoore', 'Saimadhav.Heblikar']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11437'
    versions = ['Python 3.6', 'Python 3.7']

    Linked PRs

    Activity

    1. asvetlov commented on Mar 31, 2012

      @asvetlov
      Contributor

      Ok

    2. serwy commented on Mar 31, 2012

      serwymannequin
      Mannequin

      I just realized that if the user, for whatever reason, fixes a bad key binding and then rebinds it to the previously bad one, no error message would appear. This can occur if the user is switching between key sets where one key set contains invalid bindings.

    3. asvetlov commented on Mar 31, 2012

      @asvetlov
      Contributor

      You right. That was my concern.

    4. BreamoreBoy commented on Jun 9, 2014

      BreamoreBoymannequin
      Mannequin

      @Roger, Andrew could you pick this up again?

    5. terryjreedy commented on Jun 9, 2014

      @terryjreedy
      Member

      Mark, they are both inactive at the moment.

      There are a number of issue around configuration, especially key bindings. I think the whole process needs review and redoing. For instance, I understand Roger as saying that the problematical known-invalid list (set) is needed because GetCurrentKeySet is called repeatedly, once for each extension. I want to look into fixing the repeated calls, which will increase with more extensions, and possibly eliminate the need for known-invalid.

      Another redesign: I think Control-Key-x should automatically mean Control-Key-X, and ditto for Alt-Key-x, and that we should not need both in config-keys even if tk requires separate bind calls.

      Saimadhav, we should try to do some validation of the key bindings in the unittest for configurations. The pattern seems to be
      optional Control-, Alt-, or Meta-
      optional Shift-
      required Key-
      required ascii key, bracketleft/right, or Uppercase-key-name,

    6. taleinat commented on Jun 12, 2014

      @taleinat
      Contributor

      I don't think the patch should currently be committed.

      I agree with Terry: we should first fix the issue whereby the key config is read repeatedly. Given such a fix, the problematic "known_invalid" workaround in the patch would no longer be necessary.

      As a side note, I think the method used in the patch to check if a binding is good. Ideally it would be the final check done after a simpler syntax check, since a syntax check could give more informative error messages.

      Also, there are two other more technical issues with the patch; I mentioned them in the patch review system.

    7. terryjreedy commented on Sep 14, 2014

      @terryjreedy
      Member

      https://stackoverflow.com/questions/25750477/python-2-7-8-idle-will-not-open-on-mavericks -- because one of the two files has 'shift' instead of Shift. When I make a change in either file (with custom keys being used), the traceback ends slightly differently until the final message.

      File "C:\Programs\Python34\lib\idlelib\EditorWindow.py", line 1100, in apply_bindings
      text.event_add(event, *keylist)
      File "C:\Programs\Python34\lib\idlelib\MultiCall.py", line 379, in event_add
      widget.event_add(self, virtual, seq)
      File "C:\Programs\Python34\lib\tkinter\init.py", line 1441, in event_add
      self.tk.call(args)

      bpo-21519 is about checking bindings entered in the dialog with either the basic or advanced methods. Bindings also need to be checked when read so we know which file is bad. Exception tracebacks should be replaced by more helpful messages that include fix-up instructions and which do not disappear into the void when running on pythonw.

    8. terryjreedy commented on Nov 13, 2016

      @terryjreedy
      Member

      I closed bpo-25662 in favor of this.

    9. terryjreedy commented on Jun 29, 2017

      @terryjreedy
      Member

      Tal's comments from Rietveld review (see msg220391);

      529: Does this have to be a separate, new Tk instance? Wouldn't a temporary widget under the current Tk be just as good? Creating a new Tk instance could take a relatively large amount of time time and perhaps also have visual side-effects.

      me> better to use original if possible.

      545: Here keylist is mutated inside the for loop which iterates over it. This looks like a bug, and in any case should be avoided.

      me> looping over invalid. But this is part of repeated check which we should avoid.

    10. transferred this issue fromon Apr 10, 2022
    11. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 23, 2023
    12. removed
      stdlibStandard Library Python modules in the Lib/ directory
      on Jan 15, 2026
    13. added a commit that references this issue on Jul 1, 2026
    14. added a commit that references this issue on Jul 2, 2026
    15. added 2 commits that reference this issue on Jul 2, 2026
    16. moved this to In Progress in IDLE Issueson Aug 7, 2026
    17. added
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Aug 7, 2026
    18. added 3 commits that reference this issue on Sep 25, 2026
    19. added a commit that references this issue on Sep 28, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    topic-IDLEtopic-tkintertype-bugAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions