]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-71450: Document that Tcl sets the HOME variable on Windows (GH-152568)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 29 Jun 2026 09:56:52 +0000 (11:56 +0200)
committerGitHub <noreply@github.com>
Mon, 29 Jun 2026 09:56:52 +0000 (09:56 +0000)
Also fix the ntpath.expanduser() docstring, which no longer uses $HOME.
(cherry picked from commit 1540584d5d0b6483b78256194825e76d2e52ad21)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/tkinter.rst
Lib/ntpath.py

index 4d8e7e255c393b1313c483f9229699adfb6693f0..801fda8a1ead9565da7f0e34162444058bcd2cef 100644 (file)
@@ -3236,6 +3236,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
index eb127ec2632c6e2faa887a584b80c9c9e365f746..36da5b7cb0fb2a6afc36ca789f0b704aa2aea427 100644 (file)
@@ -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'\\/'