Skip to content
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: OK sometimes fails to close configdialog #82110

Closed
terryjreedy opened this issue Aug 23, 2019 · 6 comments
Closed

IDLE: OK sometimes fails to close configdialog #82110

terryjreedy opened this issue Aug 23, 2019 · 6 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 37929
Nosy @terryjreedy, @taleinat, @miss-islington
PRs
  • bpo-37929: avoid Squeezer-related config dialog crashes #15452
  • [3.7] bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452) #15484
  • [3.8] bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452) #15485
  • 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 2019-08-25.06:25:32.367>
    created_at = <Date 2019-08-23.13:27:44.808>
    labels = ['3.8', 'expert-IDLE', 'type-bug', '3.7', '3.9']
    title = 'IDLE: OK sometimes fails to close configdialog'
    updated_at = <Date 2019-08-25.06:25:32.366>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2019-08-25.06:25:32.366>
    actor = 'taleinat'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2019-08-25.06:25:32.367>
    closer = 'taleinat'
    components = ['IDLE']
    creation = <Date 2019-08-23.13:27:44.808>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37929
    keywords = ['patch']
    message_count = 6.0
    messages = ['350281', '350356', '350428', '350430', '350431', '350433']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'taleinat', 'miss-islington']
    pr_nums = ['15452', '15484', '15485']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37929'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @terryjreedy
    Copy link
    Member Author

    If one opens configdialog when there is no Shell and then hits OK, the dialog fails to close. The following Squeezer-related traceback appears in associated console when there is one.

    Exception in Tkinter callback
    Traceback (most recent call last):
      File "F:\dev\3x\lib\tkinter\__init__.py", line 1885, in __call__
        return self.func(*args)
      File "F:\dev\3x\lib\idlelib\configdialog.py", line 172, in ok
        self.apply()
      File "F:\dev\3x\lib\idlelib\configdialog.py", line 186, in apply
        self.activate_config_changes()
      File "F:\dev\3x\lib\idlelib\configdialog.py", line 240, in activate_config_changes
        klass.reload()
      File "F:\dev\3x\lib\idlelib\squeezer.py", line 222, in reload
        instance.load_font()
      File "F:\dev\3x\lib\idlelib\squeezer.py", line 318, in load_font
        Font(text, font=text.cget('font')).measure('0')
      File "F:\dev\3x\lib\idlelib\delegator.py", line 10, in __getattr__
        attr = getattr(self.delegate, name) # May raise AttributeError
    AttributeError: 'NoneType' object has no attribute 'cget'

    Either the squeezer instance should be destroyed and removed along with Shell or, if keeping it is intentional, it should be removed from the update list and reinstated or if not doing that is intentional, it must either check 'if text is not None' before the access or catch the attribute error after. Tal, which?

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Aug 23, 2019
    @terryjreedy terryjreedy self-assigned this Aug 23, 2019
    @terryjreedy terryjreedy added topic-IDLE type-bug An unexpected behavior, bug, or error labels Aug 23, 2019
    @taleinat
    Copy link
    Contributor

    See PR #59657 with a fix.

    @taleinat
    Copy link
    Contributor

    New changeset d4b4c00 by Tal Einat in branch 'master':
    bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
    d4b4c00

    @miss-islington
    Copy link
    Contributor

    New changeset f2b468d by Miss Islington (bot) in branch '3.7':
    bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
    f2b468d

    @miss-islington
    Copy link
    Contributor

    New changeset e266d06 by Miss Islington (bot) in branch '3.8':
    bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
    e266d06

    @taleinat
    Copy link
    Contributor

    Fixed.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants