Zachary Ware added the comment:

For the original issue, I agree with Eryk that about the best we can do is to 
document that Tcl sets HOME as "%HOMEDRIVE%%HOMEPATH%" or "c:\" if both of 
those are not set.  I wonder about removing (or de-preferring) HOME in 
os.path.expanduser, but that would be a significantly backward incompatible 
change.  Since HOME is not set by default on Windows, setting it is the easiest 
way to manipulate os.path.expanduser, and changing it is going to break things.

The TCL_LIBRARY issue is completely separate.  I rewrote the logic that used to 
be in tkinter._fix for 3.5, it's now a part of _tkinter initialization and 
TCL_LIBRARY is no longer set (permanently) by tkinter (TK_LIBRARY is not set or 
inspected at all anymore, except by Tk itself).  I did this in an effort to 
avoid the environment warnings in the tkinter/IDLE tests, but apparently missed 
the HOME issue at that point.

Anyhow, we could theoretically unset TCL_LIBRARY (and TK_LIBRARY) in that 
initialization code, possibly conditional on whether TCL_VERSION can be found 
in the content of TCL_LIBRARY (the assumption being that a library for the same 
major version of Tcl ought to work anyway).  However, without that conditional, 
that would be another big backward compatibility issue; setting 
{TCL,TK}_LIBRARY is a legitimate way to point tkinter towards a non-standard 
Tcl/Tk library location (e.g. in an embedding situation).  With conditional 
clearing of {TCL,TK}_LIBRARY, we're still at the mercy of a just plain bad 
setting that just happens to contain the magic string that makes it look 
acceptable.

I'm -1 on making such a change anyway.  We've avoided permanently setting 
TCL_LIBRARY for many many years, other applications can figure out how to avoid 
it as well.  We can't try to clean up messes made by other badly behaved 
programs, that way lies madness.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27263>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to