astral-sh / astral-sh/python-build-standalone

tkinter.tix is broken on Linux - remove it?

Open
#723 5 comments 0 reactions 1 assignee Claimed by @geofft View on GitHub
Dominant language
Python
Stars
4.4k
Forks
314
Avg merge
1d 9h
Merged PRs (30d)
27

Description

Tix is an old widget toolkit for Tk. Python had bindings for it as `tkinter.tix`, which were marked deprecated in Python 3.6 and removed in Python 3.13.

Our UNIX build tries to support it for Python <3.13, except on macOS, where as noted in the quirks doc it doesn't work. But it also doesn't seem to work for me on Linux:

```pycon
$ DISPLAY=:1 uvx python3.9
Python 3.9.23 (main, Jul 8 2025, 20:58:46)
[Clang 20.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter.tix
>>> t = tkinter.tix.Tk()
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/.local/share/uv/python/cpython-3.9.23-linux-x86_64-gnu/lib/python3.9/tkinter/tix.py", line 214, in __init__
self.tk.eval('package require Tix')
_tkinter.TclError: couldn't load file "/home/ubuntu/.local/share/uv/python/cpython-3.9.23-linux-x86_64-gnu/lib/Tix8.4.3/libTix8.4.3.a": /home/ubuntu/.local/share/uv/python/cpython-3.9.23-linux-x86_64-gnu/lib/Tix8.4.3/libTix8.4.3.a: invalid ELF header
```

I made a guess that libTix might be statically linked somewhere and locally changed lib/Tix8.4.3/pkgIndex.tcl from `[list load [file join $dir libTix8.4.3.a] Tix]` to `[list load {} Tix]`, but that gets me

```pycon
>>> t = tkinter.tix.Tk()
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/.local/share/uv/python/cpython-3.9.23-linux-x86_64-gnu/lib/python3.9/tkinter/tix.py", line 214, in __init__
self.tk.eval('package require Tix')
_tkinter.TclError: package "Tix" isn't loaded statically
```

(I noticed this as part of thinking about how to switch libTcl and libTk to dynamic linking and wondering how libTix worked... the answer appears to be that it doesn't.)

Because nobody has raised an issue about needing `tkinter.tix`, it's deprecated, and it's unavailable on Mac, I propose to remove it instead of trying to fix this.

(I haven't tested whether it works on Windows. It might, and if so I don't plan to remove it.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.