This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: FixTk.py logic wrong
Type: Stage:
Components: Tkinter Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: gvanrossum, idiscovery, loewis
Priority: normal Keywords:

Created on 2002-06-05 06:09 by idiscovery, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
FixTk.py idiscovery, 2002-11-03 05:06
Messages (5)
msg11053 - (view) Author: Internet Discovery (idiscovery) Date: 2002-06-05 06:09
The logic in FixTk.py is wrong for Tix: the Tix version number
is independent of the Tk/Tcl version number.

Just duplicate the Tcl code logic for Tix, and don't reuse the 
Tcl version number.

msg11054 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-06-10 19:25
Logged In: YES 
user_id=6380

Can you please supply a patch?

The code in 2.2 and later is different; is that still
broken?  If so, please supply two patches!
msg11055 - (view) Author: Internet Discovery (idiscovery) Date: 2002-11-03 05:06
Logged In: YES 
user_id=33229

Sorry for the lack of detail: the logic is wrong because the version number
of Tix is assumed to be the same as the version number of Tcl in _tkinter.
Right now they are different (8.3 or 8.4 for Tcl and 8.1 for Tix) and in general
these days with stubs in Tcl, they are unrelated. Any Tix should work with any
Tcl after Tcl 8.1 or so. So the answer is to remove tix from the for loop, and just
copy the Tcl block of logic and change the tcl to tix as in the following (untested)

if not os.environ.has_key("TIX_LIBRARY"):
        for name in os.listdir(prefix):
            if name.startswith("tix"):
                tixdir = os.path.join(prefix,name)
                if os.path.isdir(tixdir):
                    os.environ["TIX_LIBRARY"] = tixdir
               del tixdir

Note that as it stands now there is a subtle difference between the logic for 
setting TCL_LIBRARY and for setting TK_LIBRARY (ignoring tix completely).
Imagine you have a Tcl directory with no environment variables and the following subdirs:
        tcl8.3 tcl8.4 tk8.3 tk8.4
If os.listddir returns the directories in alphabetical order I think you end up with
       TCL_LIBRARY=.../tcl8.4 (there's no break in the for name loop)
and TK_LIBRARY=.../tk8.3 if tk was compiled with tcl  8.3 (_tkinter.TCL_VERSION)
With Tk8.4 now finally released this a real potential scenario.
This may be good or bad - the attached file maintains it.

The discussion above and the attached file applies to all versions of Python,
so it should be tagged for any 2.x branch. I think the same is true for Tix.py.
msg11056 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-11-07 14:49
Logged In: YES 
user_id=6380

Randomly assigned to Martin. Martin, can you do this? If
not, assign it back to me.
msg11057 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-11-09 19:03
Logged In: YES 
user_id=21627

This was fixed in FixTk.py 1.7 and 1.5.10.2.

Please provide diffs in the future.
History
Date User Action Args
2022-04-10 16:05:23adminsetgithub: 36696
2002-06-05 06:09:52idiscoverycreate