https://github.com/python/cpython/commit/11c3a404a6a05157758e4128866dfef60e2b16fa commit: 11c3a404a6a05157758e4128866dfef60e2b16fa branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-06-29T10:04:11Z summary:
[3.15] gh-71450: Document that Tcl sets the HOME variable on Windows (GH-152568) (GH-152574) Also fix the ntpath.expanduser() docstring, which no longer uses $HOME. (cherry picked from commit 1540584d5d0b6483b78256194825e76d2e52ad21) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> files: M Doc/library/tkinter.rst M Lib/ntpath.py diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index dfade1345ca901..44b3c42a936a39 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -3298,6 +3298,14 @@ Toplevel widgets profile files is the :envvar:`HOME` environment variable or, if that isn't defined, then :data:`os.curdir`. + .. note:: + + On Windows, creating a Tcl interpreter (by instantiating :class:`Tk` or + calling :func:`Tcl`) sets the :envvar:`HOME` environment variable for + the process, if it is not already set, to ``%HOMEDRIVE%%HOMEPATH%`` (or + :envvar:`USERPROFILE`, or ``c:\``). This is done by Tcl and can affect + other code that reads :envvar:`HOME`. + .. attribute:: tk The Tk application object created by instantiating :class:`Tk`. This diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 811e796f7766e9..b3c23f0abc2d88 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -345,7 +345,7 @@ def _isreservedname(name): def expanduser(path): """Expand ~ and ~user constructs. - If user or $HOME is unknown, do nothing.""" + If user or home directory is unknown, do nothing.""" path = os.fspath(path) if isinstance(path, bytes): seps = b'\\/' _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
