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.

Author zach.ware
Recipients Jarrod Petz, eryksun, markroseman, paul.moore, serhiy.storchaka, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2016-06-11.06:10:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465625418.79.0.0536038337423.issue27263@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-06-11 06:10:18zach.waresetrecipients: + zach.ware, terry.reedy, paul.moore, tim.golden, markroseman, serhiy.storchaka, eryksun, steve.dower, Jarrod Petz
2016-06-11 06:10:18zach.waresetmessageid: <1465625418.79.0.0536038337423.issue27263@psf.upfronthosting.co.za>
2016-06-11 06:10:18zach.warelinkissue27263 messages
2016-06-11 06:10:17zach.warecreate