GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — IDLE: protect macOS Tk() call when no GUI · Issue #97527 · python/cpython

IDLE: protect macOS Tk() call when no GUI #97527

New issue
Copy link
New issue
Copy link
Closed
Closed
IDLE: protect macOS Tk() call when no GUI#97527
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-IDLEtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@terryjreedy
terryjreedy
opened on Sep 24, 2022
Issue body actions

The no-gui (mock Text) test_squeezer.SqueezerTest.test_write_stdout indirectly calls squeezer.Squeezer.mywrite, which calls macosx.isAquaTk, which calls _init_tk_type, which calls tkinter.Tk to initialize macosx._tk_type. When a test is run on macOS with no GUI, this crashes; see #97032 for an example.

test_squeezer later calls isAquaTk directly. Even if we fix test_squeezer, there are about 10 other isAquaTk calls in idlelib that someday might be triggered by more complete tests. I will try patching _init_tk_type in branch tktype to skip Tk() when it would crash.

Activity

  1. terryjreedy
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    topic-IDLE
    3.11only security fixesonly security fixes
    3.10 (EOL)end of lifeend of life
    3.12only security fixesonly security fixes
    on Sep 24, 2022
  2. terryjreedy
    added this to IDLE Issueson Sep 24, 2022
  3. terryjreedy
    added 2 commits that reference this issue on Sep 24, 2022

    pythongh-97527: IDLE: protect macosx Tk() call when no GUI

    5417a3d

    gh-97527: IDLE: protect macosx Tk() call when no GUI (#97530)

    9704f8d
  4. miss-islington
    added 4 commits that reference this issue on Sep 24, 2022

    pythongh-97527: IDLE: protect macosx Tk() call when no GUI (pythonGH-…

    e2154d9

    pythongh-97527: IDLE: protect macosx Tk() call when no GUI (pythonGH-…

    27e7229

    gh-97527: IDLE: protect macosx Tk() call when no GUI (GH-97530)

    a7a7da4

    gh-97527: IDLE: protect macosx Tk() call when no GUI (GH-97530)

    fe8db63
  5. terryjreedy
    closed this as completedon Sep 24, 2022
  6. terryjreedy
    moved this to Done in IDLE Issueson Sep 24, 2022
  7. terryjreedy
    reopened this on Oct 15, 2022
  8. terryjreedy commented on Oct 15, 2022

    @terryjreedy
    terryjreedy
    on Oct 15, 2022
    MemberAuthor
    More actions

    The fix in #97530 for a testing-only bug, merged after 3.11.rc2, introduced a runtime-only bug of disable IDLE startup when test/* is not installed. This bug was released in 3.12.0a1, 3.10.8, and Microsoft Python 3.10.2288.0. It was reported on SO for the last: https://stackoverflow.com/questions/74070702/python-m-idlelib-idle-not-working-windows-10/74082858#74082858.

    The immediate fix for anyone is to delete the import on line 7 and replace the try suite on line 23 with pass. Windows people who omitted the test suite can Modify and add it.

    @pablogsal I hope you did not cherr-pick the buggy 'fix' into 3.11.0. If you did, I will have a better fix soon.

    @zooba Does MS Python allow installing the test? Once the new fix is merged, could you let the MS Python person know?

    @ned-deily As near as I could tell, one cannot install psf mac python without the tests. Correct? Do you know about homebrew? (And will we ever be rid of some of the mac graphics options?)

    [Longer term, I want to consolidate macosx imports and if possible only do them on mac.]

  9. pablogsal commented on Oct 15, 2022

    @pablogsal
    pablogsal
    on Oct 15, 2022
    Member
    More actions

    All cherry picks will be done hours before the release so we are safe. Just tell me what you want me to add and I will make sure is there the day of the final release .

  10. terryjreedy
    added a commit that references this issue on Oct 16, 2022

    pythongh-97527: IDLE - fix buggy macosx patch

    9ee8f5c
  11. terryjreedy commented on Oct 16, 2022

    @terryjreedy
    terryjreedy
    on Oct 16, 2022
    MemberAuthor
    More actions

    #98313 follows on #97530. Reversion or #97530 or merging of #98313 would only be essential if #97530 had already been merged. The net effect of both is to prevent test_idle possibly crashing macOS with no GUI, now or with test revisions. AFAIK, CI and buildbots only run current repository versions, not release versions. So I don't think the release needs any change.

  12. terryjreedy
    added a commit that references this issue on Oct 16, 2022

    gh-97527: IDLE - fix buggy macosx patch (#98313)

    35fa5d5
  13. miss-islington
    added 5 commits that reference this issue on Oct 16, 2022

    pythongh-97527: IDLE - fix buggy macosx patch (pythonGH-98313)

    d4a2d06

    pythongh-97527: IDLE - fix buggy macosx patch (pythonGH-98313)

    36a6279

    pythongh-97527: IDLE - fix buggy macosx patch (pythonGH-98313)

    50ef214

    gh-97527: IDLE - fix buggy macosx patch (GH-98313)

    928b5f1

    gh-97527: IDLE - fix buggy macosx patch (GH-98313)

    21fbf16
  14. terryjreedy
    closed this as completedon Oct 16, 2022
  15. zooba commented on Oct 17, 2022

    @zooba
    zooba
    on Oct 17, 2022
    Member
    More actions

    @terryjreedy No, the Store package doesn't have any way to install the test suite. If we need those helpers, they should be copied elsewhere (either idlelib, tkinter or unittest probably - I'll let you make that call).

    That said, if they're only needed for Mac, then handling the import error should also be fine.

  16. carljm
    added a commit that references this issue on Oct 17, 2022

    Merge branch 'main' into typewatch

    cdbe93b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-IDLEtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • IDLE Issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.