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 — Remove unused TK_AQUA code · Issue #103538 · python/cpython

Remove unused TK_AQUA code #103538

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove unused TK_AQUA code#103538
Copy link
Labels
OS-macstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-tkintertype-featureA feature request or enhancementA feature request or enhancement

Description

@chrstphrchvz
chrstphrchvz
opened on Apr 14, 2023
Issue body actions

Sections of code which are guarded by #ifdef TK_AQUA were committed in cb85244. But from examining the CPython
and Tcl/Tk repository histories, it appears nothing has ever defined this macro. (Tk Aqua itself instead defines/uses the MAC_OSX_TK macro.) The only mentions of it I found elsewhere were as -DTK_AQUA passed to build commands, either in a Setup.local file (https://mail.python.org/pipermail/pythonmac-sig/2001-December/004553.html, https://mail.python.org/pipermail/pythonmac-sig/2002-November/006746.html) or manual command line invocation (https://mail.python.org/pipermail/pythonmac-sig/2002-January/004776.html).

So I believe this code has long been unused, and I suspect that trying to use it now is not a good idea. Can it be removed?

Linked PRs

  • gh-103538: Remove unused TK_AQUA code #103539

Activity

  1. chrstphrchvz
    added a commit that references this issue on Apr 14, 2023

    pythongh-103538: Remove unused TK_AQUA code

    c035fc2
  2. arhadthedev
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-tkinter
    type-featureA feature request or enhancementA feature request or enhancement
    OS-mac
    on Apr 14, 2023
  3. hugovk commented on Apr 14, 2023

    @hugovk
    hugovk
    on Apr 14, 2023
    Member
    More actions

    I didn't find any relevant use using GitHub's beta code search:

    • https://github.com/search?q=%2F%5CbTK_AQUA%5Cb%2F&type=code
    • https://github.com/search?q=%2F%5Cdefine+TK_AQUA%2F&type=code

    And zero use in the top 5k PyPI projects:

    • https://dev.to/hugovk/how-to-search-5000-python-projects-31gk

    For reference, the commit references BPO number 490100, which is now at gh-35685.

    There's some mention of Aqua Tk and TK_AQUA in #49370, ping participants @terryjreedy, @ronaldoussoren, @ned-deily.

    And #49370 (comment) says:

    I've talked with Daniel Steffen, who is one of the maintainers of Tcl/Tk
    on Mac OSX, and I was told that all this conditional code in _tkinter.c
    and tkappinit.c for TK_AQUA is outdated starting with tk 8.4.8, but tk
    8.4.7 that ships with macosx (which happens to be the version being used
    by the buildslave mentioned above) also includes the patch that
    deprecates the usage, and we should be calling only Tk_Init on
    tkappinit.c which will deal with all the details (the details are in
    tkMacOSXInit:TkpInit).

    There is an entry in tk's changelog that is directly related to this:
    http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/ChangeLog.2004?revision=1.1&view=markup
    (lines 210-220)

    Any chance I can change _tkinter and tkappinit to check for
    TKINTER_OLD_AQUA (new macro to be added) instead of TK_AQUA and verify
    if it helps the buildslaves ?

    Working link to ChangeLog.2004: https://github.com/tcltk/tk/blob/64e6bc556004238f93a9ccb5c2b826aed8310882/ChangeLog.2004#L210-L220

    Searching https://github.com/tcltk/tk I don't find TK_AQUA or TKINTER_OLD_AQUA in uppercase, or searching with git log -S TK_AQUA etc. Also no TKINTER_OLD_AQUA in any case.

    However, there are still some lowercase tk_aqua in:

    • unix/configure.ac
    • unix/configure
    • ChangeLog.2007

    https://github.com/search?q=repo%3Atcltk%2Ftk%20tk_aqua&type=code

    Are they relevant?

    Reacted by Christopher Chavez
  4. chrstphrchvz commented on Apr 14, 2023

    @chrstphrchvz
    chrstphrchvz
    on Apr 14, 2023
    ContributorAuthor
    More actions

    I didn't find any relevant use using GitHub's beta code search:

    • https://github.com/search?q=%2F%5CbTK_AQUA%5Cb%2F&type=code
    • https://github.com/search?q=%2F%5Cdefine+TK_AQUA%2F&type=code

    I checked git log -S TK_AQUA (which I imagine is more exhaustive than the GitHub code search) for a deep clone of CPython and the only commit it lists is cb85244.

    For reference, the commit references BPO number 490100, which is now at gh-35685.

    Thanks for finding the patch issue; I was not sure where I might find that.

    There's some mention of Aqua Tk and TK_AQUA in #49370, ping participants @terryjreedy, @ronaldoussoren, @ned-deily.

    Thanks for bringing that issue up as well; I did not notice it during my earlier search. The changes proposed in oldtkaqua.diff still do not cause TK_AQUA to be defined anywhere, so I do not think that patch ever had any effect. But since that patch intended to make the relevant code apply only to Tk 8.4.7 and earlier, and Tkinter has since required 8.5.12 or later, I believe that is further indication that the code can now be removed.

    However, there are still some lowercase tk_aqua in:

    • unix/configure.ac
    • unix/configure
    • ChangeLog.2007

    https://github.com/search?q=repo%3Atcltk%2Ftk%20tk_aqua&type=code

    Are they relevant?

    In the configure scripts, lowercase tk_aqua is just a shell script variable. It is used to define a macro:

    if test $tk_aqua != no; then
        AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?])
    

    …but there is nothing similar to define TK_AQUA.

  5. chrstphrchvz
    added a commit that references this issue on Apr 14, 2023

    pythongh-103538: Remove unused TK_AQUA code

    92529ee
  6. hugovk commented on Apr 14, 2023

    @hugovk
    hugovk
    on Apr 14, 2023
    Member
    More actions

    Thanks for checking. @zware: here's another cleanup like #103532, looks okay?

    For reference, the commit references BPO number 490100, which is now at gh-35685.

    Thanks for finding the patch issue; I was not sure where I might find that.

    I guessed the number could be a BPO number, you can find them in the old tracker at https://bugs.python.org tracker which has redirects to the migrated issues here on GitHub. (I used my CLI https://github.com/hugovk/pepotron and typed in bpo 490100 and it opened the GH issue directly.)

    Reacted by Zachary Ware
  7. chrstphrchvz
    added 3 commits that reference this issue on Apr 14, 2023

    pythongh-103538: Remove unused TK_AQUA code

    51cee3a

    pythongh-103538: Remove unused TK_AQUA code

    4e730af

    pythongh-103538: Remove unused TK_AQUA code

    3854440
  8. zware
    added 2 commits that reference this issue on May 10, 2023

    pythongh-103538: Remove unused TK_AQUA code

    de28d35

    gh-103538: Remove unused TK_AQUA code (GH-103539)

    e464ec9
  9. zware commented on May 10, 2023

    @zware
    zware
    on May 10, 2023
    Member
    More actions

    Thanks for the cleanup!

  10. zware
    closed this as completedon May 10, 2023
  11. carljm
    added 2 commits that reference this issue on May 10, 2023

    Merge branch 'main' into fixloadsuperspec

    5976df9

    Merge branch 'main' into supermon

    19b3d9e
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

    OS-macstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-tkintertype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      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.